Skip to content

Add an optional missingValue argument to deltaGCSV - #702

Merged
edkerk merged 1 commit into
develop3from
fix/deltagcsv-optional-missing-value
Aug 28, 2026
Merged

Add an optional missingValue argument to deltaGCSV#702
edkerk merged 1 commit into
develop3from
fix/deltagcsv-optional-missing-value

Conversation

@edkerk

@edkerk edkerk commented Aug 28, 2026

Copy link
Copy Markdown
Member

Fixes SysBioChalmers/raven-gecko-parity#16.

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 literal-by-default, with
DELTA_G_MISSING available to opt into yeast-GEM's convention explicitly.

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.
@github-actions

Copy link
Copy Markdown

Function test results

300 tests   274 ✅  1m 8s ⏱️
 25 suites   26 💤
  1 files      0 ❌

Results for commit 91d800b.

@edkerk
edkerk merged commit a9af3d5 into develop3 Aug 28, 2026
4 checks passed
@edkerk
edkerk deleted the fix/deltagcsv-optional-missing-value branch August 28, 2026 07:07
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant