Skip to content

Modify custom dtype example to use only public API#4052

Open
chuckwondo wants to merge 5 commits into
zarr-developers:mainfrom
chuckwondo:dtype-example-use-public-api
Open

Modify custom dtype example to use only public API#4052
chuckwondo wants to merge 5 commits into
zarr-developers:mainfrom
chuckwondo:dtype-example-use-public-api

Conversation

@chuckwondo

Copy link
Copy Markdown
Contributor

Modify custom dtype example to use only public API. As part of this effort, move/deprecate any types or functions currently inaccessible from the public API, but should be.

  • Internally change all imports of DataTypeValidationError to import from zarr.errors and deprecate imports of DataTypeValidationError from all other modules.

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/*.md
  • Changes documented as a new file in changes/
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

@chuckwondo chuckwondo requested a review from d-v-b June 8, 2026 17:45
@github-actions github-actions Bot added the needs release notes Automatically applied to PRs which haven't added release notes label Jun 8, 2026
@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.55%. Comparing base (0b431e6) to head (186e01b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4052      +/-   ##
==========================================
+ Coverage   93.53%   93.55%   +0.01%     
==========================================
  Files          88       88              
  Lines       11917    11949      +32     
==========================================
+ Hits        11147    11179      +32     
  Misses        770      770              
Files with missing lines Coverage Δ
src/zarr/core/dtype/__init__.py 100.00% <100.00%> (ø)
src/zarr/core/dtype/common.py 86.20% <100.00%> (+1.02%) ⬆️
src/zarr/core/dtype/npy/bool.py 100.00% <100.00%> (ø)
src/zarr/core/dtype/npy/bytes.py 99.50% <100.00%> (+<0.01%) ⬆️
src/zarr/core/dtype/npy/complex.py 97.61% <100.00%> (+0.02%) ⬆️
src/zarr/core/dtype/npy/float.py 98.03% <100.00%> (+0.01%) ⬆️
src/zarr/core/dtype/npy/int.py 99.38% <100.00%> (+<0.01%) ⬆️
src/zarr/core/dtype/npy/string.py 97.69% <100.00%> (+0.01%) ⬆️
src/zarr/core/dtype/npy/structured.py 92.66% <100.00%> (+0.04%) ⬆️
src/zarr/core/dtype/npy/time.py 98.86% <100.00%> (+<0.01%) ⬆️
... and 4 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chuckwondo chuckwondo force-pushed the dtype-example-use-public-api branch from 05907f6 to 31d438d Compare June 8, 2026 18:14
@chuckwondo

Copy link
Copy Markdown
Contributor Author

@d-v-b, I believe I've covered everything, except for renaming check_dtype_spec_v2 to is_dtype_spec_v2. Do you want me to do that too? If so, do you want me to deprecate check_dtype_spec_v2, or is that unnecessary since prior to this PR it is technically not public?

@chuckwondo chuckwondo marked this pull request as ready for review June 8, 2026 20:55
@chuckwondo chuckwondo force-pushed the dtype-example-use-public-api branch from 9748286 to 86dc1e2 Compare June 9, 2026 14:22
Internally change all imports of DataTypeValidationError to import from
zarr.errors and deprecate imports of DataTypeValidationError from all
other modules.
@chuckwondo chuckwondo force-pushed the dtype-example-use-public-api branch from 86dc1e2 to 24ced4d Compare June 9, 2026 15:54
@chuckwondo

Copy link
Copy Markdown
Contributor Author

@d-v-b, I believe I've covered everything, except for renaming check_dtype_spec_v2 to is_dtype_spec_v2. Do you want me to do that too? If so, do you want me to deprecate check_dtype_spec_v2, or is that unnecessary since prior to this PR it is technically not public?

nudge

@d-v-b

d-v-b commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@d-v-b, I believe I've covered everything, except for renaming check_dtype_spec_v2 to is_dtype_spec_v2. Do you want me to do that too? If so, do you want me to deprecate check_dtype_spec_v2, or is that unnecessary since prior to this PR it is technically not public?

yes, we can safely rename, as it wasn't public, despite appearing in the example.

@d-v-b

d-v-b commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

out of abundance of caution I can open a follow-up PR that keeps the old check_... name around, with a deprecation warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs release notes Automatically applied to PRs which haven't added release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants