Skip to content

Commit

Permalink
changing np ints to np.int64 explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
loodvn committed Aug 1, 2023
1 parent 840d102 commit a9181df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions evcouplings/compare/pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,9 @@ def _get_range(object_counts):
"""
Extract index ranges for chains, residues and atoms
"""
last_element = np.cumsum(object_counts, dtype=int)
last_element = np.cumsum(object_counts, dtype=np.int64)
first_element = np.concatenate(
(np.zeros(1, dtype=int), last_element[:-1])
(np.zeros(1, dtype=np.int64), last_element[:-1])
)

return first_element, last_element
Expand Down Expand Up @@ -576,7 +576,7 @@ def get_chain(self, chain, model=0):
)

# indices of chains that match chain name, in current model
indices = np.arange(first_chain_index, last_chain_index, dtype=int)
indices = np.arange(first_chain_index, last_chain_index, dtype=np.int64)
target_chain_indeces = indices[chain_names == chain]

if len(target_chain_indeces) == 0:
Expand All @@ -598,7 +598,7 @@ def get_chain(self, chain, model=0):
chain_indeces = np.concatenate([
np.full(
self.last_residue_index[i] - self.first_residue_index[i],
i, dtype=int
i, dtype=np.int64
) for i in target_chain_indeces
])

Expand Down
6 changes: 3 additions & 3 deletions evcouplings/couplings/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ def convert_sequences(self, sequences):
)
)

S = np.empty((len(sequences), L_seq), dtype=int)
S = np.empty((len(sequences), L_seq), dtype=np.int64)

try:
for i, s in enumerate(sequences):
Expand Down Expand Up @@ -689,8 +689,8 @@ def delta_hamiltonian(self, substitutions, verify_mutants=True):
2) delta J_ij, 3) delta h_i
"""
pos = np.empty(len(substitutions), dtype=int)
subs = np.empty(len(substitutions), dtype=int)
pos = np.empty(len(substitutions), dtype=np.int64)
subs = np.empty(len(substitutions), dtype=np.int64)

try:
for i, (subs_pos, subs_from, subs_to) in enumerate(substitutions):
Expand Down

0 comments on commit a9181df

Please sign in to comment.