From e70af92e65d5fee0724d599a2aa963be17464cc1 Mon Sep 17 00:00:00 2001 From: williamstravis Date: Tue, 29 Oct 2024 14:44:37 -0600 Subject: [PATCH] Fixed timeseries bugs. --- reView/pages/rev/controller/callbacks.py | 8 ++++---- reView/pages/rev/controller/element_builders.py | 1 + reView/utils/readers.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/reView/pages/rev/controller/callbacks.py b/reView/pages/rev/controller/callbacks.py index aab8e70..93cf5da 100644 --- a/reView/pages/rev/controller/callbacks.py +++ b/reView/pages/rev/controller/callbacks.py @@ -534,7 +534,7 @@ def dropdown_composite_scenarios( filters, filter_ids, _ - ): +): """Update the options given a project.""" logger.debug("URL: %s", url) config = Config(project) @@ -674,7 +674,7 @@ def dropdown_scenarios( __, filter_ids, ___, - ): +): """Update the scenario options given a project.""" # Find all available project files config = Config(project) @@ -1168,7 +1168,7 @@ def figure_timeseries( map_selection, map_click, project - ): +): """Render timeseries plots if possible.""" # read in signal signal_dict = json.loads(signal) @@ -1220,7 +1220,7 @@ def figure_timeseries( datasets=datasets, plot_title=title, point_size=10, - user_scale=(0, 1), + user_scale=(0, 1), # this assumes cf alpha=1, ) diff --git a/reView/pages/rev/controller/element_builders.py b/reView/pages/rev/controller/element_builders.py index 3f2602b..184f4a8 100644 --- a/reView/pages/rev/controller/element_builders.py +++ b/reView/pages/rev/controller/element_builders.py @@ -617,6 +617,7 @@ def _plot_range(self, var): ymax = max([df[var].max() for df in self.datasets.values()]) if ymax and not ymin: ymin = min([df[var].min() for df in self.datasets.values()]) + return [ymin, ymax] def _update_fig_layout(self, fig, y_var=None): diff --git a/reView/utils/readers.py b/reView/utils/readers.py index 758409c..2e22dc4 100644 --- a/reView/utils/readers.py +++ b/reView/utils/readers.py @@ -407,7 +407,7 @@ def read_timeseries(file, project, gids=None, nsteps=None, nsteps = ds["time_index"].shape[0] # Find site indices - if gids is not None: + if gids: meta = meta[meta["sc_point_gid"].isin(gids)] idx = list(meta.index)