Skip to content

Conversation

@dstansby
Copy link
Contributor

@dstansby dstansby commented Sep 5, 2025

Recently #3406 was a bit of a tangle where group() and create_group() had different behaviour - this was fixed by making group() a simple wrapper of create_group(), as intended.

To reduce this API surface, this PR deprecates group(), advising users to use either create_group() or open_group(). The intent of these other functions is clearer, and it mirrors the methods on the Group class, which does not have a group() method.

I left in one test that uses group() to make sure it still works during the deprecation period.

TODO:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/user-guide/*.rst
  • Changes documented as a new file in changes/
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

@github-actions github-actions bot added the needs release notes Automatically applied to PRs which haven't added release notes label Sep 5, 2025
@d-v-b
Copy link
Contributor

d-v-b commented Sep 5, 2025

👍

@github-actions github-actions bot removed the needs release notes Automatically applied to PRs which haven't added release notes label Sep 5, 2025
# Conflicts:
#	docs/developers/contributing.rst
#	docs/quickstart.rst
#	docs/user-guide/groups.rst
@github-actions github-actions bot added the needs release notes Automatically applied to PRs which haven't added release notes label Jan 2, 2026
@github-actions github-actions bot removed the needs release notes Automatically applied to PRs which haven't added release notes label Jan 2, 2026
@dstansby dstansby marked this pull request as ready for review January 2, 2026 17:39
@codecov
Copy link

codecov bot commented Jan 2, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.88%. Comparing base (884a8c9) to head (6ff3beb).

Files with missing lines Patch % Lines
src/zarr/api/asynchronous.py 0.00% 1 Missing ⚠️
src/zarr/api/synchronous.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3435      +/-   ##
==========================================
- Coverage   60.90%   60.88%   -0.02%     
==========================================
  Files          86       86              
  Lines       10174    10176       +2     
==========================================
  Hits         6196     6196              
- Misses       3978     3980       +2     
Files with missing lines Coverage Δ
src/zarr/core/group.py 70.27% <ø> (ø)
src/zarr/testing/stateful.py 98.84% <100.00%> (ø)
src/zarr/api/asynchronous.py 71.95% <0.00%> (-0.25%) ⬇️
src/zarr/api/synchronous.py 36.11% <0.00%> (-0.51%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

return z


@deprecated("Use open_group() or create_group() instead")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we state that group will be removed in a future release (3.2?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤷 I'm happy either way. If you'd like me to add a specific release, let me know, and I can update the developer docs too with instructions to do this when deprecating.

Copy link
Contributor

@d-v-b d-v-b left a comment

Choose a reason for hiding this comment

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

just 1 question about whether we should be more specific in the deprecation warning, otherwise looks good

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.

2 participants