Commit 43a5b16
committed
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 b20a89e commit 43a5b16
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
182 | 193 | | |
183 | 194 | | |
184 | 195 | | |
| |||
0 commit comments