docs: clarify difference between load and open in docstrings#3984
Open
SAY-5 wants to merge 11 commits into
Open
docs: clarify difference between load and open in docstrings#3984SAY-5 wants to merge 11 commits into
SAY-5 wants to merge 11 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3984 +/- ##
=======================================
Coverage 93.50% 93.50%
=======================================
Files 90 90
Lines 11981 11981
=======================================
Hits 11203 11203
Misses 778 778
🚀 New features to boost your workflow:
|
4a16523 to
25998f0
Compare
maxrjones
reviewed
Jun 25, 2026
maxrjones
left a comment
Member
There was a problem hiding this comment.
Thanks for this PR, and sorry for the slow review!
I left some comments since the loaded array type is not always NumPy.
| @@ -0,0 +1,4 @@ | |||
| Clarify the difference between `zarr.load` and `zarr.open` in their docstrings. | |||
| `load` eagerly reads data into an in-memory NumPy array, while `open` returns a | |||
Member
There was a problem hiding this comment.
Suggested change
| `load` eagerly reads data into an in-memory NumPy array, while `open` returns a | |
| `load` eagerly reads data into an in-memory array, while `open` returns a |
| ----- | ||
| `open` returns a lazy [`Array`][zarr.Array] or [`Group`][zarr.Group] backed by | ||
| the store, so data is read and written incrementally. Use [`load`][zarr.load] | ||
| instead when you want the data eagerly read into an in-memory NumPy array. |
Member
There was a problem hiding this comment.
Suggested change
| instead when you want the data eagerly read into an in-memory NumPy array. | |
| instead when you want the data eagerly read into an in-memory array | |
| (a NumPy array by default). |
| ----- | ||
| `open` returns a lazy [`Array`][zarr.Array] or [`Group`][zarr.Group] backed by | ||
| the store, so data is read and written incrementally. Use [`load`][zarr.load] | ||
| instead when you want the data eagerly read into an in-memory NumPy array. |
Member
There was a problem hiding this comment.
Suggested change
| instead when you want the data eagerly read into an in-memory NumPy array. | |
| instead when you want the data eagerly read into an in-memory array (a | |
| NumPy array by default). |
|
|
||
| Unlike [`open`][zarr.open], which returns a lazy [`Array`][zarr.Array] or | ||
| [`Group`][zarr.Group] backed by the store, `load` eagerly reads the data and | ||
| returns it as an in-memory NumPy array (or a dict of NumPy arrays for a group). |
Member
There was a problem hiding this comment.
Suggested change
| returns it as an in-memory NumPy array (or a dict of NumPy arrays for a group). | |
| returns it as an in-memory array (or a dict of arrays for a group). | |
| The array type is NumPy by default, but follows the configured | |
| buffer prototype (for example, CuPy for GPU use cases). |
|
|
||
| Unlike [`open`][zarr.open], which returns a lazy [`Array`][zarr.Array] or | ||
| [`Group`][zarr.Group] backed by the store, `load` eagerly reads the data and | ||
| returns it as an in-memory NumPy array (or a dict of NumPy arrays for a group). |
Member
There was a problem hiding this comment.
Suggested change
| returns it as an in-memory NumPy array (or a dict of NumPy arrays for a group). | |
| returns it as an in-memory array (or a dict of arrays for a group). | |
| The array type is NumPy by default, but follows the configured | |
| buffer prototype (for example, CuPy for GPU use cases). |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #463. Adds
NotesandSee Alsocross-references to theloadandopendocstrings explaining thatloadeagerly reads data into in-memory NumPy arrays whileopenreturns a lazyArray/Groupbacked by the store, addressing the maintainer's note that "the documentation could definitely be improved here, PR welcome."TODO:
docs/user-guide/*.mdchanges/