Add an optional missingValue argument to deltaGCSV - #702
Merged
Conversation
deltaGCSV had no concept of a "no measurement" sentinel and stored every matched CSV value verbatim, including yeast-GEM's own 10000000.0 convention (checkrxnDirection.m gates on this exact value) -- indistinguishable, once loaded, from a real measurement. missingValue defaults to [] (disabled, unchanged behaviour): a value equal to it (within a small relative tolerance) is left as NaN instead of being stored. Opt-in on both sides now: raven_toolbox's load_delta_g_csv gained the equivalent missing_value parameter, also defaulting to literal-by-default, with DELTA_G_MISSING available to opt into yeast-GEM's convention explicitly.
Function test results300 tests 274 ✅ 1m 8s ⏱️ Results for commit 91d800b. |
edkerk
added a commit
that referenced
this pull request
Aug 28, 2026
…ity (#705) Follow-up to #702, resolving the remaining half of SysBioChalmers/raven-gecko-parity#16. #702 added an optional `missingValue` argument to `deltaGCSV` but defaulted it to `[]` (disabled), while raven-toolbox's `load_delta_g_csv` defaults `missing_value` to `DELTA_G_MISSING` (1e7). So with defaults, the two disagreed: loading yeast-GEM's own ΔG CSVs, RAVEN stamped the 777 sentinel rows as literal 1e7 measurements while raven-toolbox left them unset. This defaults `missingValue` to `1e7`, so both implementations drop the sentinel out of the box. No real ΔG (in kJ/mol) takes this value, so the default is safe. Passing `[]` disables it and stores every value literally, mirroring `missing_value=None`. The comparison tolerance already matched (`math.isclose` rel_tol=1e-9). Tests: adds `deltaGCsvDropsSentinelByDefault` and `deltaGCsvKeepsSentinelWhenDisabled` to tAnnotation.
2 tasks
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.
Fixes SysBioChalmers/raven-gecko-parity#16.
deltaGCSVhad no concept of a "no measurement" sentinel and stored everymatched CSV value verbatim, including yeast-GEM's own
10000000.0convention(
checkrxnDirection.mgates on this exact value) — indistinguishable, onceloaded, from a real measurement.
missingValuedefaults to[](disabled, unchanged behaviour): a value equalto it (within a small relative tolerance) is left as
NaNinstead of beingstored. Opt-in on both sides now: raven-toolbox's
load_delta_g_csvgained theequivalent
missing_valueparameter, also literal-by-default, withDELTA_G_MISSINGavailable to opt into yeast-GEM's convention explicitly.