De-duplicate exportModel and remove dead code#634
Merged
Conversation
exportModel already writes only SBML L3V1 FBCv2, so this is a behaviour- preserving cleanup with no change to the output: - extract the SBO-term extraction-from-MIRIAM pattern (repeated for compartments, metabolites, genes and reactions) into a local extractSBO helper - extract the repeated RDF/XML annotation header into rdfAnnotationHeader - remove the unused columnVector sub-function - remove the dead "if sbmlLevel<3" branch (sbmlLevel is always 3) Verified by byte-identical SBML output (ignoring the export timestamp) for empty.xml and iAL1006, and a green importExportTests. exportModel.m drops from 810 to 780 lines.
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.
Summary
exportModelalready writes only SBML L3V1 FBCv2 (no legacy/alternate output paths), so this is a behaviour-preserving cleanup with no change to the emitted SBML.Changes
extractSBO(miriam)helper (returns the parsed SBO term, or[]when absent, and the miriam with thesboentry stripped). Call sites assignsboTermonly when present, exactly as before.rdfAnnotationHeader(metaid), reproduced byte-for-byte. The model-level<dc:creator>annotation is left as-is.columnVectorsub-function.if sbmlLevel<3branch (sbmlLevelis hard-coded to 3).Verification
SBML output is byte-identical (ignoring the export timestamp) for
empty.xmlandiAL1006 v1.00.xml(a rich model: 3945 SBO terms, miriams, genes, subsystems), confirming the extracted helpers reproduce the original output exactly.importExportTestspasses 7/7.io/exportModel.m: 810 → 780 lines.