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

switch the documentation to run with numpy>=2 #9177

Merged
merged 15 commits into from
Jul 11, 2024
Merged

Conversation

keewis
Copy link
Collaborator

@keewis keewis commented Jun 26, 2024

Doctests can't really support backwards compatibility with older versions of numpy – the repr of scalars was changed – so with this we basically stop supporting builds of the docs and running the doctests with numpy<2.0. I don't think that's an issue, though.

For cross we'll need to decide what to do... numpy>=2.0 stopped supporting deprecated np.cross on 2D arrays, and in #8993 I simply removed the tests for 2D arrays from the tests. If we do that here, as well, we'll have to modify the docstring. Another option would be to zero-pad to 3-dimensional.

I avoided a deciding on np.linspace(da1_0d, da2_0d, n) (see #9043) by extracting the value using .item().

Other than that, there seems to be an issue in to_dask_dataframe, which I'm still investigating. seems like my environment was the issue? CI doesn't fail, at least.

This is waiting on #9136

  • User visible changes (including notable bug fixes) are documented in whats-new.rst

@max-sixty
Copy link
Collaborator

Thank you v much for doing these @keewis

keewis and others added 2 commits June 27, 2024 22:16
and mention that we're falling back to `numpy.array_api` in `numpy<2.0`
Copy link
Contributor

@JessicaS11 JessicaS11 left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this, @keewis!

ci/requirements/doc.yml Outdated Show resolved Hide resolved
@dcherian dcherian merged commit c1965c2 into pydata:main Jul 11, 2024
26 of 28 checks passed
@keewis keewis deleted the numpy2-docs branch July 11, 2024 12:01
dcherian added a commit to dcherian/xarray that referenced this pull request Jul 11, 2024
* main:
  exclude the bots from the release notes (pydata#9235)
  switch the documentation to run with `numpy>=2` (pydata#9177)
  `numpy` 2 compatibility in the iris code paths (pydata#9156)
  `numpy` 2 compatibility in the `netcdf4` and `h5netcdf` backends (pydata#9136)
  Fix time indexing regression in `convert_calendar` (pydata#9192)
  Use duckarray assertions in test_coding_times (pydata#9226)
  Use reshape and ravel from duck_array_ops in coding/times.py (pydata#9225)
  Cleanup test_coding_times.py (pydata#9223)
  Only use necessary dims when creating temporary dataarray (pydata#9206)
  Fix two bugs in DataTree.update() (pydata#9214)
  Use numpy 2.0-compat `np.complex64` dtype in test (pydata#9217)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants