Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make test suite ready for NumPy 2.0.0 #4622

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bnavigator
Copy link
Contributor

The soon to be released NumPy 2.0.0 removes some aliases of np.nan and np.inf, so these must be removed from the tests in order to keep the test suite green.

Also, when testing data with small integer types like int8, the literals need to be cast beforehand in order to avoid overflow errors.

References

Code PR

  • I have read through the contributing notes and understand the structure of the package. In particular, if my PR modifies code of plotly.graph_objects, my modifications concern the codegen files and not generated files.
  • I have added tests (if submitting a new feature or correcting a bug) or modified existing tests.
  • For a new feature, I have added documentation examples in an existing or
    new tutorial notebook (please see the doc checklist as well).
  • I have added a CHANGELOG entry if fixing/changing/adding anything substantial.
  • For a new feature or a change in behaviour, I have updated the relevant docstrings in the code to describe the feature or behaviour (please see the doc checklist as well).

@@ -6,7 +6,7 @@
from datetime import datetime as dt
import numpy as np

np_list = np.array([1, 2, 3, np.NaN, np.NAN, np.Inf, dt(2014, 1, 5)])
np_list = np.array([1, 2, 3, np.nan, np.inf, dt(2014, 1, 5)])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to have separate tests for both numpy v1 and v2.

Copy link
Contributor

@marthacryan marthacryan Jul 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In #4696 @marthacryan added a CircleCI test for the case when numpy is not installed.
Instead of changing the tests that use numpy_v1, what I want to see is to add tests for numpy_v2.

@marthacryan
Copy link
Contributor

@bnavigator Is it okay if I push some changes here to handle both versions of numpy?

@bnavigator
Copy link
Contributor Author

@bnavigator Is it okay if I push some changes here to handle both versions of numpy?

Yes, of course. Sorry I do not have time to enhance it myself right now.

@gvwilson gvwilson added feature something new P1 needs immediate attention community community contribution labels Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community community contribution feature something new P1 needs immediate attention
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants