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
2 changes: 1 addition & 1 deletion .ci/debian10_py2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN chmod 644 /etc/apt/trusted.gpg.d/debian-hdri-repo.gpg
RUN add-apt-repository "deb http://repos.pni-hdri.de/apt/debian buster main" -y
RUN apt-get -qq update && apt-get -qq -y dist-upgrade
RUN apt-get -qq update && apt-get -qq install -y python-sphinx apt-utils net-tools
RUN apt-get -qq install -y libpninexus2.0.0-dev libpninexus2.0.0 libh5cpp0.4.1-dev libh5cpp0.4.1 python-numpy libhdf5-dev libboost-regex-dev libboost-program-options-dev libboost-system-dev libboost-date-time-dev libboost-filesystem-dev libblas-dev libatlas-base-dev cython python-setuptools libboost-python-dev python-numpy-abi9 g++ python-h5py hdf5-plugin-bshuf hdf5-plugin-bz2 hdf5-plugin-lz4
RUN apt-get -qq install -y libpninexus2.0.0-dev libpninexus2.0.0 libh5cpp0.4.1-dev libh5cpp0.4.1 python-numpy libhdf5-dev libboost-regex-dev libboost-program-options-dev libboost-system-dev libboost-date-time-dev libboost-filesystem-dev libblas-dev libatlas-base-dev cython python-setuptools libboost-python-dev python-numpy-abi9 g++ python-h5py hdf5-plugin-bshuf hdf5-plugin-bz2 hdf5-plugin-lz4 python-pytest
RUN useradd -ms /bin/bash tango
RUN apt-get -qq install -y adduser

Expand Down
2 changes: 1 addition & 1 deletion .ci/debian10_py3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN chmod 644 /etc/apt/trusted.gpg.d/debian-hdri-repo.gpg
RUN add-apt-repository "deb http://repos.pni-hdri.de/apt/debian buster main" -y
RUN apt-get -qq update && apt-get -qq -y dist-upgrade
RUN apt-get -qq update && apt-get -qq install -y python3-sphinx apt-utils net-tools
RUN apt-get -qq install -y libpninexus2.0.0-dev libpninexus2.0.0 libh5cpp0.4.1-dev libh5cpp0.4.1 python3-numpy libhdf5-dev libboost-regex-dev libboost-program-options-dev libboost-system-dev libboost-date-time-dev libboost-filesystem-dev libblas-dev libatlas-base-dev cython3 python3-setuptools libboost-python-dev python3-numpy-abi9 g++ python3-h5py hdf5-plugin-bshuf hdf5-plugin-bz2 hdf5-plugin-lz4
RUN apt-get -qq install -y libpninexus2.0.0-dev libpninexus2.0.0 libh5cpp0.4.1-dev libh5cpp0.4.1 python3-numpy libhdf5-dev libboost-regex-dev libboost-program-options-dev libboost-system-dev libboost-date-time-dev libboost-filesystem-dev libblas-dev libatlas-base-dev cython3 python3-setuptools libboost-python-dev python3-numpy-abi9 g++ python3-h5py hdf5-plugin-bshuf hdf5-plugin-bz2 hdf5-plugin-lz4 python3-pytest
RUN useradd -ms /bin/bash tango
RUN apt-get -qq install -y adduser
RUN /bin/bash -c 'sleep 10'
Expand Down
2 changes: 1 addition & 1 deletion .ci/debian11_py3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN chmod 644 /etc/apt/trusted.gpg.d/debian-hdri-repo.gpg
RUN add-apt-repository "deb http://repos.pni-hdri.de/apt/debian bullseye main" -y
# RUN apt-get -qq update && apt-get -qq -y dist-upgrade
RUN apt-get -qq update && apt-get -qq install -y python3-sphinx apt-utils net-tools
RUN apt-get install -y libpninexus2.0.0-dev libpninexus2.0.0 libh5cpp0.4.1-dev libh5cpp0.4.1 python3-numpy libhdf5-dev libboost-regex-dev libboost-program-options-dev libboost-system-dev libboost-date-time-dev libboost-filesystem-dev libblas-dev libatlas-base-dev cython3 python3-setuptools libboost-python-dev python3-numpy-abi9 g++ python3-h5py hdf5-plugin-bshuf hdf5-plugin-bz2 hdf5-plugin-lz4 git
RUN apt-get install -y libpninexus2.0.0-dev libpninexus2.0.0 libh5cpp0.4.1-dev libh5cpp0.4.1 python3-numpy libhdf5-dev libboost-regex-dev libboost-program-options-dev libboost-system-dev libboost-date-time-dev libboost-filesystem-dev libblas-dev libatlas-base-dev cython3 python3-setuptools libboost-python-dev python3-numpy-abi9 g++ python3-h5py hdf5-plugin-bshuf hdf5-plugin-bz2 hdf5-plugin-lz4 git python3-pytest
RUN useradd -ms /bin/bash tango
RUN apt-get -qq install -y adduser
RUN /bin/bash -c 'sleep 10'
Expand Down
3 changes: 3 additions & 0 deletions .ci/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ else
docker exec ndts python3 setup.py build_sphinx
fi
if [ "$?" != "0" ]; then exit 255; fi

