-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow for flexibility to plot multiple datasets together (#102)
* start of this data driver change * Trying to see what fails * Debugging changes * More changes * Small typo * One more issue * Norms * missing norm * Attempt at new test to plot two datatypes together * Make plot better * Fix title typo * YAML lint trap * Notebook test fix 1 * change bokeh * Update bokeh version to fix CI * Increment to minor version * Changes after develop merge
- Loading branch information
1 parent
579f787
commit 487b51d
Showing
22 changed files
with
609 additions
and
486 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ xarray==2022.6.0 | |
seaborn==0.12.2 | ||
hvplot==0.8.2 | ||
nbconvert==6.5.4 | ||
bokeh==2.4.3 | ||
bokeh==3.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# (C) Copyright 2021-2023 NOAA/NWS/EMC | ||
# | ||
# (C) Copyright 2021-2023 United States Government as represented by the Administrator of the | ||
# National Aeronautics and Space Administration. All Rights Reserved. | ||
# | ||
# This software is licensed under the terms of the Apache Licence Version 2.0 | ||
# This software is licensed under the terms of the Apache Licence Version 2.0 | ||
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. | ||
|
||
|
||
# -------------------------------------------------------------------------------------------------- | ||
|
||
|
||
from eva.utilities.config import get | ||
from eva.eva_base import EvaBase, EvaFactory | ||
|
||
import importlib | ||
import os | ||
|
||
|
||
# -------------------------------------------------------------------------------------------------- | ||
|
||
|
||
class DataDriver(EvaBase): | ||
|
||
def execute(self, data_collections, timing): | ||
|
||
# Get list of dataset dictionaries | ||
datasets = get(self.config['data'], self.logger, 'datasets') | ||
|
||
# Loop over datasets | ||
for dataset in datasets: | ||
|
||
# Extract name for this diagnostic data type | ||
try: | ||
eva_data_class_name = dataset['type'] | ||
except Exception as e: | ||
msg = '\'type\' key not found. \'diagnostic_data_config\': ' \ | ||
f'{diagnostic_data_config}, error: {e}' | ||
raise KeyError(msg) | ||
|
||
# Create the data object | ||
creator = EvaFactory() | ||
timing.start('DataObjectConstructor') | ||
eva_data_object = creator.create_eva_object(eva_data_class_name, | ||
'data', | ||
dataset, | ||
self.logger, | ||
timing) | ||
timing.stop('DataObjectConstructor') | ||
|
||
# Prepare diagnostic data | ||
self.logger.info(f'Running execute for {eva_data_object.name}') | ||
timing.start('DataObjectExecute') | ||
eva_data_object.execute(dataset, data_collections, timing) | ||
timing.stop('DataObjectExecute') | ||
|
||
# -------------------------------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.