Skip to content

Fix sparse dask repr test #10200

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

Merged
merged 1 commit into from
Apr 4, 2025
Merged

Conversation

dcherian
Copy link
Contributor

@dcherian dcherian commented Apr 4, 2025

  • Closes #xxxx
  • Tests added
  • User visible changes (including notable bug fixes) are documented in whats-new.rst
  • New functions/methods are listed in api.rst

@@ -719,13 +720,17 @@ def test_sparse_dask_dataset_repr(self):
ds = xr.Dataset(
data_vars={"a": ("x", sparse.COO.from_numpy(np.ones(4)))}
).chunk()
if Version(sparse.__version__) >= Version("0.16.0"):
meta = "sparse.numba_backend._coo.core.COO"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This seems to be because dask extracts the __module__ which has now moved I guess.

https://github.com/dask/dask/blob/8d53292b05535c41b478ec882dd65d485bf1eb38/dask/array/core.py#L1632-L1633

cc @hameerabbasi and @fjetter

Choose a reason for hiding this comment

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

Would there be a way to avoid depending on __module__? Alternatively, would there be a preference about what to keep it constant at? I'm happy to make a post1 release fixing this.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have a suggestion on what else to use. not sure if I understand the proposal for a constant. What kind of constant could you use here?

Choose a reason for hiding this comment

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

Ah, I see. It's about keeping the Dask repr constant, which in turn uses __module__. I could change the module of all our functions/methods to be just "sparse" and making a post0 release.

@dcherian dcherian enabled auto-merge (squash) April 4, 2025 14:39
@dcherian dcherian merged commit 81fe55a into pydata:main Apr 4, 2025
30 checks passed
@dcherian dcherian deleted the fix-sparse-repr-test branch April 4, 2025 15:45
dcherian added a commit to ilan-gold/xarray that referenced this pull request Apr 4, 2025
* main:
  Fix sparse dask repr test (pydata#10200)
  Apply ruff preview rule RUF046 (pydata#10199)
  DOC: Remove mention of netcdf pypi package (pydata#10197)
Mikejmnez pushed a commit to Mikejmnez/xarray that referenced this pull request Apr 12, 2025
dcherian added a commit that referenced this pull request Apr 27, 2025
* main: (76 commits)
  Update how-to-add-new-backend.rst (#10240)
  Support extension array indexes (#9671)
  Switch documentation to pydata-sphinx-theme (#8708)
  Bump codecov/codecov-action from 5.4.0 to 5.4.2 in the actions group (#10239)
  Fix mypy, min-versions CI, xfail Zarr tests (#10255)
  Remove `test_dask_layers_and_dependencies` (#10242)
  Fix: Docs generation create temporary files that are not cleaned up. (#10238)
  opendap / dap4 support for pydap backend (#10182)
  Add RangeIndex (#10076)
  Fix mypy (#10232)
  Fix doctests (#10230)
  Fix broken Sphinx Roles (#10225)
  `DatasetView.map` fix `keep_attrs` (#10219)
  Add datatree repr asv (#10214)
  CI: Automatic PR labelling is back (#10201)
  Fixes dimension order in `xarray.Dataset.to_stacked_array` (#10205)
  Fix references to core classes in docs (#10207)
  Update pre-commit hooks (#10208)
  add `scipy-stubs` as extra `[types]` dependency (#10202)
  Fix sparse dask repr test (#10200)
  ...
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.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy