From ad962214cc95aa8afeafc9659eca8d7a025bc652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Fredrik=20Ki=C3=A6r?= <31612826+anders-kiaer@users.noreply.github.com> Date: Tue, 4 Jun 2019 19:19:39 +0200 Subject: [PATCH] Update to inherit abc container class (#32) --- tests/test_parameter_distribution.py | 6 ++---- webviz_subsurface/containers/_disk_usage.py | 3 ++- webviz_subsurface/containers/_history_match.py | 3 ++- webviz_subsurface/containers/_intersect.py | 3 ++- webviz_subsurface/containers/_morris_plot.py | 3 ++- webviz_subsurface/containers/_parameter_distribution.py | 3 ++- webviz_subsurface/containers/_subsurface_map.py | 3 ++- webviz_subsurface/containers/_summary_stats.py | 3 ++- 8 files changed, 16 insertions(+), 11 deletions(-) diff --git a/tests/test_parameter_distribution.py b/tests/test_parameter_distribution.py index b563ef157..169960308 100644 --- a/tests/test_parameter_distribution.py +++ b/tests/test_parameter_distribution.py @@ -3,8 +3,7 @@ import pandas as pd from pytest_dash.wait_for import wait_for_element_by_css_selector from webviz_config.common_cache import cache -from webviz_subsurface.containers import _parameter_distribution - +from webviz_config.containers import ParameterDistribution # mocked functions get_parameters = 'webviz_subsurface.containers'\ @@ -25,8 +24,7 @@ def test_parameter_dist(dash_threaded): with mock.patch(get_parameters) as mock_parameters: mock_parameters.return_value = pd.read_csv('tests/data/parameters.csv') - p = _parameter_distribution.\ - ParameterDistribution(app, container_settings, ensembles) + p = ParameterDistribution(app, container_settings, ensembles) app.layout = p.layout dash_threaded(app) diff --git a/webviz_subsurface/containers/_disk_usage.py b/webviz_subsurface/containers/_disk_usage.py index b6a91640d..889629fa7 100644 --- a/webviz_subsurface/containers/_disk_usage.py +++ b/webviz_subsurface/containers/_disk_usage.py @@ -6,9 +6,10 @@ from dash.dependencies import Input, Output from webviz_config.webviz_store import webvizstore from webviz_config.common_cache import cache +from webviz_config.containers import WebvizContainer -class DiskUsage: +class DiskUsage(WebvizContainer): '''### Disk usage This container adds functionality for standard visualization of disk usage in diff --git a/webviz_subsurface/containers/_history_match.py b/webviz_subsurface/containers/_history_match.py index e0df41d5e..68d7a5bcd 100644 --- a/webviz_subsurface/containers/_history_match.py +++ b/webviz_subsurface/containers/_history_match.py @@ -4,11 +4,12 @@ from pathlib import Path from scipy.stats import chi2 import dash_html_components as html +from webviz_config.containers import WebvizContainer import webviz_subsurface_components as wsc from ..datainput import extract_mismatch -class HistoryMatch: +class HistoryMatch(WebvizContainer): '''### History match This container visualizes the quality of the history match. diff --git a/webviz_subsurface/containers/_intersect.py b/webviz_subsurface/containers/_intersect.py index b3d8b6571..11a4772e8 100644 --- a/webviz_subsurface/containers/_intersect.py +++ b/webviz_subsurface/containers/_intersect.py @@ -9,10 +9,11 @@ from dash.dependencies import Input, Output, State from dash_table import DataTable from webviz_config.common_cache import cache +from webviz_config.containers import WebvizContainer from ..datainput import scratch_ensemble, load_surface, get_wfence, get_hfence -class Intersect(): +class Intersect(WebvizContainer): '''### Intersect This container visualizes surfaces intersected along a well path. diff --git a/webviz_subsurface/containers/_morris_plot.py b/webviz_subsurface/containers/_morris_plot.py index e82e050e6..6e160d738 100644 --- a/webviz_subsurface/containers/_morris_plot.py +++ b/webviz_subsurface/containers/_morris_plot.py @@ -6,10 +6,11 @@ from dash.dependencies import Input, Output from webviz_config.webviz_store import webvizstore from webviz_config.common_cache import cache +from webviz_config.containers import WebvizContainer from webviz_subsurface_components import Morris -class MorrisPlot: +class MorrisPlot(WebvizContainer): '''### Morris This container renders a visualization of the Morris sampling method. diff --git a/webviz_subsurface/containers/_parameter_distribution.py b/webviz_subsurface/containers/_parameter_distribution.py index 234a04044..008a01401 100644 --- a/webviz_subsurface/containers/_parameter_distribution.py +++ b/webviz_subsurface/containers/_parameter_distribution.py @@ -6,6 +6,7 @@ import dash_daq as daq from webviz_config.webviz_store import webvizstore from webviz_config.common_cache import cache +from webviz_config.containers import WebvizContainer from ..datainput import scratch_ensemble @@ -19,7 +20,7 @@ def dropdown_from_dict(dom_id, d): value=list(d.values())[0]) -class ParameterDistribution: +class ParameterDistribution(WebvizContainer): '''### Parameter distribution This container shows parameter distribution as histogram, diff --git a/webviz_subsurface/containers/_subsurface_map.py b/webviz_subsurface/containers/_subsurface_map.py index b8f87343d..deee308c1 100644 --- a/webviz_subsurface/containers/_subsurface_map.py +++ b/webviz_subsurface/containers/_subsurface_map.py @@ -4,11 +4,12 @@ import dash_html_components as html from webviz_config.webviz_store import webvizstore from webviz_config.common_cache import cache +from webviz_config.containers import WebvizContainer from webviz_subsurface_components import Map from ..datainput import scratch_ensemble -class SubsurfaceMap: +class SubsurfaceMap(WebvizContainer): '''### Subsurface map This container visualizes the subsurface. Currently only supporting reservoir diff --git a/webviz_subsurface/containers/_summary_stats.py b/webviz_subsurface/containers/_summary_stats.py index 489107443..e38a24be1 100644 --- a/webviz_subsurface/containers/_summary_stats.py +++ b/webviz_subsurface/containers/_summary_stats.py @@ -6,10 +6,11 @@ from webviz_plotly.graph_objs import FanChart from webviz_config.webviz_store import webvizstore from webviz_config.common_cache import cache +from webviz_config.containers import WebvizContainer from ..datainput import scratch_ensemble -class SummaryStats: +class SummaryStats(WebvizContainer): '''### Summary statistics This container visualizes simulation profiles, both per realization and