[yt-svn] commit/yt: ngoldbaum: Merged in MatthewTurk/yt (pull request #1406)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Jan 14 18:53:45 PST 2015


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/e29ff6c5259c/
Changeset:   e29ff6c5259c
Branch:      yt
User:        ngoldbaum
Date:        2015-01-15 02:53:37+00:00
Summary:     Merged in MatthewTurk/yt (pull request #1406)

[BUGFIX] Updating ragged array tests for NumPy 1.9.1
Affected #:  2 files

diff -r 69ef89f6b31b8ad5e2a36b39ca1781027722f2b2 -r e29ff6c5259c8ecae04e30bac953325df5b58645 yt/testing.py
--- a/yt/testing.py
+++ b/yt/testing.py
@@ -46,6 +46,9 @@
         a2[ind2] = 1.0
     elif np.any(np.isnan(a1)) and np.any(np.isnan(a2)):
         return True
+    if not isinstance(a1, np.ndarray) and a1 == a2 == 0.0:
+        # NANS!
+        a1 = a2 = 1.0
     return assert_almost_equal(np.array(a1)/np.array(a2), 1.0, decimals, err_msg=err_msg,
                                verbose=verbose)
 

diff -r 69ef89f6b31b8ad5e2a36b39ca1781027722f2b2 -r e29ff6c5259c8ecae04e30bac953325df5b58645 yt/utilities/lib/tests/test_ragged_arrays.py
--- a/yt/utilities/lib/tests/test_ragged_arrays.py
+++ b/yt/utilities/lib/tests/test_ragged_arrays.py
@@ -32,5 +32,12 @@
             i = 0
             for j, v in enumerate(sizes):
                 arr = values[indices[i:i+v]]
-                yield assert_equal, op(arr), out_values[j]
+                if dtype == "float32":
+                    # Numpy 1.9.1 changes the accumulator type to promote
+                    yield assert_rel_equal, op(arr), out_values[j], 6
+                elif dtype == "float64":
+                    # Numpy 1.9.1 changes the accumulator type to promote
+                    yield assert_rel_equal, op(arr), out_values[j], 12
+                else:
+                    yield assert_equal, op(arr), out_values[j]
                 i += v

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list