| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This is a template repository for creating CCSDS packet definition plugins for the SPaC-kit library.
Important
This library is currently in active development.
Some functions are placeholders and may not yet have full implementations. Expect ongoing updates and new features as the library evolves.
This template helps you quickly create a new Python package containing CCSDS packet definitions for your mission or instrument. These packet definitions are used by the SPaC-kit library to:
In addition, this template provides basic standard continuous integration workflows using github actions and enable the publication of a Digital Object Identifier (DOI) using Zenodo to help with the citation of your work.
(what you will get if you use this template for your packet definitions)
The documentation of the packet is available on http://<your org name>.github.io/<your repo name> (TO BE UPDATED)
To use spac-kit tools with your packet definitions, you need:
With traditional python environment:
pip install spac-kit-your-mission # the plugin prepared with your packet defintions from this template repository pip install spac-kit
Then see the list of packet definitions:
spac-ls
APID PACKET NAME DESCRIPTION
-----------------------------------------------------------------------------------------------------------------
100 example_mission.example_instrument.example_packet.example_health_status example_health_status
101 example_mission.example_instrument.metadata.metadata_example example_metadata
Generate a dataset of 2 packets for the given definition, :
spac-generate --apid 100 --count 2 --output file.out
(use spac-generate --help for more details)
Parse this data file:
spac-parse --file file.dat
Click the "Use this template" button on GitHub to create a new repository from this template, or clone this repository:
git clone <your-new-repo-url>
cd <your-new-repo-name>Update the following files with your mission/instrument information:
The system path must be preserved (ccsds/packets/) as it is used by the Spac-kit tools to discover your packet definitions.
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 pipIf 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-KitInstall the package in editable mode with developer dependencies:
pip install -e '.[dev]'Or use poetry:
Install poetry from your local system (not in a virtual environment):
curl -sSL https://install.python-poetry.org | python3 -
export PATH=${HOME}/.local/bin:${PATH}Create a poetry virtual environment and install the package with developer dependencies:
poetry env use python3.12
poetry lock
poetry install --with devOptionally, to work with a local version of SPaC-Kit:
poetry add ../SPaC-KitIMPORTANT: Install the pre-commit hooks to ensure code quality. If you don't do this, the automated tests running on Pull Requests will fail:
pre-commit install && pre-commit install -t pre-pushNote: if you don't use poetry, you will need to replace the test configuration and remove the poetry run in the entry field.
Create your packet definitions in the ccsds/packets/your_mission/your_instrument/ directory:
See the example packet definition in ccsds/packets/example_mission/example_instrument/ for reference.
For each packet definition, create corresponding test data:
Run the tests to ensure everything is working:
pytestor with poetry:
poetry run pytestBefore committing your changes, update the poetry lock file:
poetry lockThe project uses Sphinx with the SPaC-kit autodocs extension to automatically generate documentation from your packet definitions.
To build and visualize the documentation locally:
cd docs
sphinx-build -b html . _build/html(with poetry don't forget the poetry run prefix)
The generated documentation will be in docs/_build/html/.
To test the documentation and visualize it in a browser. you can use sphinx-autobuild:
pip install sphinx-autobuildor with poetry:
poetry add sphinx-autobuildAnd build-start the server:
poetry run sphinx-autobuild -b html . _build/html
. ├── .github/ │ └── workflows/ │ ├── ci.yml # Linting and testing workflow │ └── publish.yml # PyPI publishing and docs deployment ├── ccsds/ │ └── packets/ │ └── example_mission/ # Replace with your mission name │ └── example_instrument/ # Your instrument name │ ├── __init__.py │ ├── metadata.py # Packet metadata │ ├── example_packet.py # Packet definitions │ └── test/ │ ├── __init__.py │ ├── in.bin # Test binary data │ ├── out.pickle # Expected output │ └── test_example.py # Unit tests ├── docs/ │ ├── conf.py # Sphinx configuration │ ├── index.rst # Documentation index │ └── _static/ # Static files for docs ├── .flake8 # Flake8 linting config ├── .gitignore # Git ignore patterns ├── .pre-commit-config.yaml # Pre-commit hooks config ├── pyproject.toml # Project metadata and dependencies └── README.md # This file
The template includes two GitHub Actions workflows:
Runs on pushes to main and Pull Requests:
Runs on release branches and published releases:
To prepare for a new release:
git checkout -b release/X.Y.Z
git pushThis automatically publishes to PyPI Test environment for testing
Create a Pull Request to merge the release branch into main
Once merged, the workflow will:
To enable all features, configure the following in your GitHub repository:
Enable GitHub Pages in repository settings:
For issues or questions:
Update the license in pyproject.toml according to your organization's requirements.
| Back | FazBrowse Home | New Git URL |