Skip to main content

btap (Python)

The Python port of the btap gem family — one distribution, five subpackages mirroring the gems (btap.audit, btap.simulation, btap.modeling, btap.costing, btap.necb), same one-way dependency direction (D-77). The port is COMPLETE (M0–M8, 2026-08-28; the record is ../PORT_STATUS.md and D-79), verified three ways: every Ruby suite ported, the Leg-C oracle goldens consumed (frozen AND live), and the Leg-B corpus diff holding the Ruby and Python btap-compliance CLIs equivalent at the none, sizing and annual --quick tiers.

Since R3 (D-81) this implementation is primary and canonical, and since the R4 handoff (D-82) it is the only one that changes: Ruby backports have stopped. Behaviour changes land here with a re-frozen scenario baseline in the same PR (verification/scenarios/freeze.py); the frozen suite — not a live Ruby comparison — is the regression net.

cd python && python3 -m unittest discover tests   # stdlib-only, no install needed (serial)
cd python && .venv/bin/pytest -n auto tests/      # parallel (pytest-xdist worker
                                                  # processes; ~10x on the E+ suites)

btap/_compat.py holds the cross-cutting Ruby-parity contracts (round-half- away rounding, SDK Optional unwrapping, the NullAudit, determinism-critical sorting, HTML escaping). New code uses those helpers, never the raw Python equivalents — the differences they paper over are exactly the silent Ruby-vs-Python drifts the census identified.

The CLI (M6)

The umbrella pipeline and its command line are ported:

pip install .                      # installs the btap-compliance console script
btap-compliance model.osm --epw weather.epw          # full 8.4.1.2 determination
python3 -m btap.necb.cli model.osm --simulate none   # no-install equivalent

Same seven exit codes as the Ruby CLI (0 compliant, 1 not compliant, 2 usage, 3 pre-flight, 4 simulation, 5 internal, 6 no determination), and the same refusal to call a --quick week a determination. The Leg-B corpus gate (CLI_B=python bash verification/selftest.sh) diffs this CLI's audit.json/report.json against the Ruby CLI's over the whole corpus — every pair equivalent at the none, sizing, and annual tiers.

Thermal bridging (M7)

NECB 3.1.1.7 runs through py-tbd (native Python, no Ruby subprocess), pinned by commit SHA to its tbd-3.5.2-compat branch — the revision verified against the family's frozen Ruby TBD 3.5.2 / OSut 0.8.2 oracle baseline:

pip install '.[tbd]'

Without it the pipeline still works: thermal_bridging= degrades to the same loud audited 3.1.1.7-not-accounted warning the Ruby gem emits without its tbd gem — never a silent clear-field result.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

canmet_btap-0.2.1.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

canmet_btap-0.2.1-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file canmet_btap-0.2.1.tar.gz.

File metadata

  • Download URL: canmet_btap-0.2.1.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for canmet_btap-0.2.1.tar.gz
Algorithm Hash digest
SHA256 448ce5dd59fe7ae8a7dc6e01bce33f8317fac5e794a9cc8323180f6b7cd44490
MD5 da6cf5b5f56e1a3a532812a8d9aa820d
BLAKE2b-256 8dcd398117a57be16e38dd76fd275f87db86e07718a371056d20a8c744003bb7

See more details on using hashes here.

Provenance

The following attestation bundles were made for canmet_btap-0.2.1.tar.gz:

Publisher: publish.yml on canmet-energy/btap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file canmet_btap-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: canmet_btap-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for canmet_btap-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 87de5e17cc244a416a8078075364fabcf62c4bf05a88f802274ba6d90c35729e
MD5 076f9605af8be7f6b1e38b54380b4dec
BLAKE2b-256 693437699cead70a4d44e09fdafb8f802f4f2a5a10768c3a00a760dc1e820434

See more details on using hashes here.

Provenance

The following attestation bundles were made for canmet_btap-0.2.1-py3-none-any.whl:

Publisher: publish.yml on canmet-energy/btap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page