Skip to content

Commit

Permalink
Fix test_incompatible_dimensions test (#3977)
Browse files Browse the repository at this point in the history
* test_incompatible_dimensions used a ragged array for the test, which has been deprecated in numpy, and now fails if dtype is anything other than object.  This test appears to be checking that the addition of a [2x4] masked array to a [2x3] masked cube should raise a ValueError. This commit fixes the creation of `data3` object to be a [2x4] non-ragged array.

* Added entry to what's new

* Added name to core developer list :)

* Update latest.rst

Fixed space in PR macro call
  • Loading branch information
jamesp authored Feb 3, 2021
1 parent 636b97b commit 79d636e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/iris/src/common_links.inc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
.. _@djkirkham: https://github.com/djkirkham
.. _@DPeterK: https://github.com/DPeterK
.. _@esc24: https://github.com/esc24
.. _@jamesp: https://github.com/jamesp
.. _@jonseddon: https://github.com/jonseddon
.. _@jvegasbsc: https://github.com/jvegasbsc
.. _@lbdreyer: https://github.com/lbdreyer
Expand Down
1 change: 1 addition & 0 deletions docs/iris/src/whatsnew/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ This document explains the changes made to Iris for this release

#. `@rcomer`_ removed an old unused test file. (:pull:`3913`)

#. `@jamesp`_ updated a test to the latest numpy version (:pull:`3977`)

.. comment
Whatsnew author names (@github name) in alphabetical order. Note that,
Expand Down
2 changes: 1 addition & 1 deletion lib/iris/tests/test_basic_maths.py
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ def setUp(self):

def test_incompatible_dimensions(self):
data3 = ma.MaskedArray(
[[3, 3, 3, 4], [2, 2, 2]], mask=[[0, 1, 0, 0], [0, 1, 1]]
[[3, 3, 3, 4], [2, 2, 2, 2]], mask=[[0, 1, 0, 0], [0, 1, 1, 1]]
)
with self.assertRaises(ValueError):
# Incompatible dimensions.
Expand Down

0 comments on commit 79d636e

Please sign in to comment.