Skip to content

Commit

Permalink
As per discussion #337, the default of cparams.splitmode is now AUTO_…
Browse files Browse the repository at this point in the history
…SPLIT. See #338 though.
  • Loading branch information
FrancescAlted committed Nov 29, 2024
1 parent 08699bb commit 88d76e9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/blosc2/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class CParams:
blosc2 will choose the size automatically.
splitmode: :class:`SplitMode`
The split mode for the blocks.
The default value is :py:obj:`SplitMode.ALWAYS_SPLIT <SplitMode>`.
The default value is :py:obj:`SplitMode.AUTO_SPLIT <SplitMode>`.
filters: :class:`Filter` or int list
The sequence of filters. Default: [:py:obj:`Filter.NOFILTER <Filter>`,
:py:obj:`Filter.NOFILTER <Filter>`, :py:obj:`Filter.NOFILTER <Filter>`, :py:obj:`Filter.NOFILTER <Filter>`,
Expand All @@ -77,7 +77,7 @@ class CParams:
typesize: int = 8
nthreads: int = field(default_factory=default_nthreads)
blocksize: int = 0
splitmode: blosc2.SplitMode = blosc2.SplitMode.ALWAYS_SPLIT
splitmode: blosc2.SplitMode = blosc2.SplitMode.AUTO_SPLIT
filters: list[blosc2.Filter | int] = field(default_factory=default_filters)
filters_meta: list[int] = field(default_factory=default_filters_meta)
tuner: blosc2.Tuner = blosc2.Tuner.STUNE
Expand Down
6 changes: 4 additions & 2 deletions tests/ndarray/test_lossy.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
False,
),
(
# For some reason, ZFP needs to always split buffers in this test
(100, 1230),
np.float64,
{"codec": blosc2.Codec.ZFP_ACC, "codec_meta": 37},
{"codec": blosc2.Codec.ZFP_ACC, "codec_meta": 37, "splitmode": blosc2.SplitMode.ALWAYS_SPLIT},
None,
False,
),
Expand All @@ -39,9 +40,10 @@
True,
),
(
# For some reason, ZFP needs to always split buffers in this test
(80, 51, 60),
np.float32,
{"codec": blosc2.Codec.ZFP_RATE, "codec_meta": 37},
{"codec": blosc2.Codec.ZFP_RATE, "codec_meta": 37, "splitmode": blosc2.SplitMode.ALWAYS_SPLIT},
"lossy.b2nd",
False,
),
Expand Down
2 changes: 1 addition & 1 deletion tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def test_cparams_defaults():
cparams = blosc2.CParams()
assert cparams.codec == blosc2.Codec.ZSTD
assert cparams.codec_meta == 0
assert cparams.splitmode == blosc2.SplitMode.ALWAYS_SPLIT
assert cparams.splitmode == blosc2.SplitMode.AUTO_SPLIT
assert cparams.clevel == 1
assert cparams.typesize == 8
assert cparams.nthreads == blosc2.nthreads
Expand Down

0 comments on commit 88d76e9

Please sign in to comment.