Skip to content

Commit

Permalink
Fix compatibility against numpy 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Wentzell committed Jun 28, 2024
1 parent 13b0794 commit cbaef0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions python/triqs_maxent/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def safelog(A):

def view_complex(A, reshape=True):
if not reshape:
return A.view(np.complex_)
return A.view(np.complex_).reshape(A.shape[:-1])
return A.view(np.complex128)
return A.view(np.complex128).reshape(A.shape[:-1])


def view_real(A, reshape=True):
Expand Down
2 changes: 1 addition & 1 deletion test/python/set_G_tau_complex_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def numpy_assert(a, b, dec): return np.testing.assert_almost_equal(
# this is necessary in TRIQS 2.1 but will fail in 1.4
from triqs.gf.gf_fnt import replace_by_tail
tail, err = G_iw_rot.fit_tail(
known_moments=np.zeros((1, 2, 2), dtype=np.complex_))
known_moments=np.zeros((1, 2, 2), dtype=np.complex128))
replace_by_tail(G_iw_rot, tail, 200)
except:
pass
Expand Down

0 comments on commit cbaef0d

Please sign in to comment.