Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Change Log
- A new code example, `chunk`, shows how to perform (de)compression in chunks.
- A new utility function `zfp_block_maximum_size()` returns maximum block size
for given scalar type, dimensionality, and compression mode.
- `zfpy.__version__` for straightfoward access to the zfp version string in Python.

### Fixed

Expand Down
1 change: 1 addition & 0 deletions python/zfpy.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ cdef extern from "zfp/bitstream.h":
void stream_close(bitstream* stream)

cdef extern from "zfp.h":
cython.char * ZFP_VERSION_STRING
# enums
ctypedef enum zfp_type:
zfp_type_none = 0,
Expand Down
2 changes: 2 additions & 0 deletions python/zfpy.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ mode_fixed_rate = zfp_mode_fixed_rate
mode_fixed_precision = zfp_mode_fixed_precision
mode_fixed_accuracy = zfp_mode_fixed_accuracy

__version__ = str(ZFP_VERSION_STRING, encoding='utf-8')


cpdef dtype_to_ztype(dtype):
if dtype == np.int32:
Expand Down
5 changes: 5 additions & 0 deletions tests/python/test_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
except ImportError:
version_parse = None

def test_zfpy_version():
# Just ensure that the version contains 3 numbers separated by dots
assert len(zfpy.__version__.split('.')) == 3
# Ensure it is a string, not bytes
assert isinstance(zfpy.__version__, str)

class TestNumpy(unittest.TestCase):
def lossless_round_trip(self, orig_array):
Expand Down