[yt-svn] commit/yt: 3 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Jan 14 18:53:43 PST 2015
3 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/5d3029785489/
Changeset: 5d3029785489
Branch: yt
User: MatthewTurk
Date: 2015-01-14 18:14:44+00:00
Summary: Fixing ragged arrays for NumPy 1.9.1.
Affected #: 2 files
diff -r 4d01836b2b183101f6c1c6aed09ddf3d6e8c1b83 -r 5d30297854890f5f86eefe775748ec2f6dc0603f 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 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 4d01836b2b183101f6c1c6aed09ddf3d6e8c1b83 -r 5d30297854890f5f86eefe775748ec2f6dc0603f 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
https://bitbucket.org/yt_analysis/yt/commits/82cbd326a1cc/
Changeset: 82cbd326a1cc
Branch: yt
User: MatthewTurk
Date: 2015-01-14 20:36:44+00:00
Summary: Don't do this for ndarrays.
Affected #: 1 file
diff -r 5d30297854890f5f86eefe775748ec2f6dc0603f -r 82cbd326a1cc4c24a2da3224e7a831e7744b481b yt/testing.py
--- a/yt/testing.py
+++ b/yt/testing.py
@@ -46,7 +46,7 @@
a2[ind2] = 1.0
elif np.any(np.isnan(a1)) and np.any(np.isnan(a2)):
return True
- if a1 == a2 == 0.0:
+ 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,
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