-
Notifications
You must be signed in to change notification settings - Fork 40
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
Precip distribution #861
Precip distribution #861
Conversation
@lee1043 @acordonez I have a question. In the JSON output structure (see below), there is a hierarchical structure for seasons and months. Is this structure working for CMEC as well? or Should I update it as a flat structure? |
@msahn I'll review this by the end of the week. Can I run these metrics with data that is already in the PMP sample data set? |
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.
Thank you. Yes, it works with daily precipitation data. The default reference data for the Perkins score and other metrics that need reference data is set as IMERG as below. So, this should be also changed to your input data for testing. pcmdi_metrics/pcmdi_metrics/precip_distribution/param/precip_distribution_params_IMERG.py Line 43 in 2ccbf1a
|
@msahn This structure works fine in the CMEC JSONs. |
import glob | ||
import copy | ||
import pcmdi_metrics | ||
import regionmask |
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.
regionmask and rasterio are not currently dependencies for the PMP. Are there any other packages, along with these packages, that need to be added as dependencies in conda-forge?
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.
How can I check the current dependencies for the PMP? I think the packages for defining regions below need to be additionally added.
- regionmask
- rasterio
- shapely
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.
The dependencies for conda-forge are defined here: https://github.com/conda-forge/pcmdi_metrics-feedstock/blob/main/recipe/meta.yaml#L30
While shapely is not explicitly defined, it is already being installed in the pcmdi_metrics environment as a dependency for the defined packages. Rasterio and regionmask are not. If you want to see everything that gets installed by default, you can create a pmp environment and use conda list like this:
conda create -n new_pmp_env -c conda-forge pcmdi_metrics
conda activate new_pmp_env
conda list
When I was testing the IMERG job, I also found that 'netcdf4' needed to be explicitly installed or I'd get an error in xarray. So in total I think we'd need to add 'rasterio', 'regionmask', and 'netcdf4' to meta.yaml.
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.
Thank you for the information. Adding the three packages sounds good to me.
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.
@acordonez Are those libraries needs to be added to conda-env/dev.yml
file as well? Sorry for my delayed response on this thread.
Thank you for updating the code to be more efficient. I have tested it, and there was no issue. I also have added functionality in parallel_driver_cmip.py for running the code for one model using |
…d.360x180_IMERG_ALL.nc
…e later replaced by xcdat
After adding dependencies in dev.yml github action's build test get automatically cancelled every time it was triggered. @acordonez do you have any idea on this? Should we consider specifying versions of the newly added dependencies? |
Note: Below four dependencies were added in
However, considering they are only used for precip distribution metric, further discussion will be needed to decide whether we want to keeping them as default or optional. @acordonez @msahn any comment welcome. |
@lee1043 We'll also need to add those as dependencies in the conda feedstock meta.yaml if we want them to be installed with PMP via conda-forge. I've had a lot of trouble with shapely in particular trying to install it after creating a new environment with other packages in it, so installing these at the same time as the other PMP dependencies is probably the best way to go. |
@acordonez good to know! Agreed, thanks for your input! |
@lee1043 @msahn I'm stumped about this failure. I've tried rerunning the job a couple of times and it happens in the same step each time. I don't see any warnings or messages related to the new dependencies, but maybe there's some additional step we have to take to include them. Do you think we could ask Jason or Tom? |
@acordonez thanks for checking. Same here, I have looked through messages, rerunned build test multiple times with enabling debugging, but it keeps cancels after ~5 min for no obvious region, which is strange. Do you think it is okay we just override it for now...? |
By above 2 commits, I confirmed that the build test cancelling was not influenced by newly added dependencies in the dev.yml. With that it may be okay to override... |
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 have confirmed the code works well on my end. Thanks @msahn for the contribution!
This is to implement precip distribution metrics into the PMP.