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

api: make buffer public api #2664

Closed
wants to merge 2 commits into from

Conversation

jhamman
Copy link
Member

@jhamman jhamman commented Jan 7, 2025

This PR moves zarr.core.buffer to zarr.abc.buffer and zarr.buffer, paving the way to make the rest of zarr.core private in a follow up PR.

Towards #2621

@jhamman jhamman mentioned this pull request Jan 7, 2025
"Please use zarr.buffer and zarr.abc.buffer modules instead.",
FutureWarning,
stacklevel=2,
)
Copy link
Member Author

Choose a reason for hiding this comment

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

put this in to prompt a discussion -- numcodecs depends on this module already... which sucks.

@normanrz - do you have thoughts on how to proceed? Options are:

  1. keep zarr.core but document it as private. We've managed to do this in the Xarray project with few issues.
  2. change the import in numcodecs and make a new release

Copy link
Contributor

Choose a reason for hiding this comment

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

We can easily skip documenting some 'public' (without a _) modules, which would probably help:

zarr-python/docs/conf.py

Lines 64 to 76 in f9c2024

def skip_submodules(
app: sphinx.application.Sphinx,
what: str,
name: str,
obj: object,
skip: bool,
options: dict[str, Any]
) -> bool:
# Skip documenting zarr.codecs submodules
# codecs are documented in the main zarr.codecs namespace
if what == "module" and name.startswith("zarr.codecs."):
skip = True
return skip

Copy link
Member

Choose a reason for hiding this comment

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

I would also lean towards 1. Changing numcodecs would almost certainly also require some backwards-compat shim in zarr-python.

Copy link
Member Author

Choose a reason for hiding this comment

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

Alright, let's do that. I'll close this and open a doc-only PR later today.

It's a shame because I quite liked how this shook out. But it is what it is is.

@jhamman jhamman requested review from normanrz and dstansby January 7, 2025 01:00
@jhamman jhamman closed this Jan 7, 2025
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