Repository navigation
Conversation
…ate table - rate_method(), method_parameter(), method_id(), method_canonical_json() and method_digest() (sha256 of the method's RFC 8785 JSON). - The append-only method registry: method_registry() and lookup_rate_method() (exact match). It checks unique ids, exported method functions (never the xlsx reader), registered input methods that output what they feed, an O2 series fed only to a tick-rates method, and no input cycle. It ships empty. - inst/extdata/method_registry.json (generated, tested byte-equal) and inst/extdata/method_registry_released.tsv (append-only record, tied to the package version by a test). - compute_rates(): one plate (sha256 plate id), exact input methods and declared plate inputs, an exported method function, and a checked rate table (and fitted-values table) carrying the method id on every row. O2 series inputs and outputs are refused until their container exists. - New Import: digest (>= 0.6.39). Work item st-seahtrue-rate-calculation-method-value-object-method-5j2b (swamp_seahtrue factory). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds the foundation that every rate calculation method registers into. The registry is empty. No method is implemented here; each method family is a later work item.
It is work item
st-seahtrue-rate-calculation-method-value-object-method-5j2bin the swamp_seahtrue factory. The design ispackages/st-engine/rate-methods.mdin swamp_seahtrue.The method value object.
rate_method()andmethod_parameter()build it;method_id()returnsname@version.method_canonical_json()returns RFC 8785 JSON with the keys corrections, family, fun, input_methods, instrument_models, name, output_kinds, parameters, plate_inputs and version.method_digest()is the sha256 of that JSON.The method registry.
method_registry()returns it keyed by method id, andlookup_rate_method()finds one by exact match only. The registry is checked on every call:Registry files.
inst/extdata/method_registry.jsonis generated from the registry, and a test checks it matches byte for byte.inst/extdata/method_registry_released.tsvis the append-only record of released method ids and their digests. A test fails when the package version is newer than this record but the registry differs from it.compute_rates(plate, method_id, inputs, plate_inputs). It checks, in order:Then it calls the exported method function and checks what comes back: a rate table, plus a fitted-values table when the method declares one. The method id is on every row.
The table constructors are internal. O2 series inputs and outputs are refused until their container is defined (ticket
st-seahtrue-o2-auc-method-phzb).New Import: digest (>= 0.6.39).
8bf048b49b2d17077138fae758bda56bbd53278d9437f2fdeaedf979c90a13c9, matched across two CRAN mirrors.0531577e58efa9e61aeb4505c31766c53507d7bb59db9c4ce0ed2e7e9e862d07; its md5 matches the repository index.The branch is cut from
devel(981999f, 1.7.2). The version is not bumped.Checks
devtools::test(): 0 failures.json.dumps(sort_keys=True, separators=(",", ":"), ensure_ascii=False)andhashlib.calculate_spacetests (a tidyselect deprecation) and are unchanged.R CMD check --no-manual --ignore-vignettes: Status OK, with 0 errors, 0 warnings and 0 notes.check-rate-methods.mjsin swamp_seahtruepackages/st-engine/webr-check/:library(seahtrue)loads;method_digest()under webR equals the independent vector.This PR is a draft. Do not merge or tag it; Vincent decides the release.
🤖 Generated with Claude Code