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

SCE Pilot- Upgrading CAVA pilot to focus on batch mode to reduce code complexity #442

Closed claalmve closed 1 month ago

claalmve commented 1 month ago

Description of PR

Summary of changes and related issue

This PR addresses one big change, which is the usage of batch mode functionality for both batch mode and non batch mode options. What happens now is that batch mode is always run by default, reducing the overall complexity and runtime of the code.

Relevant motivation and context

There's two main reasons for why this was done:

  1. When there was a batch mode condition in the code, this doubled the number of conditions to check against. This makes it harder to track if the appropriate logic is being applied to all places correctly.
  2. This change also makes the code more clear and more concise. Now, since batch mode data is the default, the data can now be stored in xr.DataArray format. This reduces the need to loop through the data, or separately run functions/metrics on each point separately, and instead allows functions to be run across all simulations and points at the same time. Users can still view their points separately by toggle separate_files on or off, but the underlying computation that drives CAVA will be batch mode instead.

Type of change


Definition of Done Checklist

Practical

Conceptual