Skip to content

Commit

Permalink
Merge pull request #19 from nennigb/fix-np2-new-scalar-formating
Browse files Browse the repository at this point in the history
Use numpy legacy printing in tests to maintain doctest.
  • Loading branch information
MartinGhienne authored Jul 23, 2024
2 parents 4329300 + 3792423 commit 13151c9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pypolsys/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
import os
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")


def sort_ref_found(ref, r):
""" Sort reference solution and the found solution using
Expand Down

0 comments on commit 13151c9

Please sign in to comment.