Closed nicolejkeeney closed 2 months ago
This looks good but two things I'm seeing:
1) I am seeing 2 errors returned, one from this code and then one from the retrieve
failing. We should either find a way to just return the 1 error or change the text of the retrieve error to be even more general.
2) I think this should also apply to the read_catalog_from_csv
function. So maybe put this code in a local function and then run it in both read_catalogs
.
This looks good but two things I'm seeing:
- I am seeing 2 errors returned, one from this code and then one from the
retrieve
failing. We should either find a way to just return the 1 error or change the text of the retrieve error to be even more general.- I think this should also apply to the
read_catalog_from_csv
function. So maybe put this code in a local function and then run it in bothread_catalogs
.
This looks good but two things I'm seeing:
- I am seeing 2 errors returned, one from this code and then one from the
retrieve
failing. We should either find a way to just return the 1 error or change the text of the retrieve error to be even more general.- I think this should also apply to the
read_catalog_from_csv
function. So maybe put this code in a local function and then run it in bothread_catalogs
.
- I will look into that!
- Maybe that would be better to do in a separate PR?
This looks good but two things I'm seeing:
- I am seeing 2 errors returned, one from this code and then one from the
retrieve
failing. We should either find a way to just return the 1 error or change the text of the retrieve error to be even more general.- I think this should also apply to the
read_catalog_from_csv
function. So maybe put this code in a local function and then run it in bothread_catalogs
.
- I will look into that!
- Maybe that would be better to do in a separate PR?
This looks good but two things I'm seeing:
- I am seeing 2 errors returned, one from this code and then one from the
retrieve
failing. We should either find a way to just return the 1 error or change the text of the retrieve error to be even more general.- I think this should also apply to the
read_catalog_from_csv
function. So maybe put this code in a local function and then run it in bothread_catalogs
.
- I will look into that!
- Maybe that would be better to do in a separate PR?
If you feel that you need to get the other in first, sure.
I fixed both the points that @elehmer raised, and removed the try... except line in data_interface because it appears to be superfluous, as appropriate errors are raised earlier in the code pipeline (including for when too small of a region is attempted to be retrieved, multiple errors are called)
Description of PR
Removed ability to retrieve selections manually from Select that have inconsistent data and units (i.e. retrieving 'inches' of 'Air Temperature at 2m')
I also wrote a few tests to confirm that an error is raised when you try to select bad units!
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Try running the following, where you try to retrieve precipitation with an invalid unit that has been manually set
The code should raise an error when you try to retrieve the data, and print out valid unit options for the variable of choice.
If you can try some other variables and units that would be good!
Checklist: