-
-
Notifications
You must be signed in to change notification settings - Fork 346
Add human readable size for No. bytes stored to info_complete
#3190
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
Conversation
@@ -133,7 +133,7 @@ def __repr__(self) -> str: | |||
|
|||
if self._count_bytes_stored is not None: | |||
template += "\nNo. bytes stored : {_count_bytes_stored}" | |||
kwargs["_count_stored"] = byte_info(self._count_bytes_stored) | |||
kwargs["_count_bytes_stored"] = byte_info(self._count_bytes_stored) |
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.
we got bitten by kwargs
here :(
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.
for posterity, if we really want to use kwargs
(and I think we should not), we should define some typeddicts to model what goes in kwargs
. something for a later pr.
@@ -285,7 +285,7 @@ Here is an example using a delta filter with the Blosc compressor:: | |||
>>> compressors = zarr.codecs.BloscCodec(cname='zstd', clevel=1, shuffle=zarr.codecs.BloscShuffle.shuffle) | |||
>>> data = np.arange(100000000, dtype='int32').reshape(10000, 10000) | |||
>>> z = zarr.create_array(store='data/example-9.zarr', shape=data.shape, dtype=data.dtype, chunks=(1000, 1000), filters=filters, compressors=compressors) | |||
>>> z.info | |||
>>> z.info_complete() |
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.
This was the only real change to docs. Seems like if you are explaining about compression it's useful to show this extra information.
@@ -79,7 +79,7 @@ def test_array_info(zarr_format: ZarrFormat) -> None: | |||
|
|||
|
|||
@pytest.mark.parametrize("zarr_format", ZARR_FORMATS) | |||
@pytest.mark.parametrize("bytes_things", [(1_000_000, "976.6K", 500_000, "500000", "2.0", 5)]) | |||
@pytest.mark.parametrize("bytes_things", [(1_000_000, "976.6K", 500_000, "488.3K", "2.0", 5)]) |
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 love "bytes_things"
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.
thanks! this is a nice improvement
Thanks a lot, this is a nice improvement! Could you add a file to the |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3190 +/- ##
=======================================
Coverage 94.73% 94.73%
=======================================
Files 78 78
Lines 8646 8646
=======================================
Hits 8191 8191
Misses 455 455
🚀 New features to boost your workflow:
|
thanks @jsignell! |
Example:
Note: I think this was the intention, looks like just a dict key misalignment.
TODO:
docs/user-guide/*.rst
changes/