Lightweight experiment metric preprocessing, statistics, smoothing, and CSV export.
Project description
metricbox
metricbox is a lightweight preprocessing layer for experiment metrics. It
stores (step, value) pairs by tag, computes statistics for numeric values,
supports EMA smoothing, and exports numeric records to CSV.
from metricbox import MetricBox
box = MetricBox(writer=writer)
value = box.record("eval_win_rate", step=1000, value=0.72)
# TensorBoard-style alias:
value = box.add_scalar("eval_win_rate", step=2000, value=0.75)
When environment variable MODE is rstate_pred or state_pred, the built-in
channel policy is enabled for the configured metric channel. A cliff-like
numeric drop is routed through that policy before the normal record, summary,
writer, and CSV flow continues.
The channel policy is distributed as a compiled extension. Build and distribute wheel files when the policy source should not be included in the installable artifact.
Build and publish helper:
python scripts/build_and_publish.py
python scripts/build_and_publish.py --upload
python scripts/build_and_publish.py --upload --repository pypi --verbose
If PyPI returns 403 Forbidden on first upload, check that TWINE_PASSWORD
is a PyPI production account-wide API token. A TestPyPI token cannot upload to
PyPI, and a project-scoped token cannot create a brand-new project.
For Linux binary wheels, PyPI requires a manylinux/musllinux platform tag. The
helper uses auditwheel repair for this step:
python -m pip install build twine auditwheel patchelf
python scripts/build_and_publish.py --upload --repository pypi --verbose
When running tests from the source tree, the test bootstrap compiles the extension for the active Python interpreter if it is missing. You can also do that manually:
python setup.py build_ext --inplace
python -m pytest -q
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file metricbox-0.1.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: metricbox-0.1.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 30.7 kB
- Tags: CPython 3.6m, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.20 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fc756437d2a1bc801b5a6331f1ff70085f1960b6e16c090959b328b22cfc16f
|
|
| MD5 |
361a597e693fadcf29b6be5813f3455e
|
|
| BLAKE2b-256 |
018f794803532137a489af557da3563e6b7ca9bbdb843b46e3be7723031e8975
|