Skip to content

Commit

Permalink
add n5py complex tests
Browse files Browse the repository at this point in the history
  • Loading branch information
calgray committed Oct 28, 2024
1 parent 12f4d0d commit c04d211
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
6 changes: 4 additions & 2 deletions include/z5/types/types.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,16 @@ namespace types {
static DtypeMap & n5ToDtype() {
static DtypeMap dtypeMap({{{"int8", int8}, {"int16", int16}, {"int32", int32}, {"int64", int64},
{"uint8", uint8}, {"uint16", uint16}, {"uint32", uint32}, {"uint64", uint64},
{"float32", float32}, {"float64", float64}}});
{"float32", float32}, {"float64", float64},
{"complex64", complex64}, {"complex128", complex128}, {"complex256", complex256}}});
return dtypeMap;
}

static InverseDtypeMap & dtypeToN5() {
static InverseDtypeMap dtypeMap({{{int8 ,"int8"}, {int16, "int16"}, {int32, "int32"}, {int64, "int64"},
{uint8 ,"uint8"}, {uint16, "uint16"}, {uint32,"uint32"}, {uint64, "uint64"},
{float32,"float32"}, {float64, "float64"}}});
{float32,"float32"}, {float64, "float64"},
{complex64,"complex64"}, {complex128, "complex128"}, {complex256, "complex256"}}});
return dtypeMap;
}
};
Expand Down
5 changes: 4 additions & 1 deletion src/python/module/z5py/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ class Dataset:
np.dtype('int32'): 'int32',
np.dtype('int64'): 'int64',
np.dtype('float32'): 'float32',
np.dtype('float64'): 'float64'}
np.dtype('float64'): 'float64',
np.dtype('complex64'): 'complex64',
np.dtype('complex128'): 'complex128',
np.dtype('complex256'): 'complex256'}

# Compression libraries supported by zarr format
compressors_zarr = tuple(comp for comp in COMPRESSORS_ZARR if AVAILABLE_COMPRESSORS[comp])
Expand Down
3 changes: 2 additions & 1 deletion src/python/test/test_compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ def setUp(self):
self.dtypes = [
'int8', 'int16', 'int32', 'int64',
'uint8', 'uint16', 'uint32', 'uint64',
'float32', 'float64'
'float32', 'float64', # 'float128',
'complex64', 'complex128', # 'complex256',
]

def tearDown(self):
Expand Down
9 changes: 6 additions & 3 deletions src/python/test/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,23 @@ def setUp(self):
self.base_dtypes = [
'int8', 'int16', 'int32', 'int64',
'uint8', 'uint16', 'uint32', 'uint64',
'float32', 'float64'
'float32', 'float64', # 'float128',
'complex64', 'complex128', # 'complex256',
]
self.dtypes = tuple(
self.base_dtypes +
[np.dtype(s) for s in self.base_dtypes] +
[
'<i1', '<i2', '<i4', '<i8',
'<u1', '<u2', '<u4', '<u8',
'<f4', '<f8'
'<f4', '<f8', # '<f16',
'<c8', '<c16', # '<c32',
] +
[
np.int8, np.int16, np.int32, np.int64,
np.uint8, np.uint16, np.uint32, np.uint64,
np.float32, np.float64
np.float32, np.float64, # np.complex128,
np.complex64, np.complex128, # np.complex256,
]
)

Expand Down

0 comments on commit c04d211

Please sign in to comment.