Skip to content

Document all parameters, align eleven functions with RAVEN, add parity oracles - #189

Merged
edkerk merged 2 commits into
developfrom
fix/follow-ups
Oct 31, 2026
Merged

edkerk merged 2 commits into
developfrom
fix/follow-ups

Conversation

@edkerk

@edkerk edkerk commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

Documents all parameters of the public functions, aligns eleven functions with RAVEN, replaces comments that contradicted the corrected docstrings (#188) and removes the hard-coded big_m=100 from the sweep script.

Documentation

  • Every function exported through __all__ has a Parameters entry for each argument (117 functions, 565 parameters), with Returns and Raises sections where the code returns a structure or raises. Defaults equal the signature defaults.
  • Comments state the current behaviour: the prove_abs_gap measurements of ftinit, the case handling of template ids, the "RAVEN MILP" wording of get_min_nr_fluxes, the reason in _NON_DNF_REASON.
  • set_exchange_bounds is annotated list[str | Metabolite], and compare_models accepts os.PathLike for tasks.
  • scripts/analyze_init_params.py takes --big-m (default: the ftinit default of 1000) and keys its sweep cache on big_m.

Behaviour

Function Behaviour
init.fill_tasks (resolve_ties=True, Gurobi) Restores MIPGap and MIPGapAbs of reference_model after each gap-fill.
tasks.find_task_essential_reactions Writes cache_path as JSON. A file that is not a JSON cache of the current version, such as a pickle, is ignored with a warning. checkpoint_every below 1 raises ValueError.
init.hpa_gene_scores An empty level_scores mapping uses the default level scores.
init.rna_gene_scores tissue is compared case-insensitively; the highest TPM over tissue names that differ in case is used, as in scoreModel.
localization.predict_localization (apply=True) Returns a copy of the model when no gene has a score.
localization.assign_compartments The default growth floor is 10 % of the maximum flux of biomass_reaction.
reconstruction.kegg.organisms_in_domain An empty domain raises ValueError.
conditions.load_condition An empty file returns {}, which apply_condition applies as a condition without steps, as RAVEN's parseYAML and applyCondition do.
analysis.reporter_metabolites A scored gene without an entry in gene_fold_changes is in neither the "up" nor the "down" subset.
manipulation.constrain_reversible_reactions Skips the Gurobi tolerance setting only when the solver has no Params attribute.
gapfilling.connect_blocked_reactions The RuntimeError for a non-optimal MILP names the MILP.

The parity generator scripts/parity/generate_oracles.m records reporterMetabolites with fold changes and an empty condition file. The recorded oracles are in tests/data/parity/oracles/, with the RAVEN commit in PROVENANCE.md.

CHANGELOG.md has an entry for each change.

… `set_exchange_bounds` annotation, `--big-m` in the sweep script

- Every public function exported through `__all__` documents all its parameters (117 functions, 565 parameters), with `Returns` and `Raises` sections where the code returns a structure or raises.
- Comments and the `_NON_DNF_REASON` string state the current behaviour: the `prove_abs_gap` measurements of `ftinit`, the case handling of template ids, the flagged form of a rule that is not in disjunctive normal form.
- `set_exchange_bounds` is annotated `list[str | Metabolite]`: it returns the entries of `mets` as supplied.
- `scripts/analyze_init_params.py` takes `--big-m` (default: the `ftinit` default of 1000), and its sweep cache is keyed on `big_m`.
fill_tasks restores MIPGap and MIPGapAbs. The essentials cache is JSON and
checkpoint_every below 1 raises. hpa_gene_scores uses the default level scores
for an empty mapping, and rna_gene_scores matches the tissue case-insensitively
and takes the highest TPM over names that differ in case. predict_localization
returns a copy when no gene has a score. assign_compartments derives its
default floor from biomass_reaction. organisms_in_domain raises for an empty
domain. load_condition returns {} for an empty file. reporter_metabolites leaves
a gene without a fold change out of both subsets. constrain_reversible_reactions
catches AttributeError only.

The oracle generator records reporter_metabolites with fold changes and an
empty condition file; the recorded oracles are committed.
@edkerk
edkerk merged commit 79e0814 into develop Oct 31, 2026
10 checks passed
@edkerk
edkerk deleted the fix/follow-ups branch October 31, 2026 19:25
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