-
-
Notifications
You must be signed in to change notification settings - Fork 283
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
document storage classes and some developer apis #2279
Merged
Merged
Changes from 29 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
fe49f5f
fix: zarr v2 compatability fixes
jhamman 9a1580b
move zarr.store to zarr.storage
jhamman 0d89912
make chunks a tuple
jhamman d78e384
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman e534279
Apply suggestions from code review
jhamman dea4a3d
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman 7800f38
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman 93b61fc
more merge conflict resolution
jhamman 88afe52
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman fb6752d
fixups
jhamman 0b1dedc
fixup zipstore
jhamman 322918a
Apply suggestions from code review
jhamman a95d54a
Apply suggestions from code review
jhamman 128eb53
add test
jhamman 3c170ef
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman 54ab9ef
extend test
jhamman 77f2938
clean up parents
jhamman 2295d76
debug race condition
jhamman 5879d67
more debug
jhamman f54f6f2
document storage classes and some developer apis
jhamman 3940d22
Update src/zarr/core/array.py
jhamman c9d1c50
Merge branch 'fix/dask-compat' into doc/storage
jhamman 83fa3ac
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman f2137fb
Merge branch 'doc/storage' of github.com:jhamman/zarr-python into doc…
jhamman f44601b
Merge branch 'v3' into doc/storage
jhamman 731c22a
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman 4e93aa0
inherit docstrings from baseclass
jhamman dad94e2
Merge branch 'doc/storage' of github.com:jhamman/zarr-python into doc…
jhamman 5477d32
fix sphinx warning
jhamman 728d4f7
# docstring inherited
jhamman e293b47
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman cee730c
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman 3f7290f
add storage guide
jhamman 35a6428
add missing file
jhamman a78461e
update links
jhamman eff01ce
Merge branch 'v3' into doc/storage
jhamman c1f0923
Merge branch 'v3' into doc/storage
dstansby File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,3 +151,33 @@ def parse_order(data: Any) -> Literal["C", "F"]: | |
if data in ("C", "F"): | ||
return cast(Literal["C", "F"], data) | ||
raise ValueError(f"Expected one of ('C', 'F'), got {data} instead.") | ||
|
||
|
||
def _inherit_docstrings(cls: type[Any]) -> type[Any]: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Docstrings are already automatically inherited, e.g. see |
||
""" | ||
Inherit docstrings from base class | ||
|
||
Iterate over the methods of the class and if a method is missing a docstring, | ||
try to inherit one from a base class (ABC). | ||
|
||
Parameters | ||
---------- | ||
cls : object | ||
the class to inherit docstrings from | ||
|
||
Returns | ||
------- | ||
cls | ||
the class with updated docstrings | ||
""" | ||
# Iterate over the methods of the class | ||
for name, method in cls.__dict__.items(): | ||
# Skip if it's not a callable (method or function) | ||
if callable(method): | ||
# Get the corresponding method from the base class (ABC) | ||
for base in cls.__bases__: | ||
base_method = getattr(base, name, None) | ||
if base_method and not method.__doc__: | ||
method.__doc__ = base_method.__doc__ | ||
break | ||
return cls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we define these as a string somewhere, and then re-use it here and lower down by making the docstring a format string? I worry about lists like this getting out of sync if they're duplicated across docstrings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided not to do that here because its just this one method. If we have a docstring template tool in the future, I think it would be great to bring that to bear here (and even more so on the Group/Array classes).