Skip to content

Commit

Permalink
Work with newer python-ihm
Browse files Browse the repository at this point in the history
New python-ihm expects there to always be a list in
System of possibly orphaned ChemComps, so add one.
  • Loading branch information
benmwebb committed Jun 20, 2024
1 parent 9da1f6d commit 9c759b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions modelcif/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def __init__(self, title=None, id='model', database=None,
self.software = []
self.software_groups = []
self.assemblies = []
self._orphan_chem_comps = []

def _all_models(self):
"""Iterate over all Models in the system"""
Expand Down
3 changes: 2 additions & 1 deletion modelcif/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def __init__(self, model_class, starting_model_class):
self.asym_units = IDMapper(self.system.asym_units, ihm.AsymUnit, None)

#: Mapping from ID to :class:`ihm.ChemComp` objects
self.chem_comps = _ChemCompIDMapper(None, ihm.ChemComp, *(None,) * 3)
self.chem_comps = _ChemCompIDMapper(self.system._orphan_chem_comps,
ihm.ChemComp, *(None,) * 3)

self.software_groups = IDMapper(self.system.software_groups,
modelcif.SoftwareGroup)
Expand Down

0 comments on commit 9c759b5

Please sign in to comment.