PySM generates full-sky simulations of Galactic emissions in intensity and polarization relevant to CMB experiments. It is a large refactor of PySM 2 focused on reducing memory usage, improving performance and run in parallel with MPI.
See the documentation at https://pysm3.readthedocs.io
Contributor guidelines, coding standards, and testing expectations are documented in AGENTS.md (Repository Guidelines).
See changes in CHANGES.rst in the repository.
See CITATION
- Full-sky Models of Galactic Microwave Emission and Polarization at Subarcminute Scales for the Python Sky Model (The PanEx GS Group, ApJ 991, 23, 2025)
- The Python Sky Model 3 software (Zonca et al, 2021)
- The Python Sky Model: software for simulating the Galactic microwave sky (Thorne et al, 2017)
See the documentation
- Install with
pip install .or withpip install .[test]to also install the requirements for running tests - Optionally, if you have an MPI environment available and you would like to test the MPI capabilities of PySM, install
mpi4pyandlibsharp, check the documentation link above for more details. - Check code style with
uv run flake8 src/pysm3 --count --max-line-length=100 - Test with
uv run pytest -v - Building docs requires
pandoc, not the python package, the actualpandoccommand line tool, install it with conda or your package manager - Build docs locally with
uv run sphinx-build -W -b html docs docs/_build/html
For any question or issue with the software open an issue.
Review
CHANGES.rstand move the entries you want to ship out of theUnreleasedsection into a dated<version> (<YYYY-MM-DD>)heading. Commit the changelog update (and any other release-related changes).Ensure the working tree is clean and up to date with
git statusandgit pull.Create or refresh a local environment using
uv:uv venv .venv uv pip install --python .venv/bin/python pip hatch
Activate it for the remaining steps with
source .venv/bin/activate.Run the test suite (at least
pytest) to verify the release build.Create the annotated release tag, e.g.
git tag -a 3.4.3 -m "Release 3.4.3".Confirm Hatch picks up the tagged version:
hatch version
The output should match the tag (no
.devsuffix).Build the distribution artifacts:
hatch build
Publish to PyPI using your API token. Hatch reads credentials from
~/.pypirc(username__token__). Alternatively exportHATCH_INDEX_USER=__token__andHATCH_INDEX_AUTH=<pypi-token>before running:hatch publish --no-prompt
Push the tag (and any commits) to GitHub:
git push --tags
Draft the GitHub release notes referencing the matching
CHANGES.rstentry and announce the release as needed.