Skip to content

fix: read compartment annotations in readYAMLmodel - #676

Merged
edkerk merged 1 commit into
develop3from
fix/yaml-compartment-annotation
Jul 17, 2026
Merged

fix: read compartment annotations in readYAMLmodel#676
edkerk merged 1 commit into
develop3from
fix/yaml-compartment-annotation

Conversation

@edkerk

@edkerk edkerk commented Jul 17, 2026

Copy link
Copy Markdown
Member

Main improvements in this PR:

  • fix:
    • readYAMLmodel read each compartment's annotation block as additional compartments, so a YAML round-trip of the tutorial model turned 4 compartments into 12 and exportModel then failed on duplicate compartment IDs. Annotations are now read into compMiriams.
  • documentation:
    • Round-trip test in tIO.m asserting comps, compNames and compMiriams.

Instructions on merging this PR:

  • This PR has develop3 as target branch, and will be resolved with a squash-merge.

writeYAMLmodel emits an annotation block per compartment, but the reader's
compartment section had no switch: every annotation line became a compartment
of its own. Reproduced on tutorial/iAL1006 v1.00.xml, where a YAML round-trip
turned 4 compartments into 12 (p, annotation, go, m, annotation, go, ...) with
compNames of !!omap and GO:0005777, after which exportModel hard-errored on
duplicate compartment IDs.

The reader now recognises the annotation key and gathers the entries into
compMiriams, mirroring the metabolite/reaction/gene sections. Annotation
entries are indented deeper than the compartment they belong to, which is what
separates them from the next compartment.

Adds a round-trip test asserting comps, compNames and compMiriams; the
existing YAML test only asserted a reaction count, which is why this survived.
@github-actions

Copy link
Copy Markdown

Function test results

241 tests   219 ✅  1m 2s ⏱️
 23 suites   22 💤
  1 files      0 ❌

Results for commit cfc153d.

@edkerk
edkerk merged commit 3c06cea into develop3 Jul 17, 2026
4 checks passed
@edkerk
edkerk deleted the fix/yaml-compartment-annotation branch July 17, 2026 19:37
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