Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions grits/coarsegrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ def __repr__(self):
"""Format the CG_Compound representation."""
return (
f"<{self.name}: {self.n_particles} beads "
+ f"(from {self.atomistic.n_particles} atoms), "
+ "pos=({:.4f},{: .4f},{: .4f}), ".format(*self.pos)
+ f"{self.n_bonds:d} bonds>"
)
Expand Down Expand Up @@ -719,7 +718,7 @@ def save(self, cg_gsdfile, start=0, stop=None, stride=1):
)
if bond_pair not in bond_types:
bond_types.append(bond_pair)
_id = np.where(np.array(bond_types) == bond_pair)[0]
_id = bond_types.index(bond_pair)
bond_ids.append(_id)
else:
bond_types = None
Expand Down Expand Up @@ -777,9 +776,9 @@ def save(self, cg_gsdfile, start=0, stop=None, stride=1):
if N_bonds > 0:
new_snap.bonds.N = N_bonds
new_snap.bonds.group = self._bond_array
new_snap.bonds.typeid = np.array(bond_ids)
new_snap.bonds.typeid = bond_ids
if bond_types is not None:
new_snap.bonds.types = np.array(bond_types)
new_snap.bonds.types = bond_types
else:
new_snap.bonds.types = None
new_snap.bonds.type_shapes = bond_type_shapes
Expand Down
Loading