Skip to content

Commit 8c7672e

Browse files
authored
feat(io.yaml): factor model_from_yaml_data out of read_yaml_model + back-port docs / known-issues / localization / scripts (#11)
* Project scaffold: pyproject + package skeleton + README + LICENSE * Add GitHub Actions CI and the maintainer-scripts README * Add the foundation utilities: GPR, balance, parse, sort, validate * Add the model-manipulation layer (add, remove, transport, merge, etc.) * Add binary + data resolvers for external tools and published artefacts * Add YAML and SIF model I/O * Add Excel export and the Standard-GEM git-layout export * Add BLAST and DIAMOND wrappers for protein-homology searches * Add the homology-based draft model builder (getModelFromHomology port) * Add KEGG download, dump parser and taxonomy parser * Add KEGG HMM-library build and HMM-based KO assignment * Add KEGG species-model assembly (per-organism reconstruction) * Add KEGG artefact-build scripts and HMM-cutoff calibration docs * Add metabolic-task parsing and the check_tasks validator * Add connectivity gap-filling (MILP) against template models * Add the tINIT (INIT) MILP and its supporting machinery * Add the ftINIT pipeline and task-aware gap-filling * Add Human-GEM validation, parameter studies and cross-solver tests * Add HPA omics ingestion (proteomics + RNA-seq) * Add FSEOF, reporter metabolites and flux sampling * Add N-model comparison (presence + Jaccard + optional task check) * Add subcellular-localisation prediction (MILP) with pluggable predictors * Add the yeast-GEM localization benchmark (real-data validation) * Add the documentation index, RAVEN migration map and CHANGELOG * Add known-issues catalogue with closed sweep A–F regression notes * Add the consolidated MATLAB RAVEN back-port proposals doc * feat(io.yaml): factor model_from_yaml_data out of read_yaml_model read_yaml_model now opens+parses the file then delegates the post-parse work (capturing per-entry side-fields onto notes, restoring legacy metaData id/name, stashing unknown top-level sections onto model.notes['_yaml_sections']) to a new model_from_yaml_data(raw: dict) helper. This lets downstream packages that need to pre-normalise their YAML before cobra reads it (e.g. geckopy, which lifts legacy MATLAB ec-model quirks like top-level per-metabolite `smiles` into `annotation` and merges bare-`-` sequence-of-single-key-maps back to a mapping) hand the cleaned dict directly to the post-parse pipeline, without round-tripping through a temp file. Both functions are exported from raven_python.io.yaml. Pure refactor on the read side; no behaviour change for existing read_yaml_model callers. * fix(io.yaml): drop metaData/version/_yaml_sections from doc['notes'] cobra's model_to_dict serialises model.notes verbatim into the output doc as the 'notes' section. write_yaml_model already pops these three management keys from a local copy of model.notes to use them as top-level YAML fields, but the originals remained on model.notes and therefore also leaked into doc['notes'], producing duplicate sections in the file (the legitimate top-level emit AND a nested copy inside notes). Strip them from doc['notes'] post-model_to_dict and drop the notes section entirely when nothing else is left. Discovered while round-tripping a geckopy ecModel (it stashes ec-rxns / ec-enzymes / gecko_light on model.notes['_yaml_sections']); was visible as duplicated GECKO sections in the written YAML.
1 parent 36e5306 commit 8c7672e

0 file changed

File tree

    0 commit comments

    Comments
     (0)