plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

Make test suite ready for NumPy 2.0.0

Open bnavigator opened this issue 1 year ago • 0 comments

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

  • https://numpy.org/news/#numpy-20-release-date-june-16
  • https://numpy.org/devdocs/release/2.0.0-notes.html#numpy-2-0-python-api-removals
  • https://numpy.org/devdocs/numpy_2_0_migration_guide.html#changes-to-numpy-data-type-promotion

Code PR

  • [x] 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.
  • [x] 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).~

bnavigator avatar Jun 02 '24 15:06 bnavigator