[python-hdf5storage] 82/152: Added tests for bug where a complex number with one field as NaN but the other not is read back as NaN in both fields.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Feb 29 08:24:36 UTC 2016


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to annotated tag 0.1
in repository python-hdf5storage.

commit 126e8e4aa96e3e9ea8ef3d6adebfcfcf0d6bb7a7
Author: Freja Nordsiek <fnordsie at gmail.com>
Date:   Sun Feb 2 05:22:58 2014 -0500

    Added tests for bug where a complex number with one field as NaN but the other not is read back as NaN in both fields.
---
 tests/test_write_readback.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tests/test_write_readback.py b/tests/test_write_readback.py
index 3ad5956..3d183df 100644
--- a/tests/test_write_readback.py
+++ b/tests/test_write_readback.py
@@ -270,6 +270,18 @@ class TestPythonMatlabFormat(object):
                                   self.options)
         self.assert_equal(out, data)
 
+    def test_complex_real_nan(self):
+        data = complex(np.nan, self.random_float())
+        out = self.write_readback(data, self.random_name(),
+                                  self.options)
+        self.assert_equal(out, data)
+
+    def test_complex_imaginary_nan(self):
+        data = complex(self.random_float(), np.nan)
+        out = self.write_readback(data, self.random_name(),
+                                  self.options)
+        self.assert_equal(out, data)
+
     def test_str(self):
         data = self.random_str_ascii(random.randint(1, 100))
         out = self.write_readback(data, self.random_name(),

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-hdf5storage.git



More information about the debian-science-commits mailing list