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
|
|
||
| # Iris revision. | ||
| __version__ = '2.0.0-DEV' | ||
| __version__ = '2.0.dev0' |
There was a problem hiding this comment.
Can you maybe explain exactly what this is about, just for future reference ?
There was a problem hiding this comment.
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 👍
| @@ -1 +1 @@ | |||
| {"std": 3.7195861803241614, "min": -5.593200206756592, "max": 8.72130012512207, "shape": [93, 75], "masked": false, "mean": 1.6348200228305594} No newline at end of file | |||
| {"std": 3.7195863723754883, "min": -5.5932002067565918, "max": 8.7213001251220703, "shape": [93, 75], "masked": false, "mean": 1.6348202228546143} No newline at end of file | |||
There was a problem hiding this comment.
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.
@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.
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
| return (x_range, y_range) | ||
|
|
||
|
|
||
| def _meshgrid(x, y): |
There was a problem hiding this comment.
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.
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.meshgridIn ANTS we have the following structure, which has served us very well:
ants.utils.ndarray
ants.utils.coord
ants.utils.cubeThere was a problem hiding this comment.
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. |
pelson
left a comment
There was a problem hiding this comment.
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
| return (x_range, y_range) | ||
|
|
||
|
|
||
| def _meshgrid(x, y): |
There was a problem hiding this comment.
Not looked at the details, but numpy/numpy#5302 refers.
This PR resolves the current
travis-ciissues formaster, which arise from the latest release ofnumpy, which bumped fromv1.12.1tov1.13.0.The issues are related to:
dtypeproduced bynumpy.meshgridis now the same as its associated 1D input coordinatedtypenumpy.core.arrayprint.array2stringmeans that we require to be more general with theformatteroption i.e.numpystr->alldata_managerunit test