Skip to content
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

Use numpy.linspace to generate grids built with reference point and spacings #4113

Closed
wants to merge 1 commit into from

Conversation

gcaria
Copy link
Contributor

@gcaria gcaria commented May 3, 2021

Close #3559

A very simple fix taken straight from the issue's only comment.

@gcaria gcaria changed the title Use numpy.linspace to generate grid Use numpy.linspace to generate grids built with reference point and spacings May 3, 2021
@gcaria gcaria force-pushed the floating_point_repr_grid branch from 6bfc725 to dada6a4 Compare May 3, 2021 14:19
@rcomer
Copy link
Member

rcomer commented May 3, 2021

Hi @gcaria, thanks for this. We are currently having multiple problems with our Cirrus CI testing, so the test output will be showing a whole raft of failures that are not linked to your change. To get everything working again, we need to merge #4108, #4104, #4112 and probably something to address #3993. So please bear with us while we sort all that out, then you can rebase and someone can have a proper look at this.

Again, thanks for your contribution!

@rcomer
Copy link
Member

rcomer commented May 5, 2021

Hi @gcaria, we have now got the tests all passing on master, so please rebase at your convenience 🙂

@gcaria gcaria force-pushed the floating_point_repr_grid branch from dada6a4 to 29e7a8c Compare May 5, 2021 18:23
@gcaria
Copy link
Contributor Author

gcaria commented May 8, 2021

Thanks for the feedback @rcomer !

It seems that the test failures are then caused by this commit, although it's hard to believe such a simple edit can break anything. Maybe this has to do with some expected reference data that doesn't match the actual one anymore?

I admit I have some difficulties running the test suite on my own, since I get a lot of AssertionError: CML do not match failures (I believe I have followed the instructions on the "contributing" page)

@rcomer
Copy link
Member

rcomer commented May 10, 2021

Thanks for the update @gcaria. Yes, it looks like this is causing very small changes all over the place, and in some cases it does look for the worse. E.g. here the latitude points change from round multiples of 0.5 to ?.?999.

Some of the test input files are in pp-format, and the pp file headers only specify latitude/longitude by their "zeroth" value, step and number of rows/columns. So that probably explains why so many unrelated tests are affected.

I'm not sure what the right thing to do here is. It seems like a computer science question to me, and I am very much not a computer scientist! Perhaps @alastair-gemmell might have some ideas, since he opened the original issue.

@bjlittle bjlittle added the Peloton 🚴‍♂️ Target a breakaway issue to be caught and closed by the peloton label May 19, 2021
@bjlittle bjlittle self-assigned this Aug 4, 2021
@wjbenfold wjbenfold closed this Mar 23, 2022
@wjbenfold wjbenfold reopened this Mar 23, 2022
@wjbenfold
Copy link
Contributor

I tried a close and reopen to nudge the CI, but I think it's mostly just looking at quite old tests. A rebase would fix that.

When I run the tests locally with this change, I get the CML match failures and a couple of other errors from test_multiple_unordered_lbprocs and test_multiple_unordered_rotated_lbprocs. It think it's worth investigating those errors as something's not quite coming out with the right length.

In terms of whether the CML failures are a bad thing, I think they'd all/mostly pass an isclose check, but CML is looking for an exact match. The changes seem fine to me, though @bjlittle might also have an opinion as he looked at similar changes caused by a numpy update fairly recently.

Before merging this change, I think that we should update the lines just below it that use arange too. We could also consider whether we can choose when to check for regularity with iris.util.points_step based on step size as quite a lot of pp file load time is devoted to that check currently, though that's probably outside of scope of this PR.

@bjlittle bjlittle removed the Peloton 🚴‍♂️ Target a breakaway issue to be caught and closed by the peloton label Feb 22, 2023
@stephenworsley stephenworsley self-assigned this Mar 8, 2023
@ESadek-MO
Copy link
Contributor

We have discussed this @SciTools/peloton and have decided to close this; please feel free to reopen! Thanks for your work on this!

@ESadek-MO ESadek-MO closed this May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve floating point representation in generation of regular grids that use a reference point and spacings
6 participants