Skip to main content

Spice-based segmenter, wrapping event finding routines within spice toolkit.

Project description

Spice Segmenter

PyPI PyPI - Python Version PyPI - License Coookiecutter - Wolt


Documentation: https://luca-penasa.github.io/spice-segmenter

Source Code: https://github.com/luca-penasa/spice-segmenter

PyPI: https://pypi.org/project/spice-segmenter/


Installation

pip install spice-segmenter

Development

  • Clone this repository
  • Requirements:
    • uv
    • Python 3.10+
  • Create a virtual environment and install the dependencies
uv sync --all-extras
  • Activate the virtual environment
source .venv/bin/activate

(or .venv\Scripts\activate on Windows)

Testing

pytest

Regression testing

The tests/regression/ suite locks down numerical results for both property evaluation and constraint solving against a fixed set of SPICE kernels. Each test calls compute_all or solves a constraint, then compares the output against a YAML baseline stored in tests/regression/baselines/.

Normal CI run — compare against stored baselines:

pytest tests/regression/

After a kernel delivery / planned geometry change — regenerate all baselines, review the diff, then commit:

pytest tests/regression/ --update-regression
git diff tests/regression/baselines/   # review what changed
git add tests/regression/baselines/
git commit -m "chore: update regression baselines for kernel v<new>"

Regenerate a single case (useful when adding a new property or constraint):

pytest tests/regression/ --update-regression -k "ganymede_start"

Tolerances applied during comparison:

Quantity Tolerance
Scalar / vector numeric values 1 ppm relative
Solver total coverage duration 0.01 % relative
Individual interval start / end 60 s absolute

Both n_intervals and each interval boundary are stored, so a code change that shifts event times or changes the number of detected intervals will always produce a clear failure message.

Documentation

The documentation is automatically generated from the content of the docs directory and from the docstrings of the public signatures of the source code. The documentation is updated and published as a Github Pages page automatically as part each release.

Releasing

Manual release

Releases are done with the command, e.g. incrementing patch:

just bump patch
# also push, of course:
git push origin main --tags

this will update the changelog, commit it, and make a corresponding tag.

as the CI is not yet configured for publish on pypi it can be done by hand:

uv build
twine upload dist/*

Automatic release - to be fixed

Trigger the Draft release workflow (press Run workflow). This will update the changelog & version and create a GitHub release which is in Draft state.

Find the draft release from the GitHub releases and publish it. When a release is published, it'll trigger release workflow which creates PyPI release and deploys updated documentation.

Updating with copier

To update the skeleton of the project using copier:

 pipx run copier update --defaults

Pre-commit

Pre-commit hooks run all the auto-formatting (ruff format), linters (e.g. ruff and mypy), and other quality checks to make sure the changeset is in good shape before a commit/push happens.

You can install the hooks with (runs for each commit):

pre-commit install

Or if you want them to run only for each push:

pre-commit install -t pre-push

Or if you want e.g. want to run all checks manually for all files:

pre-commit run --all-files

Running tests

uv run pytest

This project was generated using a fork of the wolt-python-package-cookiecutter template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spice_segmenter-0.0.6.tar.gz (881.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spice_segmenter-0.0.6-py3-none-any.whl (114.3 kB view details)

Uploaded Python 3

File details

Details for the file spice_segmenter-0.0.6.tar.gz.

File metadata

  • Download URL: spice_segmenter-0.0.6.tar.gz
  • Upload date:
  • Size: 881.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Manjaro Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for spice_segmenter-0.0.6.tar.gz
Algorithm Hash digest
SHA256 567d6fba0710b3d6a129266ba5afcd9f33b95ba0b5b49249c253f5d79444e033
MD5 dc3a69e11dfeca46e3c0149d64e353bd
BLAKE2b-256 1ba0359b894b592352eecb2abd1581646f5ec1b9960c77fe6fac5bff4723e58e

See more details on using hashes here.

File details

Details for the file spice_segmenter-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: spice_segmenter-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 114.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Manjaro Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for spice_segmenter-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e12b09186fd89e5112c934fe96c3b28986badcb970ea6d0e41456ac316753af6
MD5 77528a68be0f3846b56be225d16e3790
BLAKE2b-256 637439b106bc198508c5add0e3f0388638ef58b904ce77c276a8ac39cf8567b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page