Skip to content

Commit

Permalink
Remove experimental codecs
Browse files Browse the repository at this point in the history
  • Loading branch information
milesgranger committed Jan 1, 2025
1 parent fef3a9d commit 622e10b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ name = "cramjam"
crate-type = ["cdylib"]

[features]
default = ["extension-module", "snappy", "lz4", "bzip2", "brotli", "xz", "zstd", "gzip", "zlib", "deflate", "blosc2", "igzip", "ideflate", "izlib"]
default = ["extension-module", "snappy", "lz4", "bzip2", "brotli", "xz", "zstd", "gzip", "zlib", "deflate"]
experimental = ["blosc2", "igzip", "ideflate", "izlib"]

extension-module = ["pyo3/extension-module"]
generate-import-lib = ["pyo3/generate-import-lib"] # needed for Windows PyPy builds

Expand Down
9 changes: 6 additions & 3 deletions tests/test_blosc2.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
except ImportError:
pytest.skip("experimental module not built", allow_module_level=True)
else:
blosc2 = experimental.blosc2
if hasattr(experimental, "blosc2"):
blosc2 = experimental.blosc2


settings.register_profile("local", max_examples=10)
Expand All @@ -25,7 +26,7 @@
def variants(e):
for attr in dir(e):
# TODO: LastCodec, LastFilter, LastRegisteredCodec/Filter not supported
if not attr.startswith('_') and not attr.lower().startswith('last'):
if not attr.startswith("_") and not attr.lower().startswith("last"):
yield getattr(e, attr)


Expand All @@ -47,7 +48,9 @@ def test_roundtrip_chunk_into(data, codec, filter, clevel):
kwargs = dict(clevel=clevel, filter=filter, codec=codec)
nbytes_compressed = len(blosc2.compress_chunk(data, **kwargs))

compressed = np.empty(blosc2.max_compressed_len(len(data.tobytes())), dtype=np.uint8)
compressed = np.empty(
blosc2.max_compressed_len(len(data.tobytes())), dtype=np.uint8
)
nbytes = blosc2.compress_chunk_into(data, compressed, **kwargs)

decompressed = np.empty(len(data.tobytes()) * 2, dtype=np.uint8)
Expand Down

0 comments on commit 622e10b

Please sign in to comment.