Skip to content

Commit

Permalink
Change default numpy2 printing options in test.py.
Browse files Browse the repository at this point in the history
Change the default numpy 2 printing options that crash
doctests on scalars.
  • Loading branch information
nennigb committed Jul 22, 2024
1 parent b2ddbd9 commit 402f296
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions polze/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
import cmath
import sys

# Numpy 2.0 change default printing options making doctest failing.
# https://numpy.org/neps/nep-0051-scalar-representation.html
# Use legacy mode for testing
if np.lib.NumpyVersion(np.__version__) >= '2.0.0b1':
np.set_printoptions(legacy="1.25")

# Define a non vectorized function
# For parallel processing we need a function defined outside the class.
Expand Down

0 comments on commit 402f296

Please sign in to comment.