-
Notifications
You must be signed in to change notification settings - Fork 38
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
Update adjust time #2490
base: main
Are you sure you want to change the base?
Update adjust time #2490
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2490 +/- ##
=======================================
Coverage 94.77% 94.77%
=======================================
Files 249 249
Lines 14081 14087 +6
=======================================
+ Hits 13345 13351 +6
Misses 736 736 ☔ View full report in Codecov by Sentry. |
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.
Many thanks, Liza! A few remarks from me :)
@valeriupredoi the codacy checks fail not on my code, but I guess it popped up because I opened it in VSCode which possibly changed formatting. Should I correct it? Or someone else will do it? |
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.
looking good! Many thanks, Liza! Could you also add a section in the documentaion about this please? It's a nifty feature that'd be nice to have a few words about it in the documentation, as well as the API docs 🍺
Absolutely, where do you think it would be best to be added? I thought it would come through API only, but I'm happy to elaborate, just not sure where :-) |
Liza, there are a few place where a note about this can be nested in:
|
@schlunma it'd be good if you had a second look at this when Liza is all done adding a wee bit of documentation too - it's not 100% clear to me if this will play well with ICON data time gating 🍺 |
@malininae would it be possible to revert the changes made by your formatter? This makes it really hard to review 😬 At some point we might apply a formatter to the entire code base, so people could simply use them without the risk of reformatting non-related parts of the code. See also ESMValGroup/ESMValTool#2161. Thanks!! |
The documentation that needs to be updated is here: https://docs.esmvaltool.org/projects/ESMValCore/en/latest/recipe/preprocessor.html#extract-time as also described in our contribution guidelines here: https://docs.esmvaltool.org/projects/ESMValCore/en/latest/contributing.html#what-should-be-documented |
Thanks @bouweandela. As far as I understood, sphinx grabs the documentation for the preprocessor functions from the docstrings. I looked at what was built and the updated parameter texts are there. @valeriupredoi I looked and are you sure there is a sense to add it to datasets? It's just in a preprocessor function, not at the timerange part. At the same time, happy to add if you think it's necessary. |
@schlunma @valeriupredoi the formatting issue seemed to be resolved by updating the branch. |
No, unfortunately the changes are still there. I think you only actively changed the Merging main into this won't fix it, you'll need to adapt it manually (either by reverting line by line or by restoring the original file from main and then re-adding you're desired code changes). Please make sure to not run the code formatter ( |
The docstrings are used to build the API docs page here, but you'll also need to update the page that describes how to use this preprocessor function from a recipe: ESMValCore/doc/recipe/preprocessor.rst Lines 1307 to 1325 in 21ce35a
|
It looks like the pre-commit hooks are not playing nice in this case. Maybe we should discuss this again in the @ESMValGroup/technical-lead-development-team team to see how we can make this more smooth. I usually stage my files for committing by e.g. running @schlunma Until we have fixed our automated formatting and pre-commit hooks, I would suggest that reviewers of pull requests are lenient about formatting changes and take a bit of extra trouble to review those too. Would that work for you? |
20ffb97
to
a2eb517
Compare
Thanks @bouweandela and @schlunma, do I understand correctly, that you want me to revert to the old red changes even though the checks passed? I was thinking, I did ran yapf back in the day, could that be it who screwed stuff up? Is there a way to make the code (I guess pylint compatible?) with running some sort of formatter? I tried ruff (didn't suggest any changes) and black, who made things much worse even with options of shorter lines and py310 as a target. |
This is update of the
extract_time
preprocessor to make thestart_year
andend_year
optional (aka None). For reasons, see #2304.Since
extract_time
is a very common preprocessor, I didn't want to tinker with the order of the input parameters not to make it backwards incompatible. Currently, if thestart_year
andend_year
need to be None, one needs to explicitly specify it into the preprocessor like this:However, another possibility I see, how one can make the default year input as
None
, to make the defaultstart_month=1
,start_day=1
,end_month=12
,end_day=31
. I will leave it to the others to decide. Based on the speed comment from @bouweandela, I kept the original code as much as possible.