ihmwg / python-ihm

Python package for handling IHM mmCIF and BinaryCIF files
MIT License
14 stars 7 forks source link

Dictionary parser incorrectly handles data items defined before categories #107

Closed benmwebb closed 1 year ago

benmwebb commented 1 year ago

If a category definition (_category.id) is found in the dictionary after a data item in that category (_item.name) then that data item is ignored (or rather, a new Category object is created which overwrites the temporary one created when the data item was encountered). One example in PDBx is entity_src_gen, which is defined after entity_src_gen.entity_id. We can fix that by updating rather than overwriting the existing Category object. See also ihmwg/python-modelcif#30.