-
Notifications
You must be signed in to change notification settings - Fork 5
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
Adding caravan forcing #407
Conversation
Not too sure how to complete renaming from ERA-5 to ESMValTool compatible variable names. Edit: for now just supplied a rename dictionary as in discussion |
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 David, nice work! I left some comments for possible improvements to the code. Feel free to ask a review again when it's ready!
Also, it would be nice if you could add tests for this forcing. (without downloading anything). If you're unsure on how to do that we can discuss it at some point |
regarding conventions: from a didactic point of view in tutorial notebooks I suggest to always use: import ewatercycle.forcing
camels_forcing = ewatercycle.forcing.sources['LumpedCaravanForcing'].retrieve(start_time = experiment_start_date,
end_time = experiment_end_date,
directory = forcing_path / "Camels",
basin_id = f"camels_0{HRU_id}",
variables = ('streamflow','potential_evaporation_sum'),
) Novice users quickly loose sight of which function belongs to which library when using |
Made the suggested changes Rolf, Example Notebook can be found here: |
Still facing three issues, maybe you could help with that Bart?:
|
That's odd. The "height" attribute should be in there. Perhaps it's an environment/versioning issue, and the environment is newly created on Github Actions for the test. So you don't see the error as you don't have all the latest versions of packages.
Probably also due to a version change. You can add the
You would have to mock/patch some of the code. For examples see ewatercycle/tests/src/test_container.py Line 177 in b4ea453
You'd mock this line in your code |
Hi David, we found the test issue and fixed it in #410 . Once that's merged to main that should resolve the problem you encounter here. On second thought I do think that it would be better to use the From the converage output in the CI I see this;
Generally we want 80% coverage on the code (sonarcloud analysis). I think if you add tests for the After these things I think this PR is ready to merge! 👍 |
fix tests
Done! That Bumps it up to 83%
Refctored this now, so all ready! Pytest fails on the other test, sonar cloud is stuck on the token but should both be fine. Thanks for all the input & feedback @BSchilperoort @sverhoeven! |
To get back to you on this @RolfHut, In the data set attributes under history it does mention the data source. This is now correctly copied over to the new datas set. If the user looks at the (meta)data, they should see its ERA5 |
Co-authored-by: Bart Schilperoort <b.schilperoort@gmail.com>
src/ewatercycle/_forcings/caravan.py
Outdated
dataset: Unused | ||
|
||
**kwargs: | ||
basin_id: str containing the wanted basin_id. |
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.
Can you add where the user can lookup the basin ID?
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 is where geopandas would be nice :p, but will add a function which lets the user explore the dataset(ids).
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 was hoping more for something like a webpage listing the basin_id's together with river/basin names, country, etc. I guess that doesn't exist?
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.
Nope, but what i do now is list the datasets in a seperate function. That way the user can get the dataset as netcdf and a list of basin ID's
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.
For advanced users this will do, for more novice users choosing a single catchment: likely they will have to download the combinedshapefile, load this into GIS and pick one
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 was hoping more for something like a webpage listing the basin_id's together with river/basin names, country, etc. I guess that doesn't exist?
would be pretty easy to make an interactive folium/leaflet map out of this actually! Similar to this
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 continue this discussion in issues: #398
Co-authored-by: Bart Schilperoort <b.schilperoort@gmail.com>
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! Sorry that it was blocked a bit by the failing test+sonarcloud problems, but now it's ready to merge (after that 1 last comment above, and pre-commit haha) 😄
Edit: InputError isn't a buildin exception. You can pick a different appropriate one. This is why mypy fails.
Hi All,
As this is my first contribution would like some feedback if possible.
Was unsure on the naming convention,
generate
seems to be more linked to the esmvaltool, thus went forretrieve
.Runs for me when I run:
Discussions on the topic: #398
Still todo:
test_util.test_merge_esmvaltool_datasets