Skip to content

Commit

Permalink
Merge pull request #289 from DimitriPapadopoulos/codespell
Browse files Browse the repository at this point in the history
Fix typo: corrispondence → correspondence
  • Loading branch information
FrancescAlted authored Oct 16, 2024
2 parents 65b1d95 + 0e53ec2 commit 2aae7ba
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ci:
autoupdate_commit_msg: "Update pre-commit hooks"
autofix_commit_msg: "Apply pre-commit fixes"
autofix_prs: false
default_stages: [commit, push]
default_stages: [pre-commit, pre-push]
default_language_version:
python: python3
repos:
Expand Down
2 changes: 1 addition & 1 deletion bench/lazyarray-expr-small-dask.ipynb

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions examples/btune.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
contiguous = True
urlpath = "filename"

storage = blosc2.Storage(contiguous=contiguous, urlpath=urlpath, mode='a')
storage = blosc2.Storage(contiguous=contiguous, urlpath=urlpath, mode="a")
blosc2.remove_urlpath(urlpath)

# Set the Btune configuration to use
Expand All @@ -32,7 +32,9 @@

# Create the SChunk
data = np.arange(200 * 1000 * nchunks)
schunk = blosc2.SChunk(chunksize=200 * 1000 * 4, data=data, cparams=cparams, dparams=dparams, storage=storage)
schunk = blosc2.SChunk(
chunksize=200 * 1000 * 4, data=data, cparams=cparams, dparams=dparams, storage=storage
)

# Check data can be retrieved correctly
data2 = np.empty(data.shape, dtype=data.dtype)
Expand Down
4 changes: 3 additions & 1 deletion examples/pack_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

a = np.arange(1_000_000)

cparams = blosc2.CParams(codec=blosc2.Codec.ZSTD, clevel=9, filters=[blosc2.Filter.BITSHUFFLE], filters_meta=[0])
cparams = blosc2.CParams(
codec=blosc2.Codec.ZSTD, clevel=9, filters=[blosc2.Filter.BITSHUFFLE], filters_meta=[0]
)
cframe = blosc2.pack_tensor(a, cparams=cparams)
print("Length of packed array in bytes:", len(cframe))

Expand Down
6 changes: 4 additions & 2 deletions examples/postfilter1.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
dparams = blosc2.DParams(nthreads=1)
contiguous = True
urlpath = None
storage = blosc2.Storage(contiguous=contiguous, urlpath=urlpath, mode='a')
storage = blosc2.Storage(contiguous=contiguous, urlpath=urlpath, mode="a")
# Remove previous SChunk
blosc2.remove_urlpath(urlpath)
# Create and set data
data = np.arange(200 * 1000 * nchunks, dtype=input_dtype)
schunk = blosc2.SChunk(chunksize=200 * 1000 * input_dtype.itemsize, data=data, cparams=cparams, dparams=dparams, storage=storage)
schunk = blosc2.SChunk(
chunksize=200 * 1000 * input_dtype.itemsize, data=data, cparams=cparams, dparams=dparams, storage=storage
)

out1 = np.empty(200 * 1000 * nchunks, dtype=input_dtype)
schunk.get_slice(0, 200 * 1000 * nchunks, out=out1)
Expand Down
6 changes: 4 additions & 2 deletions examples/postfilter2.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@
dparams = blosc2.DParams(nthreads=1)
contiguous = True
urlpath = "filename"
storage = blosc2.Storage(contiguous=contiguous, urlpath=urlpath, mode='a')
storage = blosc2.Storage(contiguous=contiguous, urlpath=urlpath, mode="a")
# Remove previous SChunk
blosc2.remove_urlpath(urlpath)
# Create and set data
chunkshape = 200 * 1000
data = np.arange(0, chunkshape * nchunks, dtype=input_dtype)
schunk = blosc2.SChunk(chunksize=chunkshape * input_dtype.itemsize, data=data, cparams=cparams, dparams=dparams, storage=storage)
schunk = blosc2.SChunk(
chunksize=chunkshape * input_dtype.itemsize, data=data, cparams=cparams, dparams=dparams, storage=storage
)

out1 = np.empty(chunkshape * nchunks, dtype=input_dtype)
schunk.get_slice(0, chunkshape * nchunks, out=out1)
Expand Down
6 changes: 4 additions & 2 deletions examples/postfilter3.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
dparams = blosc2.DParams(nthreads=1)
contiguous = False
urlpath = None
storage = blosc2.Storage(contiguous=contiguous, urlpath=urlpath, mode='a')
storage = blosc2.Storage(contiguous=contiguous, urlpath=urlpath, mode="a")
# Remove previous SChunk
blosc2.remove_urlpath(urlpath)
# Create and set data
chunkshape = 20_000
data = np.zeros(chunkshape * nchunks, dtype=input_dtype)
schunk = blosc2.SChunk(chunksize=chunkshape * input_dtype.itemsize, data=data, cparams=cparams, dparams=dparams, storage=storage)
schunk = blosc2.SChunk(
chunksize=chunkshape * input_dtype.itemsize, data=data, cparams=cparams, dparams=dparams, storage=storage
)

out1 = np.empty(chunkshape * nchunks, dtype=input_dtype)
schunk.get_slice(0, chunkshape * nchunks, out=out1)
Expand Down
6 changes: 4 additions & 2 deletions examples/prefilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
# Set the compression and decompression parameters
cparams = blosc2.CParams(typesize=4, nthreads=1)
dparams = blosc2.DParams(nthreads=4)
storage = blosc2.Storage(mode='a')
storage = blosc2.Storage(mode="a")
# Create empty schunk
schunk = blosc2.SChunk(chunksize=200 * 1000 * input_dtype.itemsize, cparams=cparams, dparams=dparams, storage=storage)
schunk = blosc2.SChunk(
chunksize=200 * 1000 * input_dtype.itemsize, cparams=cparams, dparams=dparams, storage=storage
)


# Set prefilter with decorator
Expand Down
2 changes: 1 addition & 1 deletion examples/schunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
contiguous = True
urlpath = "filename"

storage = blosc2.Storage(contiguous=contiguous, urlpath=urlpath, mode='a')
storage = blosc2.Storage(contiguous=contiguous, urlpath=urlpath, mode="a")
blosc2.remove_urlpath(urlpath)
numpy_meta = {b"dtype": str(np.dtype("int32"))}
test_meta = {b"lorem": 1234}
Expand Down
1 change: 0 additions & 1 deletion src/blosc2/schunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import blosc2
from blosc2 import SpecialValue, blosc2_ext
from blosc2.helpers import _inherit_doc_parameter


class vlmeta(MutableMapping, blosc2_ext.vlmeta):
Expand Down
1 change: 0 additions & 1 deletion tests/ndarray/test_proxy_expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def get_arrays(shape, chunks_blocks):
assert isinstance(a3, blosc2.NDArray)
assert isinstance(a4, blosc2.NDArray)


p1 = blosc2.Proxy(a1, urlpath="p1.b2nd", mode="w")
p3 = blosc2.Proxy(a3, urlpath="p3.b2nd", mode="w")
cleanup_paths.extend(["p1.b2nd", "p3.b2nd"])
Expand Down
1 change: 1 addition & 0 deletions tests/test_proxy_schunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import numpy as np
import pytest

import blosc2


Expand Down

0 comments on commit 2aae7ba

Please sign in to comment.