This project has been archived by its maintainers, and is no longer receiving any updates.
goals-sa
Goals scenario analysis
- Github repository: https://github.com/avenirhealth-org/goals-sa/
- Documentation: https://avenirhealth-org.github.io/goals-sa/
Installation
pip install avenir_goals_sa
After installation, the goals-sa command is available on your PATH.
Quick start
For full details of the CLI please see the CLI reference
goals-sa --help # or -h
goals-sa --version # or -v
Generate scenarios
goals-sa scenarios --dest-path ./scenarios.csv
Run scenario analysis
Analysis is configured via a JSON config file:
goals-sa run --config-path config.json
Config file format
Field names are case-insensitive.
{
"Goals_path": "path/to/pjnz/files",
"Scenario_path": "path/to/scenarios/scenarios.csv",
"Scenario_file_name": "scenarios.csv",
"Output_path": "path/to/output",
"Output_file_name": "results.parquet",
"Base_year": "2025",
"Output_indicators": [
"PLHIV",
"New Infections",
"AIDS deaths",
"Number on ART",
"DALYs",
"Total Cost"
]
}
| Field | Description |
|---|---|
Goals_path |
Directory containing .PJNZ files |
Scenario_path |
Directory containing the scenario file |
Scenario_file_name |
Filename of the scenario CSV |
Output_path |
Directory to write output to |
Output_file_name |
Filename for the output file |
Base_year |
Base year for the analysis |
Output_indicators |
List of indicators to include in output |
Tab completion
To install shell tab completion:
goals-sa --install-completion
Development
Prerequisites
- uv for installing Python, package management
- (Optionally) make. Should be installed by default, except on windows, where it is easiest to install it via Chocolatey
choco install make
Development with make
There is a Makefile which wraps some common uv commands you will need during development.
Set Up Your Development Environment
Install the environment and the pre-commit hooks with
make install
This will also generate your uv.lock file.
Run code checks
make check
Run tests
make test
Build docs site
make docs
Development with uv
If you choose not to use make, you can use uv directly.
Set Up Your Development Environment
Install the environment and the pre-commit hooks with
uv sync
uv run pre-commit install
This will also generate your uv.lock file.
Run code checks
Run pre-commit checks, include ruff linting and formatting
uv run pre-commit run -a
Run type checking
uv run ty check
Run tests
uv run pytest
Build docs site
uv run mkdocs serve
Run compatibility tests
Compatability tests with tox are configured. Run them with
uv run tox
These are also run on CI, so not the end of the world if you don't do it locally.
Vendored SpectrumEngine import code
We need to re-use some of the PJNZ import code from SpectrumEngine. At the moment, this is vendored here directly. There is a script to update the vendored code which should be run before a release. The script uses a file ./scripts/spectrum_engine_ref to clone the specified branch or ref.
With make:
make pjnz-import-code
Run script directly
uv run ./scripts/update_pjnz_import_code.py
CLI
The CLI is built using typer which builds CLI docs automatically from python type hints and decorators. It also gives us some neat things like auto completion. And progress bars down the line!
Release process
Creating a release will
- Build & push the package to PyPI
- Build an updated docs site
To create a release you need to
- Update the version number in the
pyproject.tomlor ensure it has updated since the last release - Go to the releases page and "Draft a new release"
- Create a new tag, I usually use a tag which matches the version number you are releasing. Set a release title and text. Usually useful to include in the text a summary of the changes since the last release.
- Publish the release. This will trigger a GitHub action which will push the package to PyPI and update the docs site.
Metadata
Release files for avenir-goals-sa 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| avenir_goals_sa-0.0.2.tar.gz | 62.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| avenir_goals_sa-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 128.3 kB
Release files / avenir_goals_sa-0.0.2.tar.gz
| Download URL | avenir_goals_sa-0.0.2.tar.gz |
|---|---|
| Size | 62.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
27e2a5355e986ff5c6b655076b59f8da37643a4f64aba0501011cf5e90f55726
|
|
BLAKE2b-256 checksum How to use checksums |
b89fda88ead24ee08a031eb0b82635f0a9f8419ff819dc06506b9bcd484f53ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / avenir_goals_sa-0.0.2-py3-none-any.whl
| Download URL | avenir_goals_sa-0.0.2-py3-none-any.whl |
|---|---|
| Size | 66.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
19cfd1dddb19294bd6d64f9ab67d63e578568559af3c96a0d527fe47cb1c00df
|
|
BLAKE2b-256 checksum How to use checksums |
a9523356f3e0ee8d467aacc2ddf73723b5ca588c31b8254aea568a0bcedcbc03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for avenir-goals-sa 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.