Skip to content

Commit

Permalink
Added support for older versions of gemmi
Browse files Browse the repository at this point in the history
  • Loading branch information
rmk65 committed Jan 16, 2025
1 parent e791d8c commit 8537588
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion simbad/util/pdb_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ def keep_first_chain_only(self):
self.select_chain_by_idx(0)

def keep_first_model_only(self):
models = [m.num for m in self.structure]
if int(gemmi.__version__.replace(".","")) <= 70:
models = [m.name for m in self.structure]
else:
models = [m.num for m in self.structure]
for model in models[1:]:
del self.structure[model]

Expand Down

0 comments on commit 8537588

Please sign in to comment.