Commit b20a89e
committed
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.1 parent 0f3ec0d commit b20a89e
1 file changed
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
90 | 97 | | |
91 | 98 | | |
92 | 99 | | |
93 | 100 | | |
94 | 101 | | |
| 102 | + | |
| 103 | + | |
95 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
96 | 116 | | |
97 | 117 | | |
98 | 118 | | |
| |||
0 commit comments