For development, hatch is used to manage the virtual environment and dependencies.

Make sure you have hatch installed in your default Python environment:

hatch --version

If it is not installed, you can install it using pip:

pip install hatch

Development installation / activation

hatch shell

Virtual Environment Setup

Hatch manages virtual environments for this project. Virtual environments can be stored in a centralized location by adding the following to ~/.config/hatch/config.toml:

[envs]
storage.path = "~/_virtualenvs/hatch_envs"

This configuration centralizes all environments in one directory for easier management across projects.

To deactivate the environment, run:

exit

Building Documentation

To generate HTML documentation from the repository root, run:

hatch run docs:build

The generated HTML documentation will be available in docs/build/html/. Open docs/build/html/index.html in your browser to view the documentation.

You can also build the documentation manually by first activating the Hatch environment:

hatch shell

Then navigate to the docs folder and build the HTML files:

On Windows:

cd docs
./make.bat html

On Linux/Mac:

cd docs
make html

The generated HTML documentation will be available in docs/build/html/. Open docs/build/html/index.html in your browser to view the documentation.

Tutorials

Tutorials are available in the docs/source/notebooks directory. To run a tutorial, activate the Hatch environment and execute the desired tutorial script:

hatch shell

Make sure you have Jupyter installed in the environment:

pip install jupyter

Then you can open the Jupyter Notebook interface by running:

jupyter notebook 

This will open a web interface where you can navigate to the docs/source/notebooks directory and open the tutorial notebooks to run them interactively.

Publishing releases to PyPI from tags

The Publish to PyPI GitHub Actions workflow publishes package distributions to PyPI when a supported version tag is pushed.

Supported tag formats include:

git tag v0.1.2
git push origin v0.1.2

and:

git tag 0.1.2
git push origin 0.1.2

The workflow strips a leading v, validates the remaining value as a PEP 440 version, and exports it through SETUPTOOLS_SCM_PRETEND_VERSION so hatch-vcs builds the package with the pushed tag version. It then installs the package, runs the project checks, builds the wheel and source distribution, verifies that each artifact uses the tag version, checks the artifacts with twine, uploads the distributions as a workflow artifact, and publishes them to PyPI with Trusted Publishing.