Skip to content
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

Use new ByteRequest syntax and raise NotImplementedError on pickling #4

Merged
merged 88 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
7c2ebe2
chore: update pre-commit hooks (#2502)
pre-commit-ci[bot] Nov 18, 2024
d005ff7
[v3] Import crc32c through numcodecs (#2510)
normanrz Nov 21, 2024
3dd04ce
Remove asciitree dependency (#2511)
normanrz Nov 21, 2024
76904ea
Refactor/narrow array name type (#2499)
d-v-b Nov 22, 2024
7be0ac9
chore: update pre-commit hooks (#2517)
pre-commit-ci[bot] Nov 26, 2024
2961246
Multiple imports for an import name (#2504)
DimitriPapadopoulos Nov 29, 2024
206d145
Added Array.info_complete (#2514)
TomAugspurger Nov 29, 2024
cdd6a74
Fix iterating over sharding index (#2392)
brokkoli71 Nov 29, 2024
f8e3432
Imported name is not used anywhere in the module (#2520)
DimitriPapadopoulos Nov 29, 2024
90b3aea
Update ruff and associated changes (#2522)
DimitriPapadopoulos Dec 1, 2024
501ae9e
[v3] Makes data contiguous in v2 codec (#2515)
normanrz Dec 2, 2024
58ff3ec
Error when attempting to set with an array of incompatible shape. (#2…
dcherian Dec 2, 2024
44bcd16
Bump sphinx-autoapi from 3.3.3 to 3.4.0 in the actions group (#2525)
dependabot[bot] Dec 3, 2024
bda158a
zarr.store → zarr.storage (#2523)
DimitriPapadopoulos Dec 3, 2024
6ee3d40
Move stateful tests to public testing API (#2531)
dcherian Dec 5, 2024
ae6e8e6
add a complete step to the test CU (#2521)
normanrz Dec 5, 2024
2fe12a7
Proposed updates to contributor guide. (#2513)
rossbar Dec 5, 2024
fd688c4
Parse chunk shape to check for float values (#2535)
faymanns Dec 5, 2024
0cca6b0
chore(deps): make fsspec and upath optional dependencies (#2534)
jhamman Dec 6, 2024
333a9e3
[v3] implement / deprecate zarr.tree (#2537)
jhamman Dec 7, 2024
ed0f199
Improve installation page (#2538)
dstansby Dec 8, 2024
1a75957
chore: update pre-commit hooks (#2547)
pre-commit-ci[bot] Dec 9, 2024
ec67b12
Improve pre-commit configuration (#2551)
DimitriPapadopoulos Dec 12, 2024
4e53a70
Apply ruff preview rule RUF036 (#2524)
DimitriPapadopoulos Dec 12, 2024
01b73a7
rename exists_ok to overwrite (#2548)
d-v-b Dec 12, 2024
122760f
Feat/latency store (#2474)
d-v-b Dec 13, 2024
ab1a7b3
rename RemoteStore -> FsspecStore (#2557)
jhamman Dec 15, 2024
9972066
Bump pypa/gh-action-pypi-publish in the actions group (#2562)
dependabot[bot] Dec 16, 2024
77d0b11
Clean up optional dependency groups (#2541)
dstansby Dec 16, 2024
775979f
add warnings when using non-spec features with v3 (#2556)
normanrz Dec 16, 2024
c0f7ece
Shorten contributing page title (#2565)
dstansby Dec 16, 2024
a615ee9
Remove specs pages from docs (#2555)
dstansby Dec 17, 2024
a7714c7
Trim trailing whitespace (#2563)
dstansby Dec 17, 2024
f360fc6
Remove config warning if only one implementation exists (#2571)
brokkoli71 Dec 18, 2024
4455726
Remove license page from docs (#2570)
dstansby Dec 18, 2024
f035d45
docs/add docstrings to synchronous API (#2549)
d-v-b Dec 18, 2024
5bf7bcf
deps: add packaging to required deps (#2573)
jhamman Dec 19, 2024
1cc3917
correct array.nbytes, and add tests (#2576)
d-v-b Dec 19, 2024
4cb8ddd
Add default compressors to config (#2470)
brokkoli71 Dec 19, 2024
6930fe8
Remove temporary doc specific to branch V3 (#2578)
DimitriPapadopoulos Dec 20, 2024
6dc6d07
Feat/write empty chunks (#2429)
d-v-b Dec 20, 2024
fb11810
Multiple imports for an import name (#2580)
DimitriPapadopoulos Dec 20, 2024
1ac02ea
test and fix indexing for scalar arrays (#2583)
brokkoli71 Dec 28, 2024
190b867
Un-mark memory store as "for testing" (#2601)
dstansby Dec 31, 2024
2998561
remove test.py (#2612)
d-v-b Jan 1, 2025
b9699f5
Note that whole directories can be deleted in LocalStore (#2606)
dstansby Jan 2, 2025
2535503
fix: run-coverage command now tracks src directory (#2615)
jhamman Jan 2, 2025
f407a41
Don't document zarr.codec submodules (#2605)
dstansby Jan 2, 2025
7907852
Improve deprecation of zarr.creation and zarr.convenience (#2609)
dstansby Jan 2, 2025
cc4dff9
top-level functions for reading, creating data (#2463)
d-v-b Jan 2, 2025
a460fbc
Improve docstrings of zarr.api.synchronous (#2610)
dstansby Jan 3, 2025
c070940
Improve exception docs (#2624)
dstansby Jan 3, 2025
d6384f5
docs: split tutorial into multiple user guide sections (#2589)
jhamman Jan 3, 2025
372995e
show pprint import (#2632)
normanrz Jan 3, 2025
4fe104a
Fix open(..., mode='w') to create a group (#2629)
jni Jan 3, 2025
38953e3
Clean up public store API (#2603)
dstansby Jan 3, 2025
eef18f3
docs: add migration page to user guide (#2596)
jhamman Jan 3, 2025
13fc188
Move 'about' to end of table of contents (#2636)
dstansby Jan 3, 2025
23beb8f
docs: replace getting_started page with quickstart (#2590)
jhamman Jan 3, 2025
f1064a3
docs: consolidate developer docs + update contributing page for v3 (#…
jhamman Jan 4, 2025
584d66d
docs: update doc homepage (#2594)
jhamman Jan 4, 2025
3194534
Fix create_dataset with data kwarg (#2638)
jni Jan 4, 2025
0adcbe7
Align lines for improved rendering (#2648)
rtobar Jan 4, 2025
df18805
Adds documentation for sharding and sharding in Array.info (#2644)
normanrz Jan 5, 2025
617e2cd
Move deprecation notices to the top of docstrings (#2637)
dstansby Jan 5, 2025
ec014f6
Improve API reference doc structure (#2635)
dstansby Jan 6, 2025
5c6267e
Consistent use of 'Zarr format 2 or 3' (#2645)
normanrz Jan 6, 2025
9138528
Adds filters, compressors and serializer props to Array (#2652)
normanrz Jan 6, 2025
4d252a2
Don't draw invalid shapes in `test_vindex` (#2651)
dstansby Jan 6, 2025
22634ea
Separate defaults for filters, serializers and compressors in v3 (#2653)
normanrz Jan 6, 2025
71f6354
Add moto[server] to test deps for FsspecStore (#2657)
maxrjones Jan 6, 2025
bb8ab0f
chore: update pre-commit hooks (#2660)
pre-commit-ci[bot] Jan 6, 2025
f9c2024
Zstd: Don't persist the checksum param if false (#2655)
normanrz Jan 7, 2025
bc5877b
Feat/concurrent members (#2519)
d-v-b Jan 7, 2025
12f6012
Fix `Group.array()` with `data` argument (#2668)
tomwhite Jan 7, 2025
29ef41d
Make make_store_path private (#2628)
jhamman Jan 8, 2025
8bb0b34
add known bugs to work in progress section of the v3 migration guide …
jhamman Jan 8, 2025
eb25424
Fix json indent (#2546)
will-moore Jan 8, 2025
0c1aad5
fix: threadpool configuration (#2671)
jhamman Jan 8, 2025
bc26199
api: hide zarr.core from api docs (#2669)
jhamman Jan 8, 2025
22ebded
Clean up release notes in preparation for v3 (#2634)
dstansby Jan 8, 2025
0328656
Use dataclasses for ByteRangeRequests (#2585)
maxrjones Jan 9, 2025
e10b69d
doc: add release announcement banner (#2677)
jhamman Jan 9, 2025
99a3576
Fix: order for v2 arrays (#2679)
normanrz Jan 10, 2025
0e1fde4
test: enable codecov in main test action (#2682)
jhamman Jan 10, 2025
6da7976
Merge branch 'main' into object-store-update
maxrjones Jan 10, 2025
26fa37e
Use new ByteRequest syntax
maxrjones Jan 10, 2025
315e22e
Raise not implemented error on pickling
maxrjones Jan 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/gpu_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
cache: 'pip'
- name: Install Hatch and CuPy
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pip
pip install hatch
- name: Set Up Hatch Env
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- name: Install PyBuild
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pip
pip install hatch
- name: Build wheel and sdist
run: hatch build
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
with:
name: releases
path: dist
- uses: pypa/[email protected].2
- uses: pypa/[email protected].3
with:
user: __token__
password: ${{ secrets.pypi_password }}
Expand Down
55 changes: 52 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,20 @@ jobs:
cache: 'pip'
- name: Install Hatch
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pip
pip install hatch
- name: Set Up Hatch Env
run: |
hatch env create test.py${{ matrix.python-version }}-${{ matrix.numpy-version }}-${{ matrix.dependency-set }}
hatch env run -e test.py${{ matrix.python-version }}-${{ matrix.numpy-version }}-${{ matrix.dependency-set }} list-env
- name: Run Tests
run: |
hatch env run --env test.py${{ matrix.python-version }}-${{ matrix.numpy-version }}-${{ matrix.dependency-set }} run
hatch env run --env test.py${{ matrix.python-version }}-${{ matrix.numpy-version }}-${{ matrix.dependency-set }} run-coverage
- name: Upload coverage
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true # optional (default = false)

test-upstream-and-min-deps:
name: py=${{ matrix.python-version }}-${{ matrix.dependency-set }}
Expand All @@ -84,7 +89,7 @@ jobs:
cache: 'pip'
- name: Install Hatch
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pip
pip install hatch
- name: Set Up Hatch Env
run: |
Expand All @@ -93,3 +98,47 @@ jobs:
- name: Run Tests
run: |
hatch env run --env ${{ matrix.dependency-set }} run

doctests:
name: doctests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # required for hatch version discovery, which is needed for numcodecs.zarr3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: 'pip'
- name: Install Hatch
run: |
python -m pip install --upgrade pip
pip install hatch
- name: Set Up Hatch Env
run: |
hatch env create doctest
hatch env run -e doctest list-env
- name: Run Tests
run: |
hatch env run --env doctest run

test-complete:
name: Test complete

needs:
[
test,
test-upstream-and-min-deps,
doctests
]
if: always()
runs-on: ubuntu-latest
steps:
- name: Check failure
if: |
contains(needs.*.result, 'failure') ||
contains(needs.*.result, 'cancelled')
run: exit 1
- name: Success
run: echo Success!
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ coverage.xml

# Sphinx documentation
docs/_build/
docs/_autoapi
docs/api
docs/data
data
data.zip

# PyBuilder
target/
Expand Down
19 changes: 9 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
ci:
autoupdate_commit_msg: "chore: update pre-commit hooks"
autoupdate_schedule: "monthly"
autofix_commit_msg: "style: pre-commit fixes"
autofix_prs: false
default_stages: [pre-commit, pre-push]
default_language_version:
python: python3
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.3
rev: v0.8.6
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand All @@ -16,23 +15,23 @@ repos:
rev: v2.3.0
hooks:
- id: codespell
args: ["-L", "ba,ihs,kake,nd,noe,nwo,te,fo,zar", "-S", "fixture"]
args: ["-L", "fo,ihs,kake,te", "-S", "fixture"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml
- id: check-yaml
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
rev: v1.14.1
hooks:
- id: mypy
files: src|tests
additional_dependencies:
# Package dependencies
- asciitree
- crc32c
- packaging
- donfig
- numcodecs
- numpy
- numcodecs[crc32c]
- numpy==2.1 # until https://github.com/numpy/numpy/issues/28034 is resolved
- typing_extensions
- universal-pathlib
- obstore==0.3.0-beta.8
Expand Down
49 changes: 0 additions & 49 deletions README-v3.md

This file was deleted.

40 changes: 20 additions & 20 deletions bench/compress_normal.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Line # Hits Time Per Hit % Time Line Contents
==============================================================
137 def compress(source, char* cname, int clevel, int shuffle):
138 """Compress data in a numpy array.
139
139
140 Parameters
141 ----------
142 source : array-like
Expand All @@ -30,33 +30,33 @@ Line # Hits Time Per Hit % Time Line Contents
147 Compression level.
148 shuffle : int
149 Shuffle filter.
150
150
151 Returns
152 -------
153 dest : bytes-like
154 Compressed data.
155
155
156 """
157
157
158 cdef:
159 char *source_ptr
160 char *dest_ptr
161 Py_buffer source_buffer
162 size_t nbytes, cbytes, itemsize
163 200 506 2.5 0.2 array.array char_array_template = array.array('b', [])
164 array.array dest
165
165
166 # setup source buffer
167 200 458 2.3 0.2 PyObject_GetBuffer(source, &source_buffer, PyBUF_ANY_CONTIGUOUS)
168 200 119 0.6 0.0 source_ptr = <char *> source_buffer.buf
169
169
170 # setup destination
171 200 239 1.2 0.1 nbytes = source_buffer.len
172 200 103 0.5 0.0 itemsize = source_buffer.itemsize
173 200 2286 11.4 0.8 dest = array.clone(char_array_template, nbytes + BLOSC_MAX_OVERHEAD,
174 zero=False)
175 200 129 0.6 0.0 dest_ptr = <char *> dest.data.as_voidptr
176
176
177 # perform compression
178 200 1734 8.7 0.6 if _get_use_threads():
179 # allow blosc to use threads internally
Expand All @@ -67,24 +67,24 @@ Line # Hits Time Per Hit % Time Line Contents
184 cbytes = blosc_compress(clevel, shuffle, itemsize, nbytes,
185 source_ptr, dest_ptr,
186 nbytes + BLOSC_MAX_OVERHEAD)
187
187
188 else:
189 with nogil:
190 cbytes = blosc_compress_ctx(clevel, shuffle, itemsize, nbytes,
191 source_ptr, dest_ptr,
192 nbytes + BLOSC_MAX_OVERHEAD, cname,
193 0, 1)
194
194
195 # release source buffer
196 200 616 3.1 0.2 PyBuffer_Release(&source_buffer)
197
197
198 # check compression was successful
199 200 120 0.6 0.0 if cbytes <= 0:
200 raise RuntimeError('error during blosc compression: %d' % cbytes)
201
201
202 # resize after compression
203 200 1896 9.5 0.6 array.resize(dest, cbytes)
204
204
205 200 186 0.9 0.1 return dest

*******************************************************************************
Expand All @@ -100,19 +100,19 @@ Line # Hits Time Per Hit % Time Line Contents
==============================================================
75 def decompress(source, dest):
76 """Decompress data.
77
77
78 Parameters
79 ----------
80 source : bytes-like
81 Compressed data, including blosc header.
82 dest : array-like
83 Object to decompress into.
84
84
85 Notes
86 -----
87 Assumes that the size of the destination buffer is correct for the size of
88 the uncompressed data.
89
89
90 """
91 cdef:
92 int ret
Expand All @@ -122,7 +122,7 @@ Line # Hits Time Per Hit % Time Line Contents
96 array.array source_array
97 Py_buffer dest_buffer
98 size_t nbytes
99
99
100 # setup source buffer
101 200 573 2.9 0.2 if PY2 and isinstance(source, array.array):
102 # workaround fact that array.array does not support new-style buffer
Expand All @@ -134,13 +134,13 @@ Line # Hits Time Per Hit % Time Line Contents
108 200 112 0.6 0.0 release_source_buffer = True
109 200 144 0.7 0.1 PyObject_GetBuffer(source, &source_buffer, PyBUF_ANY_CONTIGUOUS)
110 200 98 0.5 0.0 source_ptr = <char *> source_buffer.buf
111
111
112 # setup destination buffer
113 200 552 2.8 0.2 PyObject_GetBuffer(dest, &dest_buffer,
114 PyBUF_ANY_CONTIGUOUS | PyBUF_WRITEABLE)
115 200 100 0.5 0.0 dest_ptr = <char *> dest_buffer.buf
116 200 84 0.4 0.0 nbytes = dest_buffer.len
117
117
118 # perform decompression
119 200 1856 9.3 0.8 if _get_use_threads():
120 # allow blosc to use threads internally
Expand All @@ -149,12 +149,12 @@ Line # Hits Time Per Hit % Time Line Contents
123 else:
124 with nogil:
125 ret = blosc_decompress_ctx(source_ptr, dest_ptr, nbytes, 1)
126
126
127 # release buffers
128 200 754 3.8 0.3 if release_source_buffer:
129 200 326 1.6 0.1 PyBuffer_Release(&source_buffer)
130 200 165 0.8 0.1 PyBuffer_Release(&dest_buffer)
131
131
132 # handle errors
133 200 128 0.6 0.1 if ret <= 0:
134 raise RuntimeError('error during blosc decompression: %d' % ret)
10 changes: 10 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
coverage:
status:
patch:
default:
target: auto
project:
default:
target: auto
threshold: 0.1
comment: false
1 change: 0 additions & 1 deletion data/donotdelete

This file was deleted.

2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ help:
.PHONY: clean
clean:
rm -rf $(BUILDDIR)/*
rm -rf $(BUILDDIR)/../_autoapi
rm -rf $(BUILDDIR)/../api

.PHONY: html
html:
Expand Down
Loading
Loading