tcaf-model
True Cost Accounting of Food (TCAF) build of the Transition Compass model.
It is a separate build of transition-compass-model, not a newer version of it. It keeps the food side (agriculture, crop, livestock, land use, dietary habits, alcoholic beverages, population, true cost) and drops the other sectors. Region: Switzerland.
Deployed at https://transition-compass-tcaf.epfl.ch/.
Branches
| Branch | What it is |
|---|---|
tcaf |
the working branch, what gets released |
tcaf-import |
the raw import, do not touch |
tcaf-import is the research work exactly as it was written in
2050Calculators/tcaf-calc, branch model, replayed commit by commit
with the original authors and dates. That fork was taken from the web app
repository before the app and the model were split, so the model code sat in
backend/model/. Here it sits in tcaf_model/model/, the same
place as in the main model repo, and nothing else changed.
tcaf adds what the code needs to be a real python package: the __init__.py
files, pyproject.toml, the lint setup and the release workflow. The science is
untouched.
The package is called tcaf_model, not transition_compass_model, on purpose.
The web app installs both, and picks one with MODEL_PROFILE. Two packages with
the same import name could not live in the same environment.
See issue #11 for the background.
Install
make install # uv sync --all-groups + pre-commit
Use it
from tcaf_model.model.interactions import runner
from tcaf_model.model.common.auxiliary_functions import (
filter_country_and_load_data_from_pickles,
)
DM_input = filter_country_and_load_data_from_pickles(
country_list=["Switzerland"], modules_list=["population", "agriculture"]
)
output, kpi = runner(lever_setting, years_setting, DM_input, ["agriculture"], logger)
Each module also runs on its own, on the pickles in _database/:
python -m tcaf_model.model.crop_module
Release
The package is on PyPI as tcaf-model. A tcaf-v* tag on branch tcaf
publishes it (tags are a human decision):
git tag tcaf-v1.0.0 && git push origin tcaf-v1.0.0
The workflow (.github/workflows/publish-tcaf-pypi.yml) lints, builds the wheel
with the pickles inside and publishes it to PyPI. Then it opens a bump PR in
leure-speed-to-zero that pins the new tcaf-model version.
Working here
- Data files (
*.pickle,*.pdf) are in git LFS. Rungit lfs pullif you get small text files instead of data. make formatbefore committing, CI runs ruff and codespell.- Keep the module names importable: no dash in a
.pyfile name.
Metadata
Release files for tcaf-model 1.0.0
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 | Actions |
|---|---|---|---|---|
| tcaf_model-1.0.0.tar.gz | 9.0 MB | With provenance | Details for tcaf_model-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tcaf_model-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for tcaf_model-1.0.0-py3-none-any.whl |
Total release size: 18.0 MB
Release files / tcaf_model-1.0.0.tar.gz
| Download URL | tcaf_model-1.0.0.tar.gz |
|---|---|
| Size | 9.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
047cdeb195488b5678dd4064c1b914eb07581286bec58564893336acdfff8039
|
|
BLAKE2b-256 checksum How to use checksums |
ed16bfd6a9d27a50d7ee19a7b7ec283779ae5b8eb0795ead9ddf213c9d8cc841
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency logRelease files / tcaf_model-1.0.0-py3-none-any.whl
| Download URL | tcaf_model-1.0.0-py3-none-any.whl |
|---|---|
| Size | 9.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b4edaffaabeac31b008c4eff76a65c6905c61d05943b6db052c377fd7cf3835
|
|
BLAKE2b-256 checksum How to use checksums |
114955b2c86c6501ddf82faa6989f82b8a937f1fdf3be1afb38a630c316b4989
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency logSecurity for tcaf-model 1.0.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for tcaf_model-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency logA 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.