Metadata-Version: 2.4
Name: spac-kit-europa-clipper
Version: 0.1.0
Summary: CCSDS packet definitions for Europa Clipper instruments
License: Apache-2.0
Author: Joshua Garde
Author-email: jgarde@jpl.nasa.gov
Requires-Python: >=3.12,<4.0
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Provides-Extra: dev
Requires-Dist: bitstring (>=4.3.1,<4.4.0) ; extra == "dev"
Requires-Dist: ccsdspy (>=1.4.3,<1.5.0)
Requires-Dist: flake8 (>=6.0.0,<7.0.0) ; extra == "dev"
Requires-Dist: pandas (>=2.3.3,<2.4.0)
Requires-Dist: poetry (>=2.2.1,<2.3.0) ; extra == "dev"
Requires-Dist: pylint (>=3.3.9,<3.4.0) ; extra == "dev"
Requires-Dist: pytest (>=8.0.0,<9.0.0) ; extra == "dev"
Requires-Dist: spac-kit (>=0.3.0,<0.4.0) ; extra == "dev"
Requires-Dist: sphinx_rtd_theme (>=3.1.0,<3.2.0) ; extra == "dev"
Requires-Dist: tqdm (>=4.66.1,<4.67.0)
Description-Content-Type: text/markdown

# SPaC-kit-europa-clipper

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.17861892.svg)](https://doi.org/10.5281/zenodo.17861892)

For instruments ECM, MISE and SUDA, some of the CCSDS packets definitions are coded here, as needed by the Science Data System.

Those packet definitions are used by the [SPaC-kit library](https://github.com/CCSDSPy/SPAC-kit) to decode CCSDS packets, generate documentation and simulated datasets.

## Prerequisites

This package has been tested with Python 3.12.

## Users

Install the main package:

    pip install spac-kit


Install the plugin from pypi (NOT PUSLISHED ON PYPI YET):

    pip install spac-kit-europa-clipper


You can now parse a downlink file from Europa-Clipper:

    parse-downlink --file {your europa-clipper file}

Small test downlink files are provided here:

| Instrument | File                                                                                                                |
|------------|---------------------------------------------------------------------------------------------------------------------|
| ECM        | [file](https://github.com/nasa-jpl/spac-kit-europa-clipper/tree/main/ccsds/packets/europa_clipper/ecm/test/in.bin)  |
| SUDA       | [file](https://github.com/nasa-jpl/spac-kit-europa-clipper/blob/main/ccsds/packets/europa_clipper/suda/test/in.bin) |


## Developers

Clone the repository:

    git clone  https://github.com/joshgarde/europa-cliper-ccsds-plugin.git

Create a virtual environment and activate it:

    python -m venv venv
    source venv/bin/activate   # On Windows use `venv\Scripts\activate`

You might need to upgrade pip first:

    pip install --upgrade pip

If you want to use the latest dev version of spac-kit, install it from the sources:

     git clone https://github.com/CCSDSPy/SPaC-Kit.git
     source {HOME OR PATH TO YOUR VENV}/bin/activate
     pip install ./SPaC-Kit

Install the package in editable mode, with the developer dependencies:

    pip install -e '.[dev]'

Or use poetry:

Install poetry, from your local system, not a virtual environment:

    curl -sSL https://install.python-poetry.org | python3.12 -
    export PATH=${HOME}/.local/bin:${PATH}

Create a poetry virtual environment and install the package with the developer dependencies:

    poetry env use python3.12
    poetry lock
    poetry install --extras dev

Optionnally, to work with a local version of Spac-Kit, you can use poetry as follows:

    poetry add ../SPaC-Kit

Beware of the version of Spac-Kit you are using, it should be compatible with the version specified in the `pyproject.toml` file of this package.



IMPORTANT: Install the pre-commit hooks, they will ensure code quality. If you don't do it the automated test running on the Pull Request will fail.

    pre-commit install && pre-commit install -t pre-push

Make your changes in the package definition files located in the `ccsds.packets.europa_clipper` directory.

Create/Update the test reference data as needed, next to the updated packet definitions, for example `ccsds.packets.europa_clipper.ecm.test`.

Run the tests to ensure everything is working:

    pytest


Before committing your changes update the poetry lock file:

    poetry lock

## Releasing

To prepare for a new release candidate PR should be created against the `main`
branch.  The branch of the release should be prefixed with `release/` with the
version string preceding. For example: `release/1.0.0`.

```bash
git checkout -b release/X.Y.Z
git push
```

When this branch is created, the "Publish to PyPI" GH Actions workflow will
run which will automatically publish a build to the PyPI testing environment
where the build can be tested with any downstream tools/services.

To create the new release, merge the PR which will kickoff the "Lint, test, and
release" CI pipeline. This pipeline will perform an automatic linting and
run the repo's tests. After both steps pass, the workflow will then tag the
merged PR commit and create a new release off of that tag.

Once that release is created, several processes will occur:

1. The "Publish to PyPI" workflow will run again, except now it will publish to
the main PyPI repository.

2. Zenodo will pickup the new release for DOI generation + archival. This
process is automatic and managed by Zenodo. It is simply kicked off on our end
once a new release is cut.

Once these processes are complete, a release has been successfully cut.

