Skip to content

Commit

Permalink
deprecations: replaced np.str -> str, np.int -> int; pd.testing.asser…
Browse files Browse the repository at this point in the history
…t_frame_equal: check_less_precise -> rtol=1e-3
  • Loading branch information
loodvn committed Aug 1, 2023
1 parent d362781 commit 840d102
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion evcouplings/align/alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def sequences_to_matrix(sequences):

N = len(sequences)
L = len(next(iter(sequences)))
matrix = np.empty((N, L), dtype=np.str)
matrix = np.empty((N, L), dtype=str)

for i, seq in enumerate(sequences):
if len(seq) != L:
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=np.int)
S = np.empty((len(sequences), L_seq), dtype=int)

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=np.int)
subs = np.empty(len(substitutions), dtype=np.int)
pos = np.empty(len(substitutions), dtype=int)
subs = np.empty(len(substitutions), dtype=int)

try:
for i, (subs_pos, subs_from, subs_to) in enumerate(substitutions):
Expand Down
4 changes: 3 additions & 1 deletion test/TestComplex.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,9 @@ def test_find_possible_partners(self):

pd.testing.assert_frame_equal(
self.possible_partners, _possible_partners,
check_less_precise=True, check_like=True,
check_exact=False,
rtol=1e-3,
check_like=True,
check_names=False
)

Expand Down
4 changes: 2 additions & 2 deletions test/TestMutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def test_single_mutant_matrix(self):
# gotta round to account for this
_singles = _singles.round(3)
singles = singles.round(3)
pd.testing.assert_frame_equal(singles, _singles, check_exact=False, check_less_precise=True)
pd.testing.assert_frame_equal(singles, _singles, check_exact=False, rtol=1e-3)

def test_split_mutants_single(self):
"""
Expand Down Expand Up @@ -228,7 +228,7 @@ def test_predict_mutation_table_segment_column(self):
self.c0, self.singles, output_column="prediction_independent"
)

pd.testing.assert_frame_equal(self.singles, _singles, check_less_precise=True)
pd.testing.assert_frame_equal(self.singles, _singles, check_exact=False, rtol=1e-3)

def test_predict_mutation_table_empty_segment(self):
"""
Expand Down

0 comments on commit 840d102

Please sign in to comment.