From b6244d9ff57e11ae88ea80d18d109d21942591dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Fredrik=20Ki=C3=A6r?= <31612826+anders-kiaer@users.noreply.github.com> Date: Wed, 8 Jan 2020 13:26:20 +0100 Subject: [PATCH] Rename from container (#188) --- setup.py | 32 +++++++++---------- .../integration_tests/test_parameter_corr.py | 4 +-- .../test_surface_selector.py | 2 +- .../__init__.py | 0 .../surface_selector.py | 0 .../tornado_plot.py | 12 +++---- .../{containers => plugins}/__init__.py | 8 ++--- .../{containers => plugins}/_disk_usage.py | 12 ++++--- .../{containers => plugins}/_history_match.py | 10 +++--- .../_inplace_volumes.py | 11 ++++--- .../_inplace_volumes_onebyone.py | 8 +++-- .../{containers => plugins}/_intersect.py | 12 ++++--- .../{containers => plugins}/_morris_plot.py | 10 +++--- .../_parameter_correlation.py | 8 +++-- .../_parameter_distribution.py | 8 +++-- .../_parameter_response_correlation.py | 8 +++-- .../_reservoir_simulation_timeseries.py | 9 ++++-- ...eservoir_simulation_timeseries_onebyone.py | 8 +++-- .../{containers => plugins}/_segy_viewer.py | 9 ++++-- .../_subsurface_map.py | 10 +++--- .../_well_cross_section.py | 7 ++-- 21 files changed, 110 insertions(+), 78 deletions(-) rename webviz_subsurface/{_private_containers => _private_plugins}/__init__.py (100%) rename webviz_subsurface/{_private_containers => _private_plugins}/surface_selector.py (100%) rename webviz_subsurface/{_private_containers => _private_plugins}/tornado_plot.py (97%) rename webviz_subsurface/{containers => plugins}/__init__.py (88%) rename webviz_subsurface/{containers => plugins}/_disk_usage.py (92%) rename webviz_subsurface/{containers => plugins}/_history_match.py (95%) rename webviz_subsurface/{containers => plugins}/_inplace_volumes.py (98%) rename webviz_subsurface/{containers => plugins}/_inplace_volumes_onebyone.py (99%) rename webviz_subsurface/{containers => plugins}/_intersect.py (98%) rename webviz_subsurface/{containers => plugins}/_morris_plot.py (92%) rename webviz_subsurface/{containers => plugins}/_parameter_correlation.py (98%) rename webviz_subsurface/{containers => plugins}/_parameter_distribution.py (97%) rename webviz_subsurface/{containers => plugins}/_parameter_response_correlation.py (99%) rename webviz_subsurface/{containers => plugins}/_reservoir_simulation_timeseries.py (99%) rename webviz_subsurface/{containers => plugins}/_reservoir_simulation_timeseries_onebyone.py (98%) rename webviz_subsurface/{containers => plugins}/_segy_viewer.py (99%) rename webviz_subsurface/{containers => plugins}/_subsurface_map.py (96%) rename webviz_subsurface/{containers => plugins}/_well_cross_section.py (98%) diff --git a/setup.py b/setup.py index 2ae042aa7..5ecbd0812 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name="webviz-subsurface", - description="Webviz config containers for subsurface data", + description="Webviz config plugins for subsurface data", long_description=LONG_DESCRIPTION, long_description_content_type="text/markdown", url="https://github.com/equinor/webviz-subsurface", @@ -15,24 +15,24 @@ packages=find_packages(exclude=["tests"]), package_data={"webviz_subsurface": ["_abbreviations/*.json"]}, entry_points={ - "webviz_config_containers": [ - "ParameterDistribution = webviz_subsurface.containers:ParameterDistribution", - "ParameterCorrelation = webviz_subsurface.containers:ParameterCorrelation", + "webviz_config_plugins": [ + "ParameterDistribution = webviz_subsurface.plugins:ParameterDistribution", + "ParameterCorrelation = webviz_subsurface.plugins:ParameterCorrelation", "ParameterResponseCorrelation = " - + "webviz_subsurface.containers:ParameterResponseCorrelation", - "DiskUsage = webviz_subsurface.containers:DiskUsage", - "SubsurfaceMap = webviz_subsurface.containers:SubsurfaceMap", - "HistoryMatch = webviz_subsurface.containers:HistoryMatch", - "Intersect = webviz_subsurface.containers:Intersect", - "MorrisPlot = webviz_subsurface.containers:MorrisPlot", - "InplaceVolumes = webviz_subsurface.containers:InplaceVolumes", - "InplaceVolumesOneByOne = webviz_subsurface.containers:InplaceVolumesOneByOne", + + "webviz_subsurface.plugins:ParameterResponseCorrelation", + "DiskUsage = webviz_subsurface.plugins:DiskUsage", + "SubsurfaceMap = webviz_subsurface.plugins:SubsurfaceMap", + "HistoryMatch = webviz_subsurface.plugins:HistoryMatch", + "Intersect = webviz_subsurface.plugins:Intersect", + "MorrisPlot = webviz_subsurface.plugins:MorrisPlot", + "InplaceVolumes = webviz_subsurface.plugins:InplaceVolumes", + "InplaceVolumesOneByOne = webviz_subsurface.plugins:InplaceVolumesOneByOne", "ReservoirSimulationTimeSeries = " - + "webviz_subsurface.containers:ReservoirSimulationTimeSeries", + + "webviz_subsurface.plugins:ReservoirSimulationTimeSeries", "ReservoirSimulationTimeSeriesOneByOne = " - + "webviz_subsurface.containers:ReservoirSimulationTimeSeriesOneByOne", - "SegyViewer = webviz_subsurface.containers:SegyViewer", - "WellCrossSection = webviz_subsurface.containers:WellCrossSection", + + "webviz_subsurface.plugins:ReservoirSimulationTimeSeriesOneByOne", + "SegyViewer = webviz_subsurface.plugins:SegyViewer", + "WellCrossSection = webviz_subsurface.plugins:WellCrossSection", ] }, install_requires=[ diff --git a/tests/integration_tests/test_parameter_corr.py b/tests/integration_tests/test_parameter_corr.py index 4c231f784..f7aff6398 100644 --- a/tests/integration_tests/test_parameter_corr.py +++ b/tests/integration_tests/test_parameter_corr.py @@ -2,10 +2,10 @@ import dash import pandas as pd from webviz_config.common_cache import CACHE -from webviz_config.containers import ParameterCorrelation +from webviz_config.plugins import ParameterCorrelation # mocked functions -get_parameters = "webviz_subsurface.containers._parameter_correlation.get_parameters" +get_parameters = "webviz_subsurface.plugins._parameter_correlation.get_parameters" def test_parameter_corr(dash_duo): diff --git a/tests/integration_tests/test_surface_selector.py b/tests/integration_tests/test_surface_selector.py index 1fa0e7f69..e1e65bf50 100644 --- a/tests/integration_tests/test_surface_selector.py +++ b/tests/integration_tests/test_surface_selector.py @@ -3,7 +3,7 @@ import dash from dash.dependencies import Input, Output import dash_html_components as html -from webviz_subsurface._private_containers.surface_selector import SurfaceSelector +from webviz_subsurface._private_plugins.surface_selector import SurfaceSelector surface_context = { diff --git a/webviz_subsurface/_private_containers/__init__.py b/webviz_subsurface/_private_plugins/__init__.py similarity index 100% rename from webviz_subsurface/_private_containers/__init__.py rename to webviz_subsurface/_private_plugins/__init__.py diff --git a/webviz_subsurface/_private_containers/surface_selector.py b/webviz_subsurface/_private_plugins/surface_selector.py similarity index 100% rename from webviz_subsurface/_private_containers/surface_selector.py rename to webviz_subsurface/_private_plugins/surface_selector.py diff --git a/webviz_subsurface/_private_containers/tornado_plot.py b/webviz_subsurface/_private_plugins/tornado_plot.py similarity index 97% rename from webviz_subsurface/_private_containers/tornado_plot.py rename to webviz_subsurface/_private_plugins/tornado_plot.py index b25d0a598..7b33bc9ed 100644 --- a/webviz_subsurface/_private_containers/tornado_plot.py +++ b/webviz_subsurface/_private_plugins/tornado_plot.py @@ -15,15 +15,15 @@ class TornadoPlot: """### TornadoPlot -This private container visualizes a Tornado plot. -It is meant to be used as a component in other containers. -The container is initialized with a dataframe of realizations with corresponding sensitivities, +This private plugin visualizes a Tornado plot. +It is meant to be used as a component in other plugin, and is initialized + with a dataframe of realizations with corresponding sensitivities, but without the response values that are to be plotted. -Instead the container registers a dcc.Store which will contain the response values. +Instead we registers a dcc.Store which will contain the response values. To use: -1. Initialize an instance of this class in a container -2. Add tornadoplot.layout to the container layout +1. Initialize an instance of this class in a plugin. +2. Add tornadoplot.layout to the plugin layout 3. Register a callback that writes a json dump to tornadoplot.storage_id The format of the json dump must be: {'ENSEMBLE': name of ensemble, diff --git a/webviz_subsurface/containers/__init__.py b/webviz_subsurface/plugins/__init__.py similarity index 88% rename from webviz_subsurface/containers/__init__.py rename to webviz_subsurface/plugins/__init__.py index 53d726e7c..0a7cc4e77 100644 --- a/webviz_subsurface/containers/__init__.py +++ b/webviz_subsurface/plugins/__init__.py @@ -1,8 +1,8 @@ -"""### _Subsurface specific containers_ +"""### _Subsurface specific plugins_ -These are containers relevant within subsurface workflows. Most of them +These are plugins relevant within subsurface workflows. Most of them rely on the setting `scratch_ensemble` configuration within the -`container_settings`. +`plugin_settings`. I.e. you could have ```yaml title: Reek Webviz Demonstration @@ -16,7 +16,7 @@ - title: Front page content: - - container: ReservoirSimulationTimeSeries + - plugin: ReservoirSimulationTimeSeries ensembles: - iter-0 - iter-1 diff --git a/webviz_subsurface/containers/_disk_usage.py b/webviz_subsurface/plugins/_disk_usage.py similarity index 92% rename from webviz_subsurface/containers/_disk_usage.py rename to webviz_subsurface/plugins/_disk_usage.py index cbbd401b6..2795a248c 100644 --- a/webviz_subsurface/containers/_disk_usage.py +++ b/webviz_subsurface/plugins/_disk_usage.py @@ -8,23 +8,25 @@ from dash.dependencies import Input, Output from webviz_config.webviz_store import webvizstore from webviz_config.common_cache import CACHE -from webviz_config import WebvizContainerABC +from webviz_config import WebvizPluginABC -class DiskUsage(WebvizContainerABC): +class DiskUsage(WebvizPluginABC): """### Disk usage -This container adds functionality for standard visualization of disk usage in -FMU projects. It adds a dashboard element where the user can choose between +Adds functionality for standard visualization of disk usage in FMU projects. +It adds a dashboard element where the user can choose between showing disk usage, per user, either as a pie chart or as a bar chart. * `scratch_dir`: Path to the directory you want to show disk usage for, e.g. `/scratch/fmu`. -* `title`: Optional title for the container. +* `title`: Optional title for the plugin. """ def __init__(self, app, scratch_dir: str): + super().__init__() + self.scratch_dir = scratch_dir self.chart_id = "chart-id-{}".format(uuid4()) self.plot_type_id = "plot-type-id-{}".format(uuid4()) diff --git a/webviz_subsurface/containers/_history_match.py b/webviz_subsurface/plugins/_history_match.py similarity index 95% rename from webviz_subsurface/containers/_history_match.py rename to webviz_subsurface/plugins/_history_match.py index e9e850639..09553a030 100644 --- a/webviz_subsurface/containers/_history_match.py +++ b/webviz_subsurface/plugins/_history_match.py @@ -6,23 +6,25 @@ from scipy.stats import chi2 import dash_html_components as html import webviz_subsurface_components as wsc -from webviz_config import WebvizContainerABC +from webviz_config import WebvizPluginABC from .._datainput.history_match import extract_mismatch -class HistoryMatch(WebvizContainerABC): +class HistoryMatch(WebvizPluginABC): """### History match -This container visualizes the quality of the history match. +Visualizes the quality of the history match. * `ensembles`: List of the ensembles in `shared_settings` to visualize. * `observation_File`: Path to the observation `.yaml` file. -* `title`: Optional title for the container. +* `title`: Optional title for the plugin. """ def __init__(self, app, ensembles, observation_file: Path): + super().__init__() + self.observation_file = observation_file self.ens_paths = { ens: app.webviz_settings["shared_settings"]["scratch_ensembles"][ens] diff --git a/webviz_subsurface/containers/_inplace_volumes.py b/webviz_subsurface/plugins/_inplace_volumes.py similarity index 98% rename from webviz_subsurface/containers/_inplace_volumes.py rename to webviz_subsurface/plugins/_inplace_volumes.py index 7b6c6ff4d..688680b7a 100644 --- a/webviz_subsurface/containers/_inplace_volumes.py +++ b/webviz_subsurface/plugins/_inplace_volumes.py @@ -10,20 +10,20 @@ import webviz_core_components as wcc from webviz_config.common_cache import CACHE from webviz_config.webviz_store import webvizstore -from webviz_config import WebvizContainerABC +from webviz_config import WebvizPluginABC from .._datainput.inplace_volumes import extract_volumes from .._abbreviations import VOLUME_TERMINOLOGY -class InplaceVolumes(WebvizContainerABC): +class InplaceVolumes(WebvizPluginABC): """### InplaceVolumes -This container visualizes inplace volumetrics results from +This plugin visualizes inplace volumetrics results from FMU ensembles. Input can be given either as aggregated csv files for volumes or or as an ensemble name -defined in *container_settings* and volumetric csv files stored per realizations. +defined in *plugin_settings* and volumetric csv files stored per realizations. #### Volumetric input @@ -78,6 +78,9 @@ def __init__( volfolder: str = "share/results/volumes", response: str = "STOIIP_OIL", ): + + super().__init__() + self.csvfile = csvfile if csvfile else None self.colorway = app.webviz_settings.get("plotly_layout", {}).get("colorway", []) if csvfile and ensembles: diff --git a/webviz_subsurface/containers/_inplace_volumes_onebyone.py b/webviz_subsurface/plugins/_inplace_volumes_onebyone.py similarity index 99% rename from webviz_subsurface/containers/_inplace_volumes_onebyone.py rename to webviz_subsurface/plugins/_inplace_volumes_onebyone.py index a76f606c6..8e260b5c5 100644 --- a/webviz_subsurface/containers/_inplace_volumes_onebyone.py +++ b/webviz_subsurface/plugins/_inplace_volumes_onebyone.py @@ -9,17 +9,17 @@ import dash_core_components as dcc from dash.dependencies import Input, Output, State import webviz_core_components as wcc -from webviz_config import WebvizContainerABC +from webviz_config import WebvizPluginABC from webviz_config.common_cache import CACHE from webviz_config.webviz_store import webvizstore -from .._private_containers.tornado_plot import TornadoPlot +from .._private_plugins.tornado_plot import TornadoPlot from .._datainput.inplace_volumes import extract_volumes from .._datainput.fmu_input import get_realizations from .._abbreviations import VOLUME_TERMINOLOGY -class InplaceVolumesOneByOne(WebvizContainerABC): +class InplaceVolumesOneByOne(WebvizPluginABC): # pylint: disable=too-many-instance-attributes """### InplaceVolumesOneByOne @@ -104,6 +104,8 @@ def __init__( response: str = "STOIIP_OIL", ): + super().__init__() + self.csvfile_vol = csvfile_vol if csvfile_vol else None self.csvfile_reals = csvfile_reals if csvfile_reals else None diff --git a/webviz_subsurface/containers/_intersect.py b/webviz_subsurface/plugins/_intersect.py similarity index 98% rename from webviz_subsurface/containers/_intersect.py rename to webviz_subsurface/plugins/_intersect.py index cb69dee4c..046e0bfa5 100644 --- a/webviz_subsurface/containers/_intersect.py +++ b/webviz_subsurface/plugins/_intersect.py @@ -10,16 +10,16 @@ from dash.dependencies import Input, Output, State from dash_table import DataTable from webviz_config.common_cache import CACHE -from webviz_config import WebvizContainerABC +from webviz_config import WebvizPluginABC from .._datainput.fmu_input import scratch_ensemble from .._datainput.intersect import load_surface, get_wfence, get_hfence -class Intersect(WebvizContainerABC): +class Intersect(WebvizPluginABC): """### Intersect -This container visualizes surfaces intersected along a well path. +This plugin visualizes surfaces intersected along a well path. The input are surfaces from a FMU ensemble stored on standardized format with standardized naming (share/results/maps/name--category.gri) and a folder of well files stored in RMS well format. @@ -65,7 +65,7 @@ class Intersect(WebvizContainerABC): def __init__( self, app, - container_settings, + plugin_settings, ensemble, well_path, surface_cat, @@ -73,8 +73,10 @@ def __init__( well_suffix=".rmswell", ): + super().__init__() + self.well_path = well_path - self.ensemble_path = container_settings["scratch_ensembles"][ensemble] + self.ensemble_path = plugin_settings["scratch_ensembles"][ensemble] self.ensemble = scratch_ensemble(ensemble, self.ensemble_path) self.well_suffix = well_suffix self.surface_cat = surface_cat diff --git a/webviz_subsurface/containers/_morris_plot.py b/webviz_subsurface/plugins/_morris_plot.py similarity index 92% rename from webviz_subsurface/containers/_morris_plot.py rename to webviz_subsurface/plugins/_morris_plot.py index f03689cd9..bd712f409 100644 --- a/webviz_subsurface/containers/_morris_plot.py +++ b/webviz_subsurface/plugins/_morris_plot.py @@ -8,23 +8,25 @@ from webviz_subsurface_components import Morris from webviz_config.webviz_store import webvizstore from webviz_config.common_cache import CACHE -from webviz_config import WebvizContainerABC +from webviz_config import WebvizPluginABC -class MorrisPlot(WebvizContainerABC): +class MorrisPlot(WebvizPluginABC): """### Morris -This container renders a visualization of the Morris sampling method. +Renders a visualization of the Morris sampling method. The Morris method can be used to screen parameters for how they influence model response, both individually and through interaction effect with other parameters. * `csv_file`: Input data -* `title`: Optional title for the container. +* `title`: Optional title for the plugin. """ def __init__(self, app, csv_file: Path): + super().__init__() + self.graph_id = "graph-{}".format(uuid4()) self.vector_id = "vector-{}".format(uuid4()) self.csv_file = csv_file diff --git a/webviz_subsurface/containers/_parameter_correlation.py b/webviz_subsurface/plugins/_parameter_correlation.py similarity index 98% rename from webviz_subsurface/containers/_parameter_correlation.py rename to webviz_subsurface/plugins/_parameter_correlation.py index 81acd9e0c..7306be932 100644 --- a/webviz_subsurface/containers/_parameter_correlation.py +++ b/webviz_subsurface/plugins/_parameter_correlation.py @@ -8,7 +8,7 @@ from dash.dependencies import Input, Output from webviz_config.webviz_store import webvizstore from webviz_config.common_cache import CACHE -from webviz_config import WebvizContainerABC +from webviz_config import WebvizPluginABC from .._datainput.fmu_input import scratch_ensemble @@ -24,10 +24,10 @@ def dropdown_from_dict(dom_id, dictionary): ) -class ParameterCorrelation(WebvizContainerABC): +class ParameterCorrelation(WebvizPluginABC): """### Parameter correlation -This container shows parameter correlation using a correlation matrix, +Shows parameter correlation using a correlation matrix, and scatter plot for any given pair of parameters. * `ensembles`: Which ensembles in `shared_settings` to visualize. @@ -36,6 +36,8 @@ class ParameterCorrelation(WebvizContainerABC): def __init__(self, app, ensembles, drop_constants: bool = True): + super().__init__() + self.ensembles = { ens: app.webviz_settings["shared_settings"]["scratch_ensembles"][ens] for ens in ensembles diff --git a/webviz_subsurface/containers/_parameter_distribution.py b/webviz_subsurface/plugins/_parameter_distribution.py similarity index 97% rename from webviz_subsurface/containers/_parameter_distribution.py rename to webviz_subsurface/plugins/_parameter_distribution.py index 5c92822c0..f1b63912d 100644 --- a/webviz_subsurface/containers/_parameter_distribution.py +++ b/webviz_subsurface/plugins/_parameter_distribution.py @@ -9,17 +9,17 @@ import dash_html_components as html import dash_core_components as dcc import webviz_core_components as wcc -from webviz_config import WebvizContainerABC +from webviz_config import WebvizPluginABC from webviz_config.common_cache import CACHE from webviz_config.webviz_store import webvizstore from .._datainput.fmu_input import load_parameters -class ParameterDistribution(WebvizContainerABC): +class ParameterDistribution(WebvizPluginABC): """### ParameterDistribution -This container shows parameter distributions for FMU ensembles. +Shows parameter distributions for FMU ensembles. Parameters are visualized per ensemble as a histogram, and as a boxplot showing the parameter ranges for each ensemble. Input can be given either as an aggregated csv files with parameter information @@ -31,6 +31,8 @@ class ParameterDistribution(WebvizContainerABC): def __init__(self, app, csvfile: Path = None, ensembles: list = None): + super().__init__() + self.csvfile = csvfile if csvfile else None if csvfile and ensembles: diff --git a/webviz_subsurface/containers/_parameter_response_correlation.py b/webviz_subsurface/plugins/_parameter_response_correlation.py similarity index 99% rename from webviz_subsurface/containers/_parameter_response_correlation.py rename to webviz_subsurface/plugins/_parameter_response_correlation.py index b74b272fa..52defcf48 100644 --- a/webviz_subsurface/containers/_parameter_response_correlation.py +++ b/webviz_subsurface/plugins/_parameter_response_correlation.py @@ -11,15 +11,15 @@ import webviz_core_components as wcc from webviz_config.webviz_store import webvizstore from webviz_config.common_cache import CACHE -from webviz_config import WebvizContainerABC +from webviz_config import WebvizPluginABC from .._datainput.fmu_input import load_parameters, load_csv -class ParameterResponseCorrelation(WebvizContainerABC): +class ParameterResponseCorrelation(WebvizPluginABC): """### Parameter and response correlation -This container shows correlation between numerical input parameters and responses. +This plugin shows correlation between numerical input parameters and responses. Input can be given either as: @@ -68,6 +68,8 @@ def __init__( corr_method: str = "pearson", ): + super().__init__() + self.parameter_csv = parameter_csv if parameter_csv else None self.response_csv = response_csv if response_csv else None self.response_file = response_file if response_file else None diff --git a/webviz_subsurface/containers/_reservoir_simulation_timeseries.py b/webviz_subsurface/plugins/_reservoir_simulation_timeseries.py similarity index 99% rename from webviz_subsurface/containers/_reservoir_simulation_timeseries.py rename to webviz_subsurface/plugins/_reservoir_simulation_timeseries.py index 21b10fd3d..33f2073cc 100644 --- a/webviz_subsurface/containers/_reservoir_simulation_timeseries.py +++ b/webviz_subsurface/plugins/_reservoir_simulation_timeseries.py @@ -10,7 +10,7 @@ import dash_html_components as html import dash_core_components as dcc import webviz_core_components as wcc -from webviz_config import WebvizContainerABC +from webviz_config import WebvizPluginABC from webviz_config.webviz_store import webvizstore from webviz_config.common_cache import CACHE @@ -18,12 +18,12 @@ from .._abbreviations import simulation_vector_description -class ReservoirSimulationTimeSeries(WebvizContainerABC): +class ReservoirSimulationTimeSeries(WebvizPluginABC): """### ReservoirSimulationTimeSeries Visualizes reservoir simulation time series for FMU ensembles. Input can be given either as aggregated csv file or an ensemble defined -in container settings. +in plugin settings. * `csvfile`: Aggregated csvfile for unsmry with 'REAL', 'ENSEMBLE', 'DATE' and vector columns * `ensembles`: Which ensembles in `shared_settings` to visualize. @@ -54,6 +54,9 @@ def __init__( sampling: str = "monthly", options: dict = None, ): + + super().__init__() + self.csvfile = csvfile self.obsfile = obsfile self.time_index = sampling diff --git a/webviz_subsurface/containers/_reservoir_simulation_timeseries_onebyone.py b/webviz_subsurface/plugins/_reservoir_simulation_timeseries_onebyone.py similarity index 98% rename from webviz_subsurface/containers/_reservoir_simulation_timeseries_onebyone.py rename to webviz_subsurface/plugins/_reservoir_simulation_timeseries_onebyone.py index b18a61109..d23c21610 100644 --- a/webviz_subsurface/containers/_reservoir_simulation_timeseries_onebyone.py +++ b/webviz_subsurface/plugins/_reservoir_simulation_timeseries_onebyone.py @@ -11,17 +11,17 @@ import dash_core_components as dcc from dash_table import DataTable import webviz_core_components as wcc -from webviz_config import WebvizContainerABC +from webviz_config import WebvizPluginABC from webviz_config.common_cache import CACHE from webviz_config.webviz_store import webvizstore -from .._private_containers.tornado_plot import TornadoPlot +from .._private_plugins.tornado_plot import TornadoPlot from .._datainput.fmu_input import load_smry, get_realizations from .._abbreviations import simulation_vector_description # pylint: disable=too-many-instance-attributes -class ReservoirSimulationTimeSeriesOneByOne(WebvizContainerABC): +class ReservoirSimulationTimeSeriesOneByOne(WebvizPluginABC): """### ReservoirSimulationTimeSeriesOneByOne Visualizes reservoir simulation time series for sensitivity studies. @@ -89,6 +89,8 @@ def __init__( sampling: str = "monthly", ): + super().__init__() + self.time_index = sampling self.column_keys = column_keys self.csvfile_smry = csvfile_smry diff --git a/webviz_subsurface/containers/_segy_viewer.py b/webviz_subsurface/plugins/_segy_viewer.py similarity index 99% rename from webviz_subsurface/containers/_segy_viewer.py rename to webviz_subsurface/plugins/_segy_viewer.py index 8c5ebe134..f97a49641 100644 --- a/webviz_subsurface/containers/_segy_viewer.py +++ b/webviz_subsurface/plugins/_segy_viewer.py @@ -9,16 +9,16 @@ import dash_html_components as html import dash_core_components as dcc import webviz_core_components as wcc -from webviz_config import WebvizContainerABC +from webviz_config import WebvizPluginABC from webviz_config.webviz_store import webvizstore from .._datainput.seismic import load_cube_data, get_iline, get_xline, get_zslice -class SegyViewer(WebvizContainerABC): +class SegyViewer(WebvizPluginABC): """### SegyViewer -Inspired by [SegyViewer for Python](https://github.com/equinor/segyviewer) this container +Inspired by [SegyViewer for Python](https://github.com/equinor/segyviewer) this plugin visualizes seismic 3D cubes with 3 plots (inline, crossline and zslice). The plots are linked and updates are done by clicking in the plots. @@ -30,6 +30,9 @@ class SegyViewer(WebvizContainerABC): def __init__( self, app, segyfiles: List[Path], zunit="depth (m)", colors: list = None ): + + super().__init__() + self.zunit = zunit self.segyfiles = [str(segy) for segy in segyfiles] self.initial_colors = ( diff --git a/webviz_subsurface/containers/_subsurface_map.py b/webviz_subsurface/plugins/_subsurface_map.py similarity index 96% rename from webviz_subsurface/containers/_subsurface_map.py rename to webviz_subsurface/plugins/_subsurface_map.py index 012bdc50d..db7b5b16d 100644 --- a/webviz_subsurface/containers/_subsurface_map.py +++ b/webviz_subsurface/plugins/_subsurface_map.py @@ -7,15 +7,15 @@ from webviz_subsurface_components import Map from webviz_config.webviz_store import webvizstore from webviz_config.common_cache import CACHE -from webviz_config import WebvizContainerABC +from webviz_config import WebvizPluginABC from .._datainput.fmu_input import scratch_ensemble -class SubsurfaceMap(WebvizContainerABC): +class SubsurfaceMap(WebvizPluginABC): """### Subsurface map -This container visualizes reservoir grids in a map view, additionally it can +This plugin visualizes reservoir grids in a map view, additionally it can visualize the flow pattern in the simulation output using streamlines. Input can be either a premade json object or data can be extracted from a FMU ensemble. @@ -26,7 +26,7 @@ class SubsurfaceMap(WebvizContainerABC): * `flow_value`: Which property to use for the streamlines animation (e.g. `FLOWAT`). * `time_step`: Which report or time step to use in the simulation output. -* `title`: Optional title for the container. +* `title`: Optional title for the plugin. """ def __init__( @@ -39,6 +39,8 @@ def __init__( time_step=None, ): + super().__init__() + self.jsonfile = jsonfile if jsonfile else None if jsonfile and ensemble: diff --git a/webviz_subsurface/containers/_well_cross_section.py b/webviz_subsurface/plugins/_well_cross_section.py similarity index 98% rename from webviz_subsurface/containers/_well_cross_section.py rename to webviz_subsurface/plugins/_well_cross_section.py index b9b476c29..886a2e25b 100644 --- a/webviz_subsurface/containers/_well_cross_section.py +++ b/webviz_subsurface/plugins/_well_cross_section.py @@ -8,7 +8,7 @@ import dash_core_components as dcc import webviz_core_components as wcc from webviz_subsurface_components import LayeredMap -from webviz_config import WebvizContainerABC +from webviz_config import WebvizPluginABC from webviz_config.webviz_store import webvizstore from .._datainput.xsection import XSectionFigure @@ -17,7 +17,7 @@ from .._datainput.surface import load_surface, make_surface_layer -class WellCrossSection(WebvizContainerABC): +class WellCrossSection(WebvizPluginABC): """### WellCrossSection Displays a cross section along a well with intersected surfaces, and optionally seismic cubes. @@ -52,6 +52,9 @@ def __init__( nextend: int = 2, sampling: int = 40, ): + + super().__init__() + self.zunit = zunit self.sampling = sampling self.nextend = nextend