Skip to content

Commit

Permalink
fix missing resid is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxuanzhuang committed Jun 19, 2022
1 parent 71920b1 commit 1eb4794
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion package/MDAnalysis/core/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ def make_downshift_arrays(upshift, nparents):
residue_indices[u_values] = indices[1:]

for missing_resid in missing_resids:
residue_indices[missing_resid] = residue_indices[missing_resid-1]
if missing_resid == 0:
residue_indices[missing_resid] = 0
else:
residue_indices[missing_resid] = residue_indices[missing_resid-1]

downshift = np.split(order, residue_indices[:-1])
# Add None to end of array to force it to be of type Object
Expand Down

0 comments on commit 1eb4794

Please sign in to comment.