webviz-subsurface 0.2.34__py3-none-any.whl → 0.2.35__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. webviz_subsurface/_providers/ensemble_grid_provider/_xtgeo_to_vtk_explicit_structured_grid.py +1 -1
  2. webviz_subsurface/_providers/ensemble_grid_provider/grid_viz_service.py +3 -3
  3. webviz_subsurface/_providers/ensemble_summary_provider/_provider_impl_arrow_lazy.py +2 -2
  4. webviz_subsurface/_providers/ensemble_summary_provider/_provider_impl_arrow_presampled.py +1 -1
  5. webviz_subsurface/_providers/ensemble_summary_provider/_resampling.py +30 -22
  6. webviz_subsurface/_providers/ensemble_surface_provider/_provider_impl_file.py +1 -17
  7. webviz_subsurface/_providers/ensemble_surface_provider/_surface_to_float32_array.py +1 -1
  8. webviz_subsurface/plugins/_bhp_qc/views/_view_functions.py +1 -1
  9. webviz_subsurface/plugins/_co2_leakage/_utilities/plume_extent.py +1 -1
  10. webviz_subsurface/plugins/_co2_leakage/views/mainview/mainview.py +2 -2
  11. webviz_subsurface/plugins/_grid_viewer_fmu/views/view_3d/view_elements/_vtk_view_3d_element.py +2 -2
  12. webviz_subsurface/plugins/_history_match.py +1 -1
  13. webviz_subsurface/plugins/_map_viewer_fmu/layout.py +2 -2
  14. webviz_subsurface/plugins/_rft_plotter/_plugin.py +5 -0
  15. webviz_subsurface/plugins/_rft_plotter/_utils/_rft_plotter_data_model.py +5 -2
  16. webviz_subsurface/plugins/_running_time_analysis_fmu.py +3 -3
  17. webviz_subsurface/plugins/_well_log_viewer/well_log_viewer.py +1 -1
  18. {webviz_subsurface-0.2.34.dist-info → webviz_subsurface-0.2.35.dist-info}/METADATA +3 -4
  19. {webviz_subsurface-0.2.34.dist-info → webviz_subsurface-0.2.35.dist-info}/RECORD +24 -51
  20. tests/integration_tests/plugin_tests/__init__.py +0 -0
  21. tests/integration_tests/plugin_tests/test_bhp_qc.py +0 -12
  22. tests/integration_tests/plugin_tests/test_history_match.py +0 -18
  23. tests/integration_tests/plugin_tests/test_line_plotter_fmu.py +0 -29
  24. tests/integration_tests/plugin_tests/test_parameter_analysis.py +0 -26
  25. tests/integration_tests/plugin_tests/test_parameter_correlation.py +0 -25
  26. tests/integration_tests/plugin_tests/test_parameter_distribution.py +0 -13
  27. tests/integration_tests/plugin_tests/test_parameter_parallel_coordinates.py +0 -13
  28. tests/integration_tests/plugin_tests/test_parameter_response_correlation.py +0 -15
  29. tests/integration_tests/plugin_tests/test_property_statistics.py +0 -22
  30. tests/integration_tests/plugin_tests/test_pvt_plot.py +0 -15
  31. tests/integration_tests/plugin_tests/test_relative_permeability.py +0 -14
  32. tests/integration_tests/plugin_tests/test_reservoir_simulation_timeseries.py +0 -30
  33. tests/integration_tests/plugin_tests/test_reservoir_simulation_timeseries_onebyone.py +0 -16
  34. tests/integration_tests/plugin_tests/test_reservoir_simulation_timeseries_regional.py +0 -23
  35. tests/integration_tests/plugin_tests/test_rft_plotter.py +0 -43
  36. tests/integration_tests/plugin_tests/test_segy_viewer.py +0 -22
  37. tests/integration_tests/plugin_tests/test_simulation_timeseries_onebyone.py +0 -23
  38. tests/integration_tests/plugin_tests/test_structural_uncertainty.py +0 -244
  39. tests/integration_tests/plugin_tests/test_surface_viewer_fmu.py +0 -21
  40. tests/integration_tests/plugin_tests/test_surface_with_grid_crossection.py +0 -45
  41. tests/integration_tests/plugin_tests/test_surface_with_seismic_crossection.py +0 -35
  42. tests/integration_tests/plugin_tests/test_tornado_plotter_fmu.py +0 -14
  43. tests/integration_tests/plugin_tests/test_vfp_analysis.py +0 -13
  44. tests/integration_tests/plugin_tests/test_volumetric_analysis.py +0 -38
  45. tests/integration_tests/plugin_tests/test_well_log_viewer.py +0 -16
  46. webviz_subsurface/_providers/ensemble_summary_provider/dev_resampling_perf_testing.py +0 -112
  47. {webviz_subsurface-0.2.34.dist-info → webviz_subsurface-0.2.35.dist-info}/LICENSE +0 -0
  48. {webviz_subsurface-0.2.34.dist-info → webviz_subsurface-0.2.35.dist-info}/LICENSE.chromedriver +0 -0
  49. {webviz_subsurface-0.2.34.dist-info → webviz_subsurface-0.2.35.dist-info}/WHEEL +0 -0
  50. {webviz_subsurface-0.2.34.dist-info → webviz_subsurface-0.2.35.dist-info}/entry_points.txt +0 -0
  51. {webviz_subsurface-0.2.34.dist-info → webviz_subsurface-0.2.35.dist-info}/top_level.txt +0 -0
