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

Allow wrapping np.ndarray subclasses #9760

Merged
merged 8 commits into from
Nov 13, 2024
Merged

Conversation

slevang
Copy link
Contributor

@slevang slevang commented Nov 10, 2024

Continuation of #9705, implements this logic.

Copy link
Collaborator

@keewis keewis left a comment

Choose a reason for hiding this comment

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

looks good to me, but since the implementation is literally what I was suggesting I'll leave this for someone else to merge.

Do we need to check that np.matrix is cast to just numpy? Or do we just not care because numpy.matrix is deprecated and may be removed at some point (after scipy.sparse got rid of its *_matrix classes)?

@slevang
Copy link
Contributor Author

slevang commented Nov 10, 2024

Do we need to check that np.matrix is cast to just numpy?

Do you mean explicitly test that np.matrix is cast to np.ndarray, or something else?

@keewis
Copy link
Collaborator

keewis commented Nov 10, 2024

Do we need to check that np.matrix is cast to just numpy?

Do you mean explicitly test that np.matrix is cast to np.ndarray, or something else?

that it is properly cast to numpy.ndarray, sorry. We might need to silence a deprecation warning for that, though.

@tien-vo
Copy link
Contributor

tien-vo commented Nov 11, 2024

@slevang thanks for taking charge. I've been busy, so haven't got time for #9705. When this is merge, I'll close the draft PR.

@keewis
Copy link
Collaborator

keewis commented Nov 11, 2024

I've added your PR to the list of "issues" that will be closed by this PR, so hopefully it should be closed automatically.

@tien-vo
Copy link
Contributor

tien-vo commented Nov 11, 2024

@keewis Thanks! But #9704 is the progress tracker. I think you mean to add #9705?

@dcherian dcherian merged commit 0f8ff5c into pydata:main Nov 13, 2024
7 of 8 checks passed
dcherian added a commit to dcherian/xarray that referenced this pull request Nov 16, 2024
* main:
  fix cf decoding of grid_mapping (pydata#9765)
  Allow wrapping `np.ndarray` subclasses (pydata#9760)
  Optimize polyfit (pydata#9766)
  Use `map_overlap` for rolling reductions with Dask (pydata#9770)
  fix html repr indexes section (pydata#9768)
dcherian added a commit that referenced this pull request Nov 19, 2024
* main: (24 commits)
  Bump minimum versions (#9796)
  Namespace-aware `xarray.ufuncs` (#9776)
  Add prettier and pygrep hooks to pre-commit hooks (#9644)
  `rolling.construct`: Add `sliding_window_kwargs` to pipe arguments down to `sliding_window_view` (#9720)
  Bump codecov/codecov-action from 4.6.0 to 5.0.2 in the actions group (#9793)
  Buffer types (#9787)
  Add download stats badges (#9786)
  Fix open_mfdataset for list of fsspec files (#9785)
  add 'User-Agent'-header to pooch.retrieve (#9782)
  Optimize `ffill`, `bfill` with dask when `limit` is specified (#9771)
  fix cf decoding of grid_mapping (#9765)
  Allow wrapping `np.ndarray` subclasses (#9760)
  Optimize polyfit (#9766)
  Use `map_overlap` for rolling reductions with Dask (#9770)
  fix html repr indexes section (#9768)
  Bump pypa/gh-action-pypi-publish from 1.11.0 to 1.12.2 in the actions group (#9763)
  unpin array-api-strict, as issues are resolved upstream (#9762)
  rewrite the `min_deps_check` script (#9754)
  CI runs ruff instead of pep8speaks (#9759)
  Specify copyright holders in main license file (#9756)
  ...
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.

Support for astropy.units
4 participants