-
Notifications
You must be signed in to change notification settings - Fork 4
ICON-EU step 1: Implement template_config.py
#184
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
ICON-EU step 1: Implement template_config.py
#184
Conversation
|
@JackKelly I have a slight preference to review in more incremental PRs (e.g. one for the template config + tests, one for region job, one for dynamical dataset). So given that, this looks like it's ready for a review? I'll give it a first pass this afternoon |
|
Hey. I like small PRs too! Please hold fire on reviewing. There are some issues with the NWP variable names that I'd like to fix first, if that's ok. |
…files are currently just the output from the initialize-new-integration tool. These files will be added to a subsequent PR once I've modified them.
|
OK, I think this is ready for review! I've removed the files that I haven't yet updated. Although I've just noticed that the code quality check is failing... |
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.
Awesome! Just a few tiny tweaks but this is basically good to go.
Don't worry too much about the units and short/long names right now. We need to do a detail sweep and get fully aligned to cf conventions and we can do that before we release this.
re the mypy failure in the pipeline
- i think you need to create empty
dwd/__init__.pyanddwd/icon_eu/__init__.pyfiles. I should update the init script to create those - if you install pre-commit (instructions it will check for you as you commit. you can also run
uv run mypylocally.
| ), | ||
| ), | ||
| DwdIconEuDataVar( | ||
| name="convective_available_potential_energy", |
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.
is this entire atmosphere?
| name="convective_available_potential_energy", | |
| name="convective_available_potential_energy_atmosphere", |
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.
Surprisingly, the ICON-EU GRIBs and the ICON-EU manual claim that GRIB_typeOfLevel is set to surface for the cape variable. Although I agree that entire atmosphere would make more sense!
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.
So, if it's OK, I'd propose that I don't change convective_available_potential_energy to convective_available_potential_energy_atmosphere (because the ICON-EU manual claims that convective_available_potential_energy is a surface variable). Unless I've misunderstood?!
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.
lets leave as is for now and come back with a later metadata polish and align to CF Conventions. Same for the other possible naming + unit questions in our metadata.
…, in the hopes of fixing the mypy failure. mypy passes locally.
As per Alden's review Co-authored-by: Alden Keefe Sampson <aldenkeefesampson@gmail.com>
As per Alden's review
…atters into update-icon-eu-from-dwd
Co-authored-by: Alden Keefe Sampson <aldenkeefesampson@gmail.com>
Co-authored-by: Alden Keefe Sampson <aldenkeefesampson@gmail.com>
As per Alden's review
Co-authored-by: Alden Keefe Sampson <aldenkeefesampson@gmail.com>
So... this I committed the missing Python files that And, as you suggested, I created These fixed the mypy error. But then I got an import error in pytest, which I think is caused by a bug in |
And update comment about chunk sizes
template_config.py
Co-authored-by: Alden Keefe Sampson <aldenkeefesampson@gmail.com>
|
OK, I think this PR is ready to merge 🙂. |
| "pre-commit>=3.8.0", | ||
| "pyqt6>=6.7.1", | ||
| "pytest>=8.3.4", | ||
| "pytest>=8.4.1", |
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.
Please see this comment for more info on why I updated pytest: #184 (comment)
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 haven't modified this file yet. This is just the output of initialize-new-integration. I'll modify this file in a subsequent PR.
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 haven't modified this file yet. This is just the output of initialize-new-integration. I'll modify this file in a subsequent PR.
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 haven't modified this file yet. This is just the output of initialize-new-integration. I'll modify this file in a subsequent PR.
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 haven't modified this file yet. This is just the output of initialize-new-integration. I'll modify this file in a subsequent PR.
| [[package]] | ||
| name = "pytest" | ||
| version = "8.3.4" | ||
| version = "8.4.1" |
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.
See this comment for more info on why I updated pytest: #184 (comment)
|
awesome! will give this a final review and merge this evening |
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.
Beauty! Merging. I have a larger TODO around aligning with CF Conventions and we can do that after we have things running.
im going to make one follow up commit correcting the chunk size comment (edit: done here #195)
| dataset_version="0.1.0", | ||
| name="DWD ICON-EU Forecast", | ||
| description="High-resolution weather forecasts for Europe from the ICON-EU model operated by Deutscher Wetterdienst (DWD).", | ||
| attribution="DWD ICON-EU data processed by dynamical.org from DWD.", |
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.
| attribution="DWD ICON-EU data processed by dynamical.org from DWD.", | |
| attribution="DWD ICON-EU data processed by dynamical.org.", |
| @property | ||
| def data_vars(self) -> Sequence[DwdIconEuDataVar]: | ||
| """Define metadata and encoding for each data variable.""" | ||
| var_chunks: dict[Dim, int] = { |
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.
doh, i think i had my math wrong, it's # of elements * 4 bytes for a float32: 1x93×219×153×4bytes ~= 12.5MB uncompressed and then I've found compressing down to 20% of uncompressed size is a reasonable expectation (we can often go a bit lower, sometimes much lower for very compressible variables) so 1×93×219×153×4bytes×0.2 ~= 2.5MB compressed.
| ), | ||
| ), | ||
| DwdIconEuDataVar( | ||
| name="convective_available_potential_energy", |
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.
lets leave as is for now and come back with a later metadata polish and align to CF Conventions. Same for the other possible naming + unit questions in our metadata.
| ), | ||
| ), | ||
| DwdIconEuDataVar( | ||
| name="soil_water_runoff", |
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'm not yet sold on including the soil and surface runoff and snow cover/water equivalent variables (they are usually not great from atmospheric models) but we can decide the exact vars later, no change needed 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.
Cool... TBH, I only included the water runoff variables because I thought that Upstream might use those variables! (I don't know anything about modelling rivers!) So, if you don't need them, then let's not include the water runoff variables (but, like you say, we can tweak the variables list later).
This PR implements live-updating DWD's ICON-EU NWP directly from DWD.
A subsequent PR will implement back-filling from OCF's ICON-EU archive on Hugging Face.
Related issues:
Related external links
Task list
I'll mark this PR as "ready for review" when all these tasks are done
src/reformatters/__main__.pytemplate_config.pytemplate_config.pyagainst the ICON docs. Copy-and-paste the description of each variable from the PDF intotemplate_config.py. Link to the PDF from the code.template_config_test.pyFor a subsequent PR:
region_job.pyregion_job_test.pydynamical_dataset.pydynamical_dataset_test.py