Skip to content

Align task lists, GPR parsing and YAML warnings with RAVEN - #181

Merged
edkerk merged 3 commits into
developfrom
fix/parity-decisions
Oct 21, 2026
Merged

edkerk merged 3 commits into
developfrom
fix/parity-decisions

Conversation

@edkerk

@edkerk edkerk commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

What this changes

Decisions taken after the RAVEN vs raven-toolbox parity review. Each item has a test.

  • parse_task_list: an empty CHANGED LB or CHANGED UB now leaves that bound of the reaction as it is (stored as None). Before, it defaulted to -1000 or 1000 and overwrote the model's own bound. A .xls file now gets a clear error that names .xlsx and .txt.
  • check_tasks: warns when a task's name[comp] matches several model metabolites. All of them are still constrained. RAVEN constrains only the first. The task_name_maps docstring wrongly said RAVEN constrains all, and is corrected.
  • is_dnf: raises ValueError on a malformed rule string (G1 and, (G1 or G2, () and so on). Before, cobra swallowed the syntax error and the empty GPR counted as DNF. RAVEN's isDnfGrRule errors on these.
  • write_yaml_model: warns when a metabolite has an empty name. RAVEN's writer refuses such a model.
  • remove_low_score_genes: behaviour is unchanged. Tests pin the tie rule (the gene or complex listed first in the rule is kept), next to the tied_reactions tests from fix: four writer, task and gene-pruning problems from #178 #179. The docstring no longer says RAVEN picks at random.

Also includes the Windows CI fix from #180 (python -m pip install --upgrade pip), now merged with develop.

RAVEN side

The matching RAVEN changes are in CompMetEng/RAVEN#11: first-in-rule on ties, flags 0/false/no read as false, ; lists trimmed, headers matched ignoring case, empty CHANGED bounds kept as NaN, a duplicate-metabolite warning in checkTasks, the shortest round-trip float format in writeYAMLmodel, and the replaceMets fix.

Checks

MATLAB R2024b with GLPK on RAVEN#11 head 875e45b and this branch at 8fbaed4: tTasks 7/7, tIO 24/24, tManipulation 85/85, tINIT 31/31, tSyntax 1/1, and the scenarios remove_low_score_genes_smallyeast, replace_metabolite_toy, task_checking_smallyeast, task_list_parsing and yaml_roundtrip_smallyeast MATCH for seeds 0, 1 and 2. Results are in CompMetEng/raven-gecko-parity, branch hpc-results/2026-10-21.

After merging develop into the branch: pytest (1212 passed, 18 skipped), ruff and mypy pass locally.

Not checked: the MATLAB run predates the merge of develop, which only touched other files and tests.

…une ties

parse_task_list: an empty CHANGED LB/UB now leaves the reaction bound as it is
(None) instead of defaulting to -1000/1000, and .xls gets a clear error.
check_tasks warns when a name[comp] matches several metabolites.
is_dnf raises ValueError on a malformed rule instead of reporting True.
write_yaml_model warns on metabolites with an empty name.
Tests for each, plus ties in remove_low_score_genes.
pip 26.2.2 refuses to replace itself on Windows when run as plain pip and exits 1, so every Windows job failed before running any test.
edkerk added a commit to CompMetEng/raven-gecko-parity that referenced this pull request Oct 21, 2026
New scenarios: remove_low_score_genes_ties_smallyeast, task_list_edge_cases and
yaml_float_digits_smallyeast. The task-list scenarios compare an empty CHANGED
bound as NaN. Ledger notes for replaceMets, removeLowScoreGenes, parseTaskList,
checkTasks, writeYAMLmodel, exportForGit and isDnfGrRule now say what
CompMetEng/RAVEN#11 and CompMetEng/raven-toolbox#181 change.
@edkerk
edkerk merged commit 12f04bf into develop Oct 21, 2026
8 checks passed
@edkerk
edkerk deleted the fix/parity-decisions branch October 21, 2026 22:34
edkerk added a commit to CompMetEng/raven-gecko-parity that referenced this pull request Oct 21, 2026
…otes for the parity decisions (#139)

* fix: name the solver of min_nr_fluxes_toy instead of requesting scip

The MATLAB side called setRavenSolver('scip'), which RAVEN supports on Linux only if SCIP was compiled by hand, so the scenario ended in ERROR (no result from matlab) in every nightly. It now takes matlab_solver and python_solver from scenario.yml (gurobi, as in task_checking_smallyeast) and restores the previous RAVEN solver afterwards.

* doc: record the differences confirmed on MATLAB in the ledger notes

The first MATLAB batch on a cluster (RAVEN 79a7d8c, 2026-10-21) confirmed differences between RAVEN and raven-toolbox that the notes did not state or stated wrongly: replaceMets (a RAVEN bug, not replicated exactly), removeLowScoreGenes (the tie-break is alphabetical, not random), parseTaskList, checkTasks, writeYAMLmodel, exportForGit and isDnfGrRule. Only the notes of these seven rows change.

* Add scenarios for the parity decisions and update the ledger notes

New scenarios: remove_low_score_genes_ties_smallyeast, task_list_edge_cases and
yaml_float_digits_smallyeast. The task-list scenarios compare an empty CHANGED
bound as NaN. Ledger notes for replaceMets, removeLowScoreGenes, parseTaskList,
checkTasks, writeYAMLmodel, exportForGit and isDnfGrRule now say what
CompMetEng/RAVEN#11 and CompMetEng/raven-toolbox#181 change.
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