Skip to content

Commit

Permalink
Force PMI offset to be a real Python int
Browse files Browse the repository at this point in the history
In some cases the PMI offset is numpy.int64.
python-ihm up to version 1.8 requires auth_seq_id_map
to be int, so coerce the offset to a real int.
  • Loading branch information
benmwebb committed Dec 6, 2024
1 parent 4a4cd0d commit 836317f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyext/src/mmcif.py
Original file line number Diff line number Diff line change
Expand Up @@ -1823,7 +1823,9 @@ def _trim_unrep_termini(entity, asyms, representations):
return
# Update offset (= number of unrepresented N terminal entity residues)
# in entity and all asyms
pmi_offset = rep_range[0] - 1
# Force offset to be a real Python int (not numpy.int64) as python-ihm
# up to version 1.8 requires auth_seq_id_map to be int.
pmi_offset = int(rep_range[0]) - 1
entity.pmi_offset = pmi_offset
for asym in asyms:
if asym.entity is entity:
Expand Down

0 comments on commit 836317f

Please sign in to comment.