truereward
Turn the cases of a graded run into one reward, or into the reason there is none.
A grader looks at some kind of evidence: a recorded end state, a test report,
a list of criteria, a measured figure. Whatever it looked at, it answers with
one record per case, CaseResult. This package is everything after that
record, and it is the same for every kind of evidence.
-
The fold.
fold(rows)appliesgated-binary/1: the reward is 1.0 when every pass-to-pass case holds and every fail-to-pass case passes, and 0.0 otherwise.fix_rateandguards_holdare reported beside it. -
Three outcomes. A case passed, failed, or could not be graded. The third carries a code from a closed list, each with who failed: the run, or the grader. An ungradable run has no reward. It is never scored 0.
-
The document.
grade_documentbuildsgrade.json;writepublishes it withctrf.json,reward.jsonandreward.txtinto a verifier's logs directory, each file whole or not at all. An ungradable run publishes no reward file. -
The pytest plugin. One test per case, folded once at the end of the session, in one process or under pytest-xdist:
@pytest.mark.parametrize("case", cases(CASES), ids=lambda c: c.id) def test_case(case, grade): grade(case, grade_case)
Run it with
pytest -p truereward.plugin. Install thepytestextra for it:pip install "truereward[pytest]". Folding and writing need the standard library alone.
A reader for one kind of evidence is a separate distribution. It may declare
refusal codes of its own with truereward.codes.declare.
Licensed under Apache-2.0.
Release files for truereward 0.2.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 | |
|---|---|---|---|
| truereward-0.2.0.tar.gz | 18.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| truereward-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.4 kB
Release files / truereward-0.2.0.tar.gz
| Download URL | truereward-0.2.0.tar.gz |
|---|---|
| Size | 18.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21c25f9a84b91b0922285a1d646834ed079740d51033d29a3506d3174a05dbe8
|
|
BLAKE2b-256 checksum How to use checksums |
2d9164636d22195e3c091a636c9d06ac77c585e05adb1b9610f383c7f5abaea2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / truereward-0.2.0-py3-none-any.whl
| Download URL | truereward-0.2.0-py3-none-any.whl |
|---|---|
| Size | 20.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c59c6544dde443c0db2bd03f1a234e8c17f36d3c0689bdbdf76459e142e76cfc
|
|
BLAKE2b-256 checksum How to use checksums |
b60b0fad11220b2d496ca7569813c9efbd039de256fa652d7b6d61241a48f04c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|