The issue arises in CG_System because the _set_mapping method is called when you pass in beads, but it isn't called when passing in mapping instead.
if beads is not None:
# get compounds
self._get_compounds(
beads=beads,
allow_overlap=allow_overlap,
length_scale=length_scale,
conversion_dict=conversion_dict,
add_hydrogens=add_hydrogens,
aniso_beads=aniso_beads,
)
# calculate the bead mappings for the entire trajectory
self._set_mapping()
elif mapping is not None:
if not isinstance(mapping, dict):
with open(mapping, "r") as f:
mapping = json.load(f)
self.mapping = mapping
Inside the _set_mapping method, the bond information is populated, and this information is needed to infer angles and dihedrals as well.
The issue arises in
CG_Systembecause the_set_mappingmethod is called when you pass inbeads, but it isn't called when passing inmappinginstead.Inside the
_set_mappingmethod, the bond information is populated, and this information is needed to infer angles and dihedrals as well.