@@ -1,29 +0,0 @@
1
- # pylint: disable=no-name-in-module
2
- from webviz_config.plugins import LinePlotterFMU
3
-
4
-
5
- def test_line_plotter_fmu(dash_duo, app, testdata_folder, shared_settings) -> None:
6
- plugin = LinePlotterFMU(
7
- app,
8
- shared_settings["HM_SETTINGS"],
9
- aggregated_csvfile=testdata_folder
10
- / "reek_test_data"
11
- / "aggregated_data"
12
- / "smry_hm.csv",
13
- aggregated_parameterfile=testdata_folder
14
- / "reek_test_data"
15
- / "aggregated_data"
16
- / "parameters_hm.csv",
17
- observation_file=testdata_folder / "reek_test_data" / "observations.yml",
18
- observation_group="smry",
19
- remap_observation_values={"DATE": "date"},
20
- initial_data={
21
- "x": "DATE",
22
- "y": "FOPR",
23
- "ensembles": ["iter-0", "iter-3"],
24
- "colors": {"iter-0": "red", "iter-3": "blue"},
25
- },
26
- )
27
- app.layout = plugin.layout
28
- dash_duo.start_server(app)
29
- assert not dash_duo.get_logs()
@@ -1,26 +0,0 @@
1
- import warnings
2
-
3
- # pylint: disable=no-name-in-module
4
- from webviz_config.plugins import ParameterAnalysis
5
- from webviz_config.testing import WebvizComposite
6
-
7
-
8
- def test_parameter_analysis(
9
- _webviz_duo: WebvizComposite, shared_settings: dict
10
- ) -> None:
11
- plugin = ParameterAnalysis(
12
- shared_settings["HM_SETTINGS"],
13
- ensembles=shared_settings["HM_ENSEMBLES"],
14
- column_keys=["WWCT:*"],
15
- time_index="monthly",
16
- drop_constants=True,
17
- )
18
- _webviz_duo.start_server(plugin)
19
-
20
- logs = []
21
- for log in _webviz_duo.get_logs() or []:
22
- if "dash_renderer" in log.get("message"):
23
- warnings.warn(log.get("message"))
24
- else:
25
- logs.append(log)
26
- assert not logs
@@ -1,25 +0,0 @@
1
- # pylint: disable=no-name-in-module
2
- from webviz_config.plugins import ParameterCorrelation
3
- from webviz_config.testing import WebvizComposite
4
-
5
-
6
- def test_parameter_correlation(_webviz_duo: WebvizComposite, shared_settings) -> None:
7
- parameter_correlation = ParameterCorrelation(
8
- shared_settings["HM_SETTINGS"],
9
- ensembles=shared_settings["HM_ENSEMBLES"],
10
- )
11
-
12
- _webviz_duo.start_server(parameter_correlation)
13
-
14
- _webviz_duo.toggle_webviz_settings_drawer()
15
- _webviz_duo.toggle_webviz_settings_group(
16
- parameter_correlation.view("paracorr").settings_group_unique_id("settings")
17
- )
18
- # Using str literals directly, not IDs from the plugin as intended because
19
- # the run test did not accept the imports
20
-
21
- my_component_id = _webviz_duo.view_settings_group_unique_component_id(
22
- "paracorr", "settings", "shared-ensemble"
23
- )
24
- _webviz_duo.wait_for_contains_text(my_component_id, "iter-0")
25
- assert not _webviz_duo.get_logs()
@@ -1,13 +0,0 @@
1
- # pylint: disable=no-name-in-module
2
- from webviz_config.plugins import ParameterDistribution
3
-
4
-
5
- def test_parameter_distribution(dash_duo, app, shared_settings) -> None:
6
- plugin = ParameterDistribution(
7
- app,
8
- shared_settings["HM_SETTINGS"],
9
- ensembles=shared_settings["HM_ENSEMBLES"],
10
- )
11
- app.layout = plugin.layout
12
- dash_duo.start_server(app)
13
- assert not dash_duo.get_logs()
@@ -1,13 +0,0 @@
1
- # pylint: disable=no-name-in-module
2
- from webviz_config.plugins import ParameterParallelCoordinates
3
-
4
-
5
- def test_parameter_parallel_coordinates(dash_duo, app, shared_settings) -> None:
6
- plugin = ParameterParallelCoordinates(
7
- app,
8
- shared_settings["HM_SETTINGS"],
9
- ensembles=shared_settings["HM_ENSEMBLES"],
10
- )
11
- app.layout = plugin.layout
12
- dash_duo.start_server(app)
13
- assert not dash_duo.get_logs()
@@ -1,15 +0,0 @@
1
- # pylint: disable=no-name-in-module
2
- from webviz_config.plugins import ParameterResponseCorrelation
3
-
4
-
5
- def test_parameter_response_correlation(dash_duo, app, shared_settings) -> None:
6
- plugin = ParameterResponseCorrelation(
7
- app,
8
- shared_settings["HM_SETTINGS"],
9
- ensembles=shared_settings["HM_ENSEMBLES"],
10
- response_file="share/results/volumes/geogrid--vol.csv",
11
- response_filters={"ZONE": "multi", "REGION": "multi"},
12
- )
13
- app.layout = plugin.layout
14
- dash_duo.start_server(app)
15
- assert not dash_duo.get_logs()
@@ -1,22 +0,0 @@
1
- import warnings
2
-
3
- # pylint: disable=no-name-in-module
4
- from webviz_config.plugins import PropertyStatistics
5
-
6
-
7
- def test_property_statistics(dash_duo, app, shared_settings) -> None:
8
- plugin = PropertyStatistics(
9
- app,
10
- shared_settings["HM_SETTINGS"],
11
- ensembles=shared_settings["HM_ENSEMBLES"],
12
- statistics_file="share/results/tables/grid_property_statistics_geogrid.csv",
13
- )
14
- app.layout = plugin.layout
15
- dash_duo.start_server(app)
16
- logs = []
17
- for log in dash_duo.get_logs() or []:
18
- if "dash_renderer" in log.get("message"):
19
- warnings.warn(log.get("message"))
20
- else:
21
- logs.append(log)
22
- assert not logs
@@ -1,15 +0,0 @@
1
- # pylint: disable=no-name-in-module
2
- from webviz_config.plugins import PvtPlot
3
- from webviz_config.testing import WebvizComposite
4
-
5
-
6
- def test_pvt_plot(_webviz_duo: WebvizComposite, shared_settings: dict) -> None:
7
- plugin = PvtPlot(
8
- shared_settings["HM_SETTINGS"],
9
- ensembles=shared_settings["HM_ENSEMBLES"],
10
- pvt_relative_file_path="share/results/tables/pvt.csv",
11
- )
12
-
13
- _webviz_duo.start_server(plugin)
14
-
15
- assert not _webviz_duo.get_logs()
@@ -1,14 +0,0 @@
1
- # pylint: disable=no-name-in-module
2
- from webviz_config.plugins import RelativePermeability
3
-
4
-
5
- def test_relative_permeability(dash_duo, app, shared_settings) -> None:
6
- plugin = RelativePermeability(
7
- app,
8
- shared_settings["HM_SETTINGS"],
9
- ensembles=shared_settings["HM_ENSEMBLES"],
10
- relpermfile="share/results/tables/relperm.csv",
11
- )
12
- app.layout = plugin.layout
13
- dash_duo.start_server(app)
14
- assert not dash_duo.get_logs()
@@ -1,30 +0,0 @@
1
- import warnings
2
-
3
- # pylint: disable=no-name-in-module
4
- from webviz_config.plugins import ReservoirSimulationTimeSeries
5
-
6
-
7
- def test_reservoir_simulation_timeseries(
8
- dash_duo, app, shared_settings, testdata_folder
9
- ) -> None:
10
- plugin = ReservoirSimulationTimeSeries(
11
- app,
12
- shared_settings["HM_SETTINGS"],
13
- ensembles=shared_settings["HM_ENSEMBLES"],
14
- obsfile=testdata_folder
15
- / "01_drogon_ahm"
16
- / "share"
17
- / "observations"
18
- / "tables"
19
- / "ert_observations.yml",
20
- )
21
- app.layout = plugin.layout
22
- dash_duo.start_server(app)
23
-
24
- logs = []
25
- for log in dash_duo.get_logs() or []:
26
- if "dash_renderer" in log.get("message"):
27
- warnings.warn(log.get("message"))
28
- else:
29
- logs.append(log)
30
- assert not logs
@@ -1,16 +0,0 @@
1
- # pylint: disable=no-name-in-module
2
- from webviz_config.plugins import ReservoirSimulationTimeSeriesOneByOne
3
-
4
-
5
- def test_reservoir_simulation_timeseries_onebyone(
6
- dash_duo, app, shared_settings
7
- ) -> None:
8
- plugin = ReservoirSimulationTimeSeriesOneByOne(
9
- app,
10
- shared_settings["SENS_SETTINGS"],
11
- ensembles=shared_settings["SENS_ENSEMBLES"],
12
- initial_vector="FOPT",
13
- )
14
- app.layout = plugin.layout
15
- dash_duo.start_server(app)
16
- assert not dash_duo.get_logs()
@@ -1,23 +0,0 @@
1
- # pylint: disable=no-name-in-module
2
- from webviz_config.plugins import ReservoirSimulationTimeSeriesRegional
3
-
4
-
5
- def test_reservoir_simulation_timeseries_regional(
6
- dash_duo, app, shared_settings, testdata_folder
7
- ) -> None:
8
- plugin = ReservoirSimulationTimeSeriesRegional(
9
- app,
10
- shared_settings["HM_SETTINGS"],
11
- ensembles=shared_settings["HM_ENSEMBLES"],
12
- fipfile=testdata_folder
13
- / "01_drogon_ahm"
14
- / "realization-0"
15
- / "iter-0"
16
- / "share"
17
- / "results"
18
- / "tables"
19
- / "fip.yml",
20
- )
21
- app.layout = plugin.layout
22
- dash_duo.start_server(app)
23
- assert not dash_duo.get_logs()
@@ -1,43 +0,0 @@
1
- # pylint: disable=no-name-in-module
2
- from webviz_config.plugins import RftPlotter
3
- from webviz_config.testing import WebvizComposite
4
-
5
-
6
- def test_rft_plotter(
7
- _webviz_duo: WebvizComposite, shared_settings, testdata_folder
8
- ) -> None:
9
- plugin = RftPlotter(
10
- shared_settings["HM_SETTINGS"],
11
- ensembles=shared_settings["HM_ENSEMBLES"],
12
- formations=testdata_folder
13
- / "01_drogon_ahm"
14
- / "realization-0"
15
- / "iter-0"
16
- / "share"
17
- / "results"
18
- / "tables"
19
- / "formations_res_only.csv",
20
- faultlines=testdata_folder
21
- / "01_drogon_ahm"
22
- / "realization-0"
23
- / "iter-0"
24
- / "share"
25
- / "results"
26
- / "polygons"
27
- / "toptherys--gl_faultlines_extract_postprocess.csv",
28
- )
29
-
30
- _webviz_duo.start_server(plugin)
31
-
32
- _webviz_duo.toggle_webviz_settings_drawer()
33
- _webviz_duo.toggle_webviz_settings_group(
34
- plugin.view("map-view").settings_group_unique_id("map-settings")
35
- )
36
- # Using str literals directly, not IDs from the plugin as intended because
37
- # the run test did not accept the imports
38
-
39
- my_component_id = _webviz_duo.view_settings_group_unique_component_id(
40
- "map-view", "map-settings", "map-ensemble"
41
- )
42
- _webviz_duo.wait_for_contains_text(my_component_id, "iter-0")
43
- assert not _webviz_duo.get_logs()
@@ -1,22 +0,0 @@
1
- # pylint: disable=no-name-in-module
2
- from webviz_config.plugins import SegyViewer
3
-
4
-
5
- def test_segy_viewer(dash_duo, app, shared_settings, testdata_folder) -> None:
6
- plugin = SegyViewer(
7
- app,
8
- shared_settings["HM_SETTINGS"],
9
- segyfiles=[
10
- testdata_folder
11
- / "01_drogon_ahm"
12
- / "realization-0"
13
- / "iter-0"
14
- / "share"
15
- / "results"
16
- / "seismic"
17
- / "seismic--amplitude_depth--20180701_20180101.segy"
18
- ],
19
- )
20
- app.layout = plugin.layout
21
- dash_duo.start_server(app)
22
- assert not dash_duo.get_logs()
@@ -1,23 +0,0 @@
1
- import warnings
2
-
3
- # pylint: disable=no-name-in-module
4
- from webviz_config.plugins import SimulationTimeSeriesOneByOne
5
- from webviz_config.testing import WebvizComposite
6
-
7
-
8
- def test_simulation_timeseries_onebyone(
9
- _webviz_duo: WebvizComposite, shared_settings: dict
10
- ) -> None:
11
- plugin = SimulationTimeSeriesOneByOne(
12
- webviz_settings=shared_settings["SENS_SETTINGS"],
13
- ensembles=shared_settings["SENS_ENSEMBLES"],
14
- initial_vector="FOPT",
15
- )
16
- _webviz_duo.start_server(plugin)
17
- logs = []
18
- for log in _webviz_duo.get_logs() or []:
19
- if "dash_renderer" in log.get("message"):
20
- warnings.warn(log.get("message"))
21
- else:
22
- logs.append(log)
23
- assert not logs
@@ -1,244 +0,0 @@
1
- import json
2
-
3
- from dash import Input, Output, State, html
4
- from webviz_config import WebvizSettings
5
-
6
- # pylint: disable=no-name-in-module
7
- from webviz_config.plugins import StructuralUncertainty
8
- from webviz_config.themes import default_theme
9
-
10
- # pylint: enable=no-name-in-module
11
-
12
-
13
- def stringify_object_id(uuid) -> str:
14
- """Object ids must be sorted and converted to
15
- css strings to be recognized as dom elements"""
16
- sorted_uuid_obj = json.loads(
17
- json.dumps(
18
- uuid,
19
- sort_keys=True,
20
- separators=(",", ":"),
21
- )
22
- )
23
- string = ["{"]
24
- for idx, (key, value) in enumerate(sorted_uuid_obj.items()):
25
- string.append(f'\\"{key}\\"\\:\\"{value}\\"\\')
26
- if idx == len(sorted_uuid_obj) - 1:
27
- string.append("}")
28
- else:
29
- string.append(",")
30
- return ("").join(string)
31
-
32
-
33
- # pylint: disable=too-many-locals
34
- def test_default_configuration(dash_duo, app, testdata_folder) -> None:
35
- webviz_settings = WebvizSettings(
36
- shared_settings={
37
- "scratch_ensembles": {
38
- "iter-0": str(testdata_folder / "01_drogon_ahm/realization-*/iter-0")
39
- }
40
- },
41
- theme=default_theme,
42
- )
43
- plugin = StructuralUncertainty(
44
- app,
45
- webviz_settings,
46
- ensembles=["iter-0"],
47
- surface_attributes=["ds_extract_postprocess"],
48
- surface_name_filter=[
49
- "topvolon",
50
- "toptherys",
51
- "topvolantis",
52
- "basevolantis",
53
- ],
54
- wellsuffix=".rmswell",
55
- wellfolder=testdata_folder / "observed_data" / "wells",
56
- )
57
-
58
- app.layout = plugin.layout
59
- dash_duo.start_server(app)
60
-
61
- intersection_data_id = plugin.uuid("intersection-data")
62
- dialog_id = plugin.uuid("dialog")
63
- # Check some initialization
64
- # Check dropdowns
65
- for element, return_val in zip(
66
- ["well", "surface_attribute"], ["55_33-1", "ds_extract_postprocess"]
67
- ):
68
- uuid = stringify_object_id(
69
- uuid={"element": element, "id": intersection_data_id}
70
- )
71
- assert dash_duo.wait_for_element(f"#\\{uuid} .Select-value").text == return_val
72
-
73
- # Check Selects
74
- for element, return_val in zip(
75
- ["surface_names"],
76
- [["topvolon", "toptherys", "topvolantis", "basevolantis"]],
77
- ):
78
- uuid = stringify_object_id(
79
- uuid={"element": element, "id": intersection_data_id}
80
- )
81
- assert (
82
- dash_duo.wait_for_element(f"#\\{uuid} select").text.splitlines()
83
- == return_val
84
- )
85
-
86
- # Check Calculation checkbox
87
- uuid = stringify_object_id(
88
- uuid={"element": "calculation", "id": intersection_data_id}
89
- )
90
- calculation_element = dash_duo.driver.find_elements_by_css_selector(
91
- f"#\\{uuid} > label > input"
92
- )
93
- assert len(calculation_element) == len(
94
- ["Min", "Max", "Mean", "Realizations", "Uncertainty envelope"]
95
- )
96
- for checkbox, selected in zip(
97
- calculation_element,
98
- ["true", "true", "true", None, None],
99
- ):
100
- assert checkbox.get_attribute("selected") == selected
101
-
102
- # Check realizations
103
- real_filter_btn_uuid = stringify_object_id(
104
- {
105
- "id": dialog_id,
106
- "dialog_id": "realization-filter",
107
- "element": "button-open",
108
- }
109
- )
110
- real_uuid = stringify_object_id(
111
- uuid={"element": "realizations", "id": intersection_data_id}
112
- )
113
-
114
- ### Open realization filter and check realizations
115
- dash_duo.wait_for_element_by_id(real_filter_btn_uuid).click()
116
- real_selector = dash_duo.wait_for_element_by_id(real_uuid)
117
- assert real_selector.text.splitlines() == ["0", "1"]
118
-
119
- assert not dash_duo.get_logs(), "browser console should contain no error"
120
-
121
-
122
- def test_full_configuration(dash_duo, app, testdata_folder) -> None:
123
- webviz_settings = WebvizSettings(
124
- shared_settings={
125
- "scratch_ensembles": {
126
- "iter-0": str(testdata_folder / "01_drogon_ahm/realization-*/iter-0"),
127
- }
128
- },
129
- theme=default_theme,
130
- )
131
- plugin = StructuralUncertainty(
132
- app,
133
- webviz_settings,
134
- ensembles=["iter-0"],
135
- surface_attributes=["ds_extract_postprocess"],
136
- surface_name_filter=["topvolon", "toptherys", "topvolantis", "basevolantis"],
137
- wellfolder=testdata_folder / "observed_data" / "wells",
138
- wellsuffix=".rmswell",
139
- zonelog="Zone",
140
- initial_settings={
141
- "intersection_data": {
142
- "surface_names": ["topvolon", "toptherys", "topvolantis"],
143
- "surface_attribute": "ds_extract_postprocess",
144
- "ensembles": [
145
- "iter-0",
146
- ],
147
- "calculation": ["Mean", "Min", "Max"],
148
- # - Uncertainty envelope
149
- "well": "55_33-1",
150
- "realizations": [0, 1],
151
- "colors": {
152
- "topvolon": {"iter-0": "#2C82C9"},
153
- "toptherys": {
154
- "iter-0": "#512E34",
155
- },
156
- "topvolantis": {
157
- "iter-0": "#EEE657",
158
- },
159
- },
160
- },
161
- "intersection_layout": {
162
- "yaxis": {
163
- "range": [1700, 1550],
164
- "title": "True vertical depth [m]",
165
- },
166
- "xaxis": {"title": "Lateral distance [m]"},
167
- },
168
- },
169
- )
170
-
171
- app.layout = plugin.layout
172
-
173
- # Injecting a div that will be updated when the plot data stores are
174
- # changed. Since the plot data are stored in LocalStorage and Selenium
175
- # has no functionality to wait for LocalStorage to equal some value we
176
- # instead populate this injected div with some data before we check the content
177
- # of Localstorage.
178
- @app.callback(
179
- Output(plugin.uuid("layout"), "children"),
180
- Input(plugin.uuid("intersection-graph-layout"), "data"),
181
- State(plugin.uuid("layout"), "children"),
182
- )
183
- def _add_or_update_div(data, children):
184
- plot_is_updated = html.Div(
185
- id=plugin.uuid("plot_is_updated"), children=data.get("title")
186
- )
187
- if len(children) == 6:
188
- children[5] = plot_is_updated
189
- else:
190
- children.append(plot_is_updated)
191
-
192
- return children
193
-
194
- dash_duo.start_server(app)
195
-
196
- intersection_data_id = plugin.uuid("intersection-data")
197
-
198
- # Check some initialization
199
- # Check dropdowns
200
- for element, return_val in zip(
201
- ["well", "surface_attribute"], ["55_33-1", "ds_extract_postprocess"]
202
- ):
203
- uuid = stringify_object_id(
204
- uuid={"element": element, "id": intersection_data_id}
205
- )
206
- assert dash_duo.wait_for_text_to_equal(f"#\\{uuid} .Select-value", return_val)
207
-
208
- # Wait for the callbacks to execute
209
- dash_duo.wait_for_text_to_equal(
210
- f'#{plugin.uuid("plot_is_updated")}',
211
- "Intersection along well: 55_33-1",
212
- timeout=30,
213
- )
214
-
215
- # Check that graph data is stored
216
- graph_data = dash_duo.get_session_storage(plugin.uuid("intersection-graph-data"))
217
- assert len(graph_data) == 14
218
- graph_layout = dash_duo.get_session_storage(
219
- plugin.uuid("intersection-graph-layout")
220
- )
221
- assert isinstance(graph_layout, dict)
222
- assert graph_layout.get("title") == "Intersection along well: 55_33-1"
223
-
224
- ### Change well and check graph
225
- well_uuid = stringify_object_id(
226
- uuid={"element": "well", "id": intersection_data_id}
227
- )
228
-
229
- apply_btn = dash_duo.wait_for_element_by_id(
230
- plugin.uuid("apply-intersection-data-selections")
231
- )
232
- well_dropdown = dash_duo.wait_for_element_by_id(well_uuid)
233
- dash_duo.select_dcc_dropdown(well_dropdown, value="55_33-2")
234
- apply_btn.click()
235
-
236
- # dash_duo.wait_for_text_to_equal(
237
- # f'#{plugin.uuid("plot_is_updated")}',
238
- # "Intersection along well: 55_33-1",
239
- # timeout=100,
240
- # )
241
- graph_layout = dash_duo.get_session_storage(
242
- plugin.uuid("intersection-graph-layout")
243
- )
244
- # assert graph_layout.get("title") == "Intersection along well: 55_33-2"
@@ -1,21 +0,0 @@
1
- # pylint: disable=no-name-in-module
2
- from webviz_config.plugins import SurfaceViewerFMU
3
-
4
-
5
- def test_surface_viewer_fmu(dash_duo, app, shared_settings, testdata_folder) -> None:
6
- plugin = SurfaceViewerFMU(
7
- app,
8
- shared_settings["HM_SETTINGS"],
9
- ensembles=shared_settings["HM_ENSEMBLES"],
10
- wellsuffix=".rmswell",
11
- wellfolder=testdata_folder
12
- / "01_drogon_ahm"
13
- / "realization-0"
14
- / "iter-0"
15
- / "share"
16
- / "results"
17
- / "wells",
18
- )
19
- app.layout = plugin.layout
20
- dash_duo.start_server(app)
21
- assert not dash_duo.get_logs()
@@ -1,45 +0,0 @@
1
- # pylint: disable=no-name-in-module
2
- from webviz_config.plugins import SurfaceWithGridCrossSection
3
-
4
-
5
- def test_surface_with_grid_crosssection(
6
- dash_duo, app, shared_settings, testdata_folder
7
- ) -> None:
8
- plugin = SurfaceWithGridCrossSection(
9
- app,
10
- shared_settings["HM_SETTINGS"],
11
- gridfile=(
12
- testdata_folder
13
- / "01_drogon_ahm"
14
- / "realization-0"
15
- / "iter-0"
16
- / "share"
17
- / "results"
18
- / "grids"
19
- / "geogrid.roff"
20
- ),
21
- gridparameterfiles=[
22
- testdata_folder
23
- / "01_drogon_ahm"
24
- / "realization-0"
25
- / "iter-0"
26
- / "share"
27
- / "results"
28
- / "grids"
29
- / "geogrid--phit.roff"
30
- ],
31
- surfacefiles=[
32
- testdata_folder
33
- / "01_drogon_ahm"
34
- / "realization-0"
35
- / "iter-0"
36
- / "share"
37
- / "results"
38
- / "maps"
39
- / "topvolon--ds_extract_geogrid.gri"
40
- ],
41
- surfacenames=["Top Volon"],
42
- )
43
- app.layout = plugin.layout
44
- dash_duo.start_server(app)
45
- assert not dash_duo.get_logs()