-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix master np113 #2616
Fix master np113 #2616
Conversation
fbcca35
to
3ab0d26
Compare
What the heck is going on with travis ... sigh 😢 |
Ping @SciTools/iris-devs ... anyone fancy taking this on? All PRs on |
But, it... passes? |
I see that, outside the tests, we still have just a couple of usages of the original meshgrid in iris.plot._map_common Is there a particular reason for that, or did it just get overlooked ? Obviously it's making no difference at this point, but I guess that would be true of some others. |
lib/iris/__init__.py
Outdated
@@ -122,7 +122,7 @@ def callback(cube, field, filename): | |||
|
|||
|
|||
# Iris revision. | |||
__version__ = '2.0.0-DEV' | |||
__version__ = '2.0.dev0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you maybe explain exactly what this is about, just for future reference ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be fair, this doesn't belong in this PR, so I'll pull it ... but the __version__
should be PEP440
.
I'll save that for another day and another PR 👍
{"std": 3.7195863723754883, "min": -5.5932002067565918, "max": 8.7213001251220703, "shape": [93, 75], "masked": false, "mean": 1.6348202228546143} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might have been "nicer" here to reduce the tolerance on the test for when it happens again (!).
I see these values only just fail the test at a relative tolerance of 1e-7, as default for assertArrayAllClose
(+hence assertDataAlmostEqual
) : mean value relative change is approx 1.22e-7.
You could maybe add something like , reltol=5.0e-6
to the 4 calls here
You could do that instead, or as well if you prefer (changes are very small after all).
Just a suggestion -- skip if you don't want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pp-mo I'm really against fudging the tolerances. We took that step previously with testing and it ultimately lead to a bad place, particularly with graphical testing.
So, I'd rather not take that option, unless you consider it unwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't consider it fudging as long as the value used remains appropriate.
I know that was not always the case for our image comparison tolerance, where it got stupidly huge for a while... !
The default value of 1e-7 is designed to cope with float32 rounding errors, but can easily be a bit fine for testing other calculated values, like coordinate projections.
For instance, I just encountered some other tests failing at that level when I was messing about with different dask chunkings.
lib/iris/analysis/cartography.py
Outdated
@@ -239,6 +239,24 @@ def _xy_range(cube, mode=None): | |||
return (x_range, y_range) | |||
|
|||
|
|||
def _meshgrid(x, y): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think on balance I'd prefer this to live in iris.util
, but only slightly -- your call.
Please do keep it private !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Is this not behaviour that would be useful to have consistent across the entire package?
Perhaps if util were made a sub-package, then it would no longer be such a difficult call to add add additional 'utilities' for fear of further discontinuity:
iris.util.ndarray.meshgrid
In ANTS we have the following structure, which has served us very well:
ants.utils.ndarray
ants.utils.coord
ants.utils.cube
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not looked at the details, but numpy/numpy#5302 refers.
A couple of piffling suggestions : I should really have grouped them into a review, but now it's too late. No show-stoppers, I am fully 👍 + happy to merge on your response. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I question whether we should be (effectively) mocking out meshgrid's behaviour and whether the numpy change was done intentionally - I'd be interested in having that chased up. In the meantime, 👍.
lib/iris/analysis/cartography.py
Outdated
@@ -239,6 +239,24 @@ def _xy_range(cube, mode=None): | |||
return (x_range, y_range) | |||
|
|||
|
|||
def _meshgrid(x, y): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not looked at the details, but numpy/numpy#5302 refers.
This PR resolves the current
travis-ci
issues formaster
, which arise from the latest release ofnumpy
, which bumped fromv1.12.1
tov1.13.0
.The issues are related to:
dtype
produced bynumpy.meshgrid
is now the same as its associated 1D input coordinatedtype
numpy.core.arrayprint.array2string
means that we require to be more general with theformatter
option i.e.numpystr
->all
data_manager
unit test