Skip to content

galsci/pysm

Repository files navigation

CI Tests Documentation Status PyPI Conda Astropy JOSS

PySM 3

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.

Related scientific papers

See CITATION

Install

See the documentation

  • Install with pip install . or with pip 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 mpi4py and libsharp, 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 actual pandoc command 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

Support

For any question or issue with the software open an issue.

Release

  1. Review CHANGES.rst and move the entries you want to ship out of the Unreleased section into a dated <version> (<YYYY-MM-DD>) heading. Commit the changelog update (and any other release-related changes).

  2. Ensure the working tree is clean and up to date with git status and git pull.

  3. 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.

  4. Run the test suite (at least pytest) to verify the release build.

  5. Create the annotated release tag, e.g. git tag -a 3.4.3 -m "Release 3.4.3".

  6. Confirm Hatch picks up the tagged version:

    hatch version
    

    The output should match the tag (no .dev suffix).

  7. Build the distribution artifacts:

    hatch build
    
  8. Publish to PyPI using your API token. Hatch reads credentials from ~/.pypirc (username __token__). Alternatively export HATCH_INDEX_USER=__token__ and HATCH_INDEX_AUTH=<pypi-token> before running:

    hatch publish --no-prompt
    
  9. Push the tag (and any commits) to GitHub:

    git push --tags
    
  10. Draft the GitHub release notes referencing the matching CHANGES.rst entry and announce the release as needed.

About

PySM 3: Sky emission simulations for Cosmic Microwave Background experiments

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 14