Skip to content

Commit b89eeb5

Browse files
OccupyMars2025zhangyuxuann
authored andcommitted
use tolist() instead of traversing hetero_diff[0]
1 parent 1aabbbd commit b89eeb5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

protenix/data/utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -722,9 +722,8 @@ def pdb_to_cif(input_fname: str, output_fname: str, entry_id: str = None):
722722
new_chain_starts.append(c_start)
723723
hetero_diff = np.where(atom_array.hetero[c_start:(c_stop-1)] != atom_array.hetero[(c_start+1):c_stop])
724724
if hetero_diff[0].shape[0] > 0:
725-
for index in hetero_diff[0]:
726-
new_chain_start = c_start + index + 1
727-
new_chain_starts.append(new_chain_start)
725+
new_chain_starts_002 = c_start + hetero_diff[0] + 1
726+
new_chain_starts.extend(new_chain_starts_002.tolist())
728727

729728
new_chain_starts.append(chain_starts[-1])
730729

0 commit comments

Comments
 (0)