-
Notifications
You must be signed in to change notification settings - Fork 130
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
Refactor lazy_regrid.py for wflow diagnostics #2024
Conversation
@ESMValGroup/tech-reviewers this PR is ready for review. Thanks in advance. |
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.
Hi Sarah,
Good call! It seems as though you've accidentily included some changes from your local working directory, or is this intentional (and can you explain why it's needed in that case?)
Did you also compare the performance?
Hi Peter, thank you. These changes are intended to make the recipes more realistic regarding their applications, for more details please see my response to your comments on each change.
Do you mean comparing the performance of |
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.
am just crashing this party here because I am curious if you have a resource comparison between your implementation and the new iris lazy regrid implementation - don't have to be exact, but some rough numbers would be interesting to hear 👍
import numpy as np | ||
from osgeo import gdal | ||
from esmvalcore.preprocessor import regrid | ||
import iris |
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 am in awe about how Codacy is not complaining about this import order 😁
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.
Me too, but I already asked Sarah to check something like that lately and it turns out I was the one that's wrong... This one is even more strange though!
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.
hmmm, the prospector did not complain about it, and the pylint in vscode says: third party import "from esmvalcore.preprocessor import regrid" should be placed before "import iris"pylint
.
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's possible prospector didn't run the pylint bit and the CI let it pass - it does that from time to time when there are lots of commits
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.
looks better now 👍
Yes, just like @valeriupredoi asked. I think the functions should be roughly the same, but I was also just curious |
OK, I will do it. |
@Peter9192 and @valeriupredoi good that you both asked me to check the performance. Running the recipe with 10 years of data fails due to memory error. This is still an open issue in iris . Therefore, we decided to keep the lazy_regrid script. I refactor the script based on the iris documentation on Regridding Lazy Data. Comparing the performance is shown in issue #2025. (cc @bouweandela) |
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.
Looks good to me @SarahAlidoost! Just some suggestions for further cleanup.
@Peter9192 and @valeriupredoi could you please approve the PR or let me know if there are any concerns? thank you. |
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.
nice work @SarahAlidoost 🍺
import numpy as np | ||
from osgeo import gdal | ||
from esmvalcore.preprocessor import regrid | ||
import iris |
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.
looks better now 👍
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.
Nice work Sarah, looks nice and clean now :-)
three approvals, it's like Christmas come early 😆 |
Description
Before you get started
Checklist
It is the responsibility of the author to make sure the PR is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.
pre-commit
oryamllint
checksNew or updated recipe/diagnostic:
/diagnostic.html#additional-dependencies)
@esmvalbot
or some other machine without modificationTo help with the number pull requests: