Skip to content
Snippets Groups Projects

Improved the handling of numpy scalars in cfoods.h5.h5_attr_to_property

Merged Alexander Kreft requested to merge improving-h5-scalar-attribute-handling into dev
1 file
+ 4
1
Compare changes
  • Side-by-side
  • Inline
+ 4
1
@@ -181,4 +181,7 @@ class H5CFoodTest(unittest.TestCase):
self.assertTupleEqual((None, None), h5_attr_to_property(test_integers_2d))
self.assertTupleEqual((None, None), h5_attr_to_property(test_floats_2d))
self.assertRaises(NotImplementedError, h5_attr_to_property, np.array(1))
# Test scalar values given as np.array
self.assertTupleEqual((1, db.INTEGER), h5_attr_to_property(np.array(1)))
self.assertTupleEqual((1.123, db.DOUBLE), h5_attr_to_property(np.array(1.123)))
self.assertTupleEqual(('Hello World', db.TEXT), h5_attr_to_property(np.array("Hello World")))
Loading