cal-adapt / climakitae

A Python toolkit for retrieving, visualizing, and performing scientific analyses with data from the Cal-Adapt Analytics Engine.
https://climakitae.readthedocs.io
BSD 3-Clause "New" or "Revised" License
21 stars 2 forks source link

Backend functionality for retrieving based on warming levels approach #449

Closed nicolejkeeney closed 1 month ago

nicolejkeeney commented 1 month ago

Description of PR

This branch of climakitae needs to be run with the corresponding branch of the same name in climakitaegui

Backend and front-end functionality added for retrieving based on warming levels or time based approach.

Eventually I think the goal is to move away from the warming levels explore module (?) since this functionality essentially duplicates that functionality within DataParameters object. Will need to discuss with the team what to do with the existing GUI functionality from warming.py since I believe having two similar but slightly different warming levels objects/functionality (i.e. ways to access data by warming level) will confuse users.

Notebook documentation should be updated to reflect this new functionality!

In a separate PR, I will update the functions in the climakitae_direct_data_download.ipynb notebook to reflect these new options and allow for users to use this approach without using the GUI or directly modifying the selections object.

Summary of changes and related issue

Lots of changes were made; I'll try to summarize as best as I can here.

  1. Several new attributes were added to the DataParameters object to allow for retrieving based on warming levels: DataParameters().approach, DataParameters().warming_levels_window, DataParameters().warming_levels_months.
  2. The global warming levels table (gwl_1850_1900_file) was added as an attribute to the DataInterface object, allowing the table to be passed around easily instead of read in by individual modules
  3. The selections GUI was changed to reflect the new options
  4. A new module added in utils "warming_levels.py" with the warming levels helper functions.

Relevant motivation and context

Part of a larger effort to incorporate warming levels into AE stuff.

Type of change


Definition of Done Checklist

Practical

Conceptual

nicolejkeeney commented 1 month ago

WL integration step 2: backend data retrieval

claalmve commented 1 month ago

Looks good to me! I just left a few small comments, but otherwise, the functionality of this PR looks great! Great work on such a big change in our codebase and including WL's in a much more consolidated format.