docker exec --user root ndts rm -rf src/pninexus.egg-info
if [ "$?" != "0" ]; then exit 255; fi
11 changes: 5 additions & 6 deletions .ci/run.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#!/usr/bin/env bash

if [ "$1" = "2" ]; then
echo "run python-pninexus"
docker exec --user root ndts python setup.py test
# docker exec -it ndts python setup.py test
echo "run python-pninexus tests"
# docker exec ndts python setup.py test
docker exec ndts python -m pytest test
else
echo "run python3-pninexus"
docker exec --user root ndts python3 setup.py test
# docker exec -it ndts python3 setup.py test
echo "run python3-pninexus tests"
docker exec ndts python3 -m pytest test
fi
if [ "$?" != "0" ]; then exit 255; fi
2 changes: 1 addition & 1 deletion .ci/ubuntu20.04_py3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN add-apt-repository "deb http://repos.pni-hdri.de/apt/debian focal main" -y
RUN apt-get -qq update && export DEBIAN_FRONTEND=noninteractive && apt-get -qq dist-upgrade
RUN apt-get -qq update && export DEBIAN_FRONTEND=noninteractive && apt-get -qq install -y python3-sphinx apt-utils net-tools
RUN apt-get -qq install -y libpninexus2.0.0-dev libpninexus2.0.0 libh5cpp0.4.1-dev libh5cpp0.4.1 python3-numpy libhdf5-dev libboost-regex-dev libboost-program-options-dev libboost-system-dev libboost-date-time-dev libboost-filesystem-dev libblas-dev libatlas-base-dev cython3 python3-setuptools libboost-python-dev python3-numpy-abi9 g++ python3-h5py
RUN apt-get -qq install -y hdf5-plugin-bshuf hdf5-plugin-bz2 hdf5-plugin-lz4
RUN apt-get -qq install -y hdf5-plugin-bshuf hdf5-plugin-bz2 hdf5-plugin-lz4 python3-pytest
RUN useradd -ms /bin/bash tango

ENV PKG_CONFIG_PATH=/home/tango/lib/pkgconfig
Expand Down
2 changes: 1 addition & 1 deletion .ci/ubuntu21.10_py3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN add-apt-repository "deb http://repos.pni-hdri.de/apt/debian impish main" -y
RUN apt-get -qq update && export DEBIAN_FRONTEND=noninteractive && apt-get -qq dist-upgrade
RUN apt-get -qq update && export DEBIAN_FRONTEND=noninteractive && apt-get -qq install -y python3-sphinx apt-utils net-tools
RUN apt-get -qq install -y libpninexus2.0.0-dev libpninexus2.0.0 libh5cpp0.4.1-dev libh5cpp0.4.1 python3-numpy libhdf5-dev libboost-regex-dev libboost-program-options-dev libboost-system-dev libboost-date-time-dev libboost-filesystem-dev libblas-dev libatlas-base-dev cython3 python3-setuptools libboost-python-dev python3-numpy-abi9 g++ python3-h5py
RUN apt-get -qq install -y hdf5-plugin-bshuf hdf5-plugin-bz2 hdf5-plugin-lz4
RUN apt-get -qq install -y hdf5-plugin-bshuf hdf5-plugin-bz2 hdf5-plugin-lz4 python3-pytest
RUN useradd -ms /bin/bash tango

ENV PKG_CONFIG_PATH=/home/tango/lib/pkgconfig
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# release = "2.0.0"
release = "2.0"


if release.count(".") == 1:
docs_release = '(latest)'
else:
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/h5cpp/node/dataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ boost::python::object dataset_read(const hdf5::node::Dataset &self,
hdf5::datatype::String string_type = self.datatype();
if(!string_type.is_variable_length())
{
std::cout<<"Saving fixed length string array!"<<std::endl;
// std::cout<<"Saving fixed length string array!"<<std::endl;
PyObject *ptr = reinterpret_cast<PyObject*>(static_cast<PyArrayObject*>(array_adapter));
Py_XINCREF(ptr);

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 5 additions & 6 deletions test/h5cpp_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from .file_creation import *
from .file_image import *
from .file_open import *
from .node_tests import *
from .file_creation_test import *
from .file_image_test import *
from .file_open_test import *
from .property_tests import *
from .group_tests import *
from .datatype_tests import *
from .attribute_tests import *
from .node_tests import *
from .filter_tests import *
from .dataspace_tests import *
from .path_tests import *
# from .group_construction import *
from .path_test import *
4 changes: 2 additions & 2 deletions test/h5cpp_tests/attribute_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from .attribute_creation_tests import *
from .attribute_io_tests import *
from .attribute_creation_test import *
from .attribute_io_test import *
4 changes: 2 additions & 2 deletions test/h5cpp_tests/dataspace_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from .scalar_dataspace import *
from .simple_dataspace import *
from .scalar_dataspace_test import *
from .simple_dataspace_test import *
2 changes: 1 addition & 1 deletion test/h5cpp_tests/datatype_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .predefined_type_tests import *
from .predefined_type_test import *
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ class PredefinedTypeTests(unittest.TestCase):

def testUInt8(self):

dtype = h5cpp.datatype.kUInt8
dtype = h5cpp.datatype.Integer(h5cpp.datatype.kUInt8)
self.assertTrue(isinstance(dtype, self.int_types))
self.assertEqual(dtype.size, 1)
self.assertEqual(dtype.is_signed(), False)

dtype.make_signed(True)
self.assertEqual(dtype.is_signed(), True)
dtype.make_signed(False)
self.assertEqual(dtype.is_signed(), False)

self.assertEqual(dtype.precision, 8)
dtype.precision = 16
Expand Down Expand Up @@ -79,12 +81,14 @@ def testUInt8(self):

def testInt8(self):

dtype = h5cpp.datatype.kInt8
dtype = h5cpp.datatype.Integer(h5cpp.datatype.kInt8)
self.assertTrue(isinstance(dtype, self.int_types))
self.assertEqual(dtype.is_signed(), True)

dtype.make_signed(False)
self.assertEqual(dtype.is_signed(), False)
dtype.make_signed(True)
self.assertEqual(dtype.is_signed(), True)

self.assertEqual(dtype.precision, 8)
dtype.precision = 16
Expand Down Expand Up @@ -120,7 +124,7 @@ def testInt8(self):

def testUInt16(self):

dtype = h5cpp.datatype.kUInt16
dtype = h5cpp.datatype.Integer(h5cpp.datatype.kUInt16)
self.assertTrue(isinstance(dtype, self.int_types))
self.assertEqual(dtype.size, 2)
self.assertEqual(dtype.is_signed(), False)
Expand Down Expand Up @@ -162,7 +166,7 @@ def testUInt16(self):

def testInt16(self):

dtype = h5cpp.datatype.kInt16
dtype = h5cpp.datatype.Integer(h5cpp.datatype.kInt16)
self.assertTrue(isinstance(dtype, self.int_types))
self.assertEqual(dtype.size, 2)
self.assertEqual(dtype.is_signed(), True)
Expand Down Expand Up @@ -204,7 +208,7 @@ def testInt16(self):

def testUInt32(self):

dtype = h5cpp.datatype.kUInt32
dtype = h5cpp.datatype.Integer(h5cpp.datatype.kUInt32)
self.assertTrue(isinstance(dtype, self.int_types))
self.assertEqual(dtype.size, 4)
self.assertEqual(dtype.is_signed(), False)
Expand Down Expand Up @@ -246,7 +250,7 @@ def testUInt32(self):

def testInt32(self):

dtype = h5cpp.datatype.kInt32
dtype = h5cpp.datatype.Integer(h5cpp.datatype.kInt32)
self.assertTrue(isinstance(dtype, self.int_types))
self.assertEqual(dtype.size, 4)
self.assertEqual(dtype.is_signed(), True)
Expand Down Expand Up @@ -288,7 +292,7 @@ def testInt32(self):

def testUInt64(self):

dtype = h5cpp.datatype.kUInt64
dtype = h5cpp.datatype.Integer(h5cpp.datatype.kUInt64)
self.assertTrue(isinstance(dtype, self.int_types))
self.assertEqual(dtype.size, 8)
self.assertEqual(dtype.is_signed(), False)
Expand Down Expand Up @@ -330,7 +334,7 @@ def testUInt64(self):

def testInt64(self):

dtype = h5cpp.datatype.kInt64
dtype = h5cpp.datatype.Integer(h5cpp.datatype.kInt64)
self.assertTrue(isinstance(dtype, self.int_types))
self.assertEqual(dtype.size, 8)
self.assertEqual(dtype.is_signed(), True)
Expand Down Expand Up @@ -372,7 +376,7 @@ def testInt64(self):

def testFloat32(self):

dtype = h5cpp.datatype.kFloat32
dtype = h5cpp.datatype.Float(h5cpp.datatype.kFloat32)
self.assertTrue(isinstance(dtype, self.float_types))
self.assertEqual(dtype.size, 4)

Expand Down Expand Up @@ -451,7 +455,7 @@ def testFloat32(self):

def testFloat64(self):

dtype = h5cpp.datatype.kFloat64
dtype = h5cpp.datatype.Float(h5cpp.datatype.kFloat64)
self.assertTrue(isinstance(dtype, self.float_types))
self.assertEqual(dtype.size, 8)

Expand Down Expand Up @@ -527,7 +531,7 @@ def testFloat64(self):

def testFloat128(self):

dtype = h5cpp.datatype.kFloat128
dtype = h5cpp.datatype.Float(h5cpp.datatype.kFloat128)
self.assertTrue(isinstance(dtype, self.float_types))
self.assertTrue(dtype.size in [8, 12, 16])

Expand Down Expand Up @@ -603,20 +607,20 @@ def testFloat128(self):

def testVariableString(self):

dtype = h5cpp.datatype.kVariableString
dtype = h5cpp.datatype.String(h5cpp.datatype.kVariableString)
self.assertTrue(isinstance(dtype, self.string_types))
self.assertTrue(dtype.is_variable_length)

def testEBool(self):

dtype = h5cpp.datatype.kEBool
dtype = h5cpp.datatype.Enum(h5cpp.datatype.kEBool)
self.assertTrue(isinstance(dtype, self.enum_types))
self.assertTrue(h5cpp._datatype.is_bool(dtype))
self.assertEqual(dtype.size, 1)

def testFloat16(self):

dtype = h5cpp.datatype.kFloat16
dtype = h5cpp.datatype.Float(h5cpp.datatype.kFloat16)
self.assertTrue(isinstance(dtype, self.float_types))

self.assertEqual(dtype.size, 2)
Expand Down Expand Up @@ -692,7 +696,7 @@ def testFloat16(self):

def testComplex32(self):

dtype = h5cpp.datatype.kComplex32
dtype = h5cpp.datatype.Compound(h5cpp.datatype.kComplex32)
self.assertTrue(isinstance(dtype, self.float_types))
self.assertEqual(dtype.size, 4)
self.assertEqual(dtype.number_of_fields, 2)
Expand Down Expand Up @@ -753,7 +757,7 @@ def testComplex32(self):

def testComplex64(self):

dtype = h5cpp.datatype.kComplex64
dtype = h5cpp.datatype.Compound(h5cpp.datatype.kComplex64)
self.assertTrue(isinstance(dtype, self.float_types))
self.assertEqual(dtype.size, 8)
self.assertEqual(dtype.number_of_fields, 2)
Expand Down Expand Up @@ -814,7 +818,7 @@ def testComplex64(self):

def testComplex128(self):

dtype = h5cpp.datatype.kComplex128
dtype = h5cpp.datatype.Compound(h5cpp.datatype.kComplex128)
self.assertTrue(isinstance(dtype, self.float_types))
self.assertEqual(dtype.size, 16)
self.assertEqual(dtype.number_of_fields, 2)
Expand Down Expand Up @@ -875,7 +879,7 @@ def testComplex128(self):

def testComplex256(self):

dtype = h5cpp.datatype.kComplex256
dtype = h5cpp.datatype.Compound(h5cpp.datatype.kComplex256)
self.assertTrue(isinstance(dtype, self.float_types))
self.assertEqual(dtype.size, 32)
self.assertEqual(dtype.number_of_fields, 2)
Expand Down
File renamed without changes.
File renamed without changes.
16 changes: 9 additions & 7 deletions test/h5cpp_tests/filter_tests/creation_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,17 @@ def testSZip(self):

def testScaleOffset(self):

filter = ScaleOffset(SOScaleType.INT, 2)
filter(self.dcpl)
sfilter = ScaleOffset(SOScaleType.INT, 2)
sfilter(self.dcpl)
hdf5.node.Dataset(self.root, hdf5.Path("ScaleOffset"),
self.datatype,
self.dataspace,
self.lcpl,
self.dcpl)
self.assertEqual(self.dcpl.nfilters, 1)
self.assertTrue(filter.is_encoding_enabled())
self.assertTrue(filter.is_decoding_enabled())
self.assertEqual(filter.id, 6)
self.assertTrue(sfilter.is_encoding_enabled())
self.assertTrue(sfilter.is_decoding_enabled())
self.assertEqual(sfilter.id, 6)
filters = ExternalFilters()
self.assertEqual(len(filters), 0)
flags = filters.fill(self.dcpl)
Expand Down Expand Up @@ -237,7 +237,8 @@ def testExternalFilter2(self):
except RuntimeError:
error = True
if not error:
print("filter with 32008 id created")
pass
# print("filter with 32008 id created")
# for newer versions of hdf5 you can constuct the object
# on nonexisting filter
# self.assertTrue(error)
Expand All @@ -261,7 +262,8 @@ def testNonExistingExternalFilter(self):
except RuntimeError:
error = True
if not error:
print("filter with 31999 id created")
pass
# print("filter with 31999 id created")
# for newer versions of hdf5 you can constuct the object
# on nonexisting filter
# self.assertTrue(error)
Expand Down
2 changes: 1 addition & 1 deletion test/h5cpp_tests/group_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .group_construction import *
from .group_construction_test import *
8 changes: 4 additions & 4 deletions test/h5cpp_tests/node_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from .dataset_io_test import *
from .dataset_partial_io_test import *
from .copy_test import *
from .dataset_direct_chunk_test import *
from .group_creation_tests import *
from .dataset_extent_test import *
from .dataset_io_test import *
from .dataset_partial_io_test import *
from .group_creation_test import *
from .h5py_compat_test import *
from .copy_tests import *
from .link_iteration_test import *
from .node_iterator_test import *
from .virtual_dataset_test import *
7 changes: 4 additions & 3 deletions test/h5cpp_tests/node_tests/virtual_dataset_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

if VDSAvailable:

class DatasetPartialIOTests(unittest.TestCase):
class VDSDatasetPartialIOTests(unittest.TestCase):

filename = os.path.join(module_path, "VirtualDatasetTests.h5")
filename2 = os.path.join(module_path, "VirtualDatasetTests_inter.h5")
Expand All @@ -62,7 +62,7 @@ class DatasetPartialIOTests(unittest.TestCase):

@classmethod
def setUpClass(cls):
super(DatasetPartialIOTests, cls).setUpClass()
super(VDSDatasetPartialIOTests, cls).setUpClass()

h5cpp.file.create(cls.filename, AccessFlags.TRUNCATE)
h5cpp.file.create(cls.filename2, AccessFlags.TRUNCATE)
Expand Down Expand Up @@ -268,9 +268,10 @@ def testInterleaving(self):
self.assertEqual(dataset.dataspace.size, 90)

allmod = dataset.read()
print(allmod)

refdata = numpy.array([1, 2, 3])
for offset in range(0, kmodulesize * 3, 3):
selection = Hyperslab(offset=(0,), block=(3,))
mod1 = dataset.read(selection=selection)
npt.assert_array_equal(mod1, refdata)
npt.assert_array_equal(mod1, allmod[offset: (offset + 3)])
File renamed without changes.
8 changes: 4 additions & 4 deletions test/h5cpp_tests/property_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .object_copy_list import *
from .copy_flags import *
from .chunk_cache_parameters import *
from .creation_order import *
from .object_copy_list_test import *
from .copy_flags_test import *
from .chunk_cache_parameters_test import *
from .creation_order_test import *
Loading