Closed nicolejkeeney closed 1 month ago
Tested a bunch of settings and looking really solid @nicolejkeeney. A few things I noticed:
- If
warming_level
is not passed as a list (e.g.warming_level = 1.5
) we get the ubiquotious mismatch size error- If
warming_level_month
is not passed as a list though, I get this warning:Cell In [25], line 13 ) ^ SyntaxError: positional argument follows keyword argument
- Since the options for
warming_level
are floats here, will need to coordinate with the CAVA dev team (CC: me + @claalmve ) since thecava_data
function uses a string for WLs and if this functionality gets incorporated in / replaces data retrieval there, there will need to be some modifications on that end too.Great work on a beefy task!
Regarding 1 & 2: Excellent bug finding as usual, those are definitely confusing errors that I will fix to be more intuitive to users.
Regarding 3: I personally think it makes more sense to have the numbers as floats rather than strings. Will work with you and Calvin to get that updated in CAVA.
Fixed everything mentioned by reviewers. Merging into upstream branch (wl3).
Description of PR
Big improvements to the
get_data()
function to enable retrieving data manually using a warming levels approach. I also added an option to set the time slice. I changed some of the logic in the function as well to be better organized.How to test
Try using the
get_data()
function to pull data using a warming levels approach. Use a bunch of different options; see what breaks, and if the error message for a bad input is helpful. PLEASE TELL ME WHAT YOUR FUNCTION INPUTS ARE IF YOU FIND AN ERROR I NEED TO FIX SO THAT I CAN REPRODUCE IT!!For example:
See the notebook
climakitae_direct_data_download.ipynb
for more info on this function.Let me know if the function documentation is confusing or insufficient in any way.
Summary of changes and related issue
Better error handling is added to give more information to the user if bad inputs are provided to the function. Allows users to retrieve data using the following new function arguments:
Relevant motivation and context
Part of a larger push to incorporate global warming levels into climakitae.
Let's figure out how to get this into our existing notebooks to make the code cleaner and also demonstrate this new functionality! :D
Type of change
Definition of Done Checklist
Practical
_
before the nameConceptual