webviz-subsurface 0.2.33__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 (66) hide show
  1. webviz_subsurface/_models/parameter_model.py +1 -0
  2. webviz_subsurface/_providers/ensemble_grid_provider/_xtgeo_to_vtk_explicit_structured_grid.py +1 -1
  3. webviz_subsurface/_providers/ensemble_grid_provider/grid_viz_service.py +6 -4
  4. webviz_subsurface/_providers/ensemble_summary_provider/_provider_impl_arrow_lazy.py +2 -2
  5. webviz_subsurface/_providers/ensemble_summary_provider/_provider_impl_arrow_presampled.py +1 -1
  6. webviz_subsurface/_providers/ensemble_summary_provider/_resampling.py +30 -22
  7. webviz_subsurface/_providers/ensemble_surface_provider/_provider_impl_file.py +1 -17
  8. webviz_subsurface/_providers/ensemble_surface_provider/_surface_to_float32_array.py +1 -1
  9. webviz_subsurface/_utils/parameter_response.py +3 -1
  10. webviz_subsurface/plugins/_bhp_qc/views/_view_functions.py +1 -1
  11. webviz_subsurface/plugins/_co2_leakage/_utilities/plume_extent.py +1 -1
  12. webviz_subsurface/plugins/_co2_leakage/views/mainview/mainview.py +2 -2
  13. webviz_subsurface/plugins/_grid_viewer_fmu/views/view_3d/view_elements/_vtk_view_3d_element.py +2 -2
  14. webviz_subsurface/plugins/_history_match.py +1 -1
  15. webviz_subsurface/plugins/_map_viewer_fmu/_tmp_well_pick_provider.py +3 -1
  16. webviz_subsurface/plugins/_map_viewer_fmu/_types.py +1 -0
  17. webviz_subsurface/plugins/_map_viewer_fmu/_utils.py +18 -1
  18. webviz_subsurface/plugins/_map_viewer_fmu/callbacks.py +38 -12
  19. webviz_subsurface/plugins/_map_viewer_fmu/layout.py +32 -18
  20. webviz_subsurface/plugins/_map_viewer_fmu/map_viewer_fmu.py +33 -5
  21. webviz_subsurface/plugins/_rft_plotter/_plugin.py +5 -0
  22. webviz_subsurface/plugins/_rft_plotter/_utils/_rft_plotter_data_model.py +5 -2
  23. webviz_subsurface/plugins/_running_time_analysis_fmu.py +3 -3
  24. webviz_subsurface/plugins/_segy_viewer.py +6 -26
  25. webviz_subsurface/plugins/_surface_with_grid_cross_section.py +3 -16
  26. webviz_subsurface/plugins/_surface_with_seismic_cross_section.py +3 -16
  27. webviz_subsurface/plugins/_volumetric_analysis/controllers/distribution_controllers.py +33 -29
  28. webviz_subsurface/plugins/_volumetric_analysis/controllers/selections_controllers.py +8 -12
  29. webviz_subsurface/plugins/_volumetric_analysis/views/main_view.py +0 -3
  30. webviz_subsurface/plugins/_volumetric_analysis/views/selections_view.py +2 -12
  31. webviz_subsurface/plugins/_volumetric_analysis/volumetric_analysis.py +45 -3
  32. webviz_subsurface/plugins/_well_log_viewer/well_log_viewer.py +1 -1
  33. {webviz_subsurface-0.2.33.dist-info → webviz_subsurface-0.2.35.dist-info}/METADATA +3 -4
  34. {webviz_subsurface-0.2.33.dist-info → webviz_subsurface-0.2.35.dist-info}/RECORD +39 -66
  35. tests/integration_tests/plugin_tests/__init__.py +0 -0
  36. tests/integration_tests/plugin_tests/test_bhp_qc.py +0 -12
  37. tests/integration_tests/plugin_tests/test_history_match.py +0 -18
  38. tests/integration_tests/plugin_tests/test_line_plotter_fmu.py +0 -29
  39. tests/integration_tests/plugin_tests/test_parameter_analysis.py +0 -26
  40. tests/integration_tests/plugin_tests/test_parameter_correlation.py +0 -25
  41. tests/integration_tests/plugin_tests/test_parameter_distribution.py +0 -13
  42. tests/integration_tests/plugin_tests/test_parameter_parallel_coordinates.py +0 -13
  43. tests/integration_tests/plugin_tests/test_parameter_response_correlation.py +0 -15
  44. tests/integration_tests/plugin_tests/test_property_statistics.py +0 -22
  45. tests/integration_tests/plugin_tests/test_pvt_plot.py +0 -15
  46. tests/integration_tests/plugin_tests/test_relative_permeability.py +0 -14
  47. tests/integration_tests/plugin_tests/test_reservoir_simulation_timeseries.py +0 -30
  48. tests/integration_tests/plugin_tests/test_reservoir_simulation_timeseries_onebyone.py +0 -16
  49. tests/integration_tests/plugin_tests/test_reservoir_simulation_timeseries_regional.py +0 -23
  50. tests/integration_tests/plugin_tests/test_rft_plotter.py +0 -43
  51. tests/integration_tests/plugin_tests/test_segy_viewer.py +0 -22
  52. tests/integration_tests/plugin_tests/test_simulation_timeseries_onebyone.py +0 -23
  53. tests/integration_tests/plugin_tests/test_structural_uncertainty.py +0 -244
  54. tests/integration_tests/plugin_tests/test_surface_viewer_fmu.py +0 -21
  55. tests/integration_tests/plugin_tests/test_surface_with_grid_crossection.py +0 -45
  56. tests/integration_tests/plugin_tests/test_surface_with_seismic_crossection.py +0 -35
  57. tests/integration_tests/plugin_tests/test_tornado_plotter_fmu.py +0 -14
  58. tests/integration_tests/plugin_tests/test_vfp_analysis.py +0 -13
  59. tests/integration_tests/plugin_tests/test_volumetric_analysis.py +0 -38
  60. tests/integration_tests/plugin_tests/test_well_log_viewer.py +0 -16
  61. webviz_subsurface/_providers/ensemble_summary_provider/dev_resampling_perf_testing.py +0 -112
  62. {webviz_subsurface-0.2.33.dist-info → webviz_subsurface-0.2.35.dist-info}/LICENSE +0 -0
  63. {webviz_subsurface-0.2.33.dist-info → webviz_subsurface-0.2.35.dist-info}/LICENSE.chromedriver +0 -0
  64. {webviz_subsurface-0.2.33.dist-info → webviz_subsurface-0.2.35.dist-info}/WHEEL +0 -0
  65. {webviz_subsurface-0.2.33.dist-info → webviz_subsurface-0.2.35.dist-info}/entry_points.txt +0 -0
  66. {webviz_subsurface-0.2.33.dist-info → webviz_subsurface-0.2.35.dist-info}/top_level.txt +0 -0
@@ -2,6 +2,7 @@ import json
2
2
  from pathlib import Path
3
3
  from typing import Callable, Dict, List, Optional, Tuple, Union
4
4
 
5
+ import xtgeo
5
6
  from dash import Dash, html
6
7
  from webviz_config import WebvizPluginABC, WebvizSettings
7
8
 
@@ -18,7 +19,8 @@ from webviz_subsurface._providers.ensemble_surface_provider.surface_array_server
18
19
  from webviz_subsurface._providers.ensemble_surface_provider.surface_image_server import (
19
20
  SurfaceImageServer,
20
21
  )
21
- from webviz_subsurface._utils.webvizstore_functions import read_csv
22
+ from webviz_subsurface._utils.colors import hex_to_rgb
23
+ from webviz_subsurface._utils.webvizstore_functions import get_path, read_csv
22
24
 
23
25
  from ._tmp_well_pick_provider import WellPickProvider
24
26
  from .callbacks import plugin_callbacks
@@ -39,6 +41,8 @@ A dashboard to covisualize arbitrary surfaces generated by FMU.
39
41
  Default value is 'share/results/maps'.
40
42
  * **`well_pick_file`:** A csv file with well picks. See data input.
41
43
  * **`fault_polygon_attribute`:** Which set of fault polygons to use.
44
+ * **`field_outline_polygons_file_path`:** Full filepath to a field outline polygons file.
45
+ * **`field_outline_color:** Color of the field outline polygons (hex).
42
46
  * **`map_surface_names_to_well_pick_names`:** Allows mapping of file surface names
43
47
  to the relevant well pick name
44
48
  * **`map_surface_names_to_fault_polygons`:** Allows mapping of file surface names
@@ -69,7 +73,11 @@ See [this file](https://github.com/equinor/webviz-subsurface-testdata/blob/maste
69
73
  01_drogon_ahm/realization-0/iter-0/share/results/polygons/\
70
74
  toptherys--gl_faultlines_extract_postprocess.pol) for an example.
71
75
 
76
+ Field outline polygons have the same format as fault polygons.
77
+
72
78
  Well picks are provided as a csv file with columns `X_UTME,Y_UTMN,Z_TVDSS,MD,WELL,HORIZON`.
79
+ Additionally the columns `point_color` and `text_color` can be used to specify the color of the
80
+ point and text respectively. Use hex color codes for this (e.g. #ffffff).<br>
73
81
  See [wellpicks.csv](https://github.com/equinor/webviz-subsurface-testdata/tree/master/\
74
82
  observed_data/drogon_well_picks/wellpicks.csv) for an example.<br>
75
83
  Well picks can be exported from RMS using this script: [extract_well_picks_from_rms.py]\
@@ -91,6 +99,8 @@ color-tables.json for color_tables format.
91
99
  attributes: list = None,
92
100
  well_pick_file: Path = None,
93
101
  fault_polygon_attribute: Optional[str] = None,
102
+ field_outline_polygons_file_path: Path = None,
103
+ field_outline_color: str = "#e51000",
94
104
  map_surface_names_to_fault_polygons: Dict[str, str] = None,
95
105
  map_surface_names_to_well_pick_names: Dict[str, str] = None,
96
106
  rel_surface_folder: str = "share/results/maps",
@@ -155,7 +165,16 @@ color-tables.json for color_tables format.
155
165
  self._fault_polygons_server = FaultPolygonsServer.instance(app)
156
166
  for fault_polygons_provider in self._ensemble_fault_polygons_providers.values():
157
167
  self._fault_polygons_server.add_provider(fault_polygons_provider)
158
-
168
+ self.field_outline_polygons = None
169
+ self.field_outline_polygons_file_path = field_outline_polygons_file_path
170
+ if self.field_outline_polygons_file_path is not None:
171
+ try:
172
+ self.field_outline_polygons = xtgeo.polygons_from_file(
173
+ get_path(self.field_outline_polygons_file_path)
174
+ )
175
+ except ValueError:
176
+ print("Error reading field outline polygons file")
177
+ self.field_outline_color = hex_to_rgb(field_outline_color)
159
178
  self.map_surface_names_to_fault_polygons = (
160
179
  map_surface_names_to_fault_polygons
161
180
  if map_surface_names_to_fault_polygons is not None
@@ -175,10 +194,13 @@ color-tables.json for color_tables format.
175
194
  reals.extend([x for x in provider.realizations() if x not in reals])
176
195
  return main_layout(
177
196
  get_uuid=self.uuid,
178
- well_names=self.well_pick_provider.well_names()
179
- if self.well_pick_provider is not None
180
- else [],
197
+ well_names=(
198
+ self.well_pick_provider.well_names()
199
+ if self.well_pick_provider is not None
200
+ else []
201
+ ),
181
202
  realizations=reals,
203
+ show_field_outline=self.field_outline_polygons is not None,
182
204
  color_tables=self.color_tables,
183
205
  render_surfaces_as_images=self.render_surfaces_as_images,
184
206
  )
@@ -191,6 +213,8 @@ color-tables.json for color_tables format.
191
213
  ensemble_fault_polygons_providers=self._ensemble_fault_polygons_providers,
192
214
  fault_polygon_attribute=self.fault_polygon_attribute,
193
215
  fault_polygons_server=self._fault_polygons_server,
216
+ field_outline_polygons=self.field_outline_polygons,
217
+ field_outline_color=self.field_outline_color,
194
218
  map_surface_names_to_fault_polygons=self.map_surface_names_to_fault_polygons,
195
219
  well_picks_provider=self.well_pick_provider,
196
220
  color_tables=self.color_tables,
@@ -202,4 +226,8 @@ color-tables.json for color_tables format.
202
226
  store_functions = []
203
227
  if self.well_pick_file is not None:
204
228
  store_functions.append((read_csv, [{"csv_file": self.well_pick_file}]))
229
+ if self.field_outline_polygons_file_path is not None:
230
+ store_functions.append(
231
+ (get_path, [{"path": self.field_outline_polygons_file_path}])
232
+ )
205
233
  return store_functions
@@ -102,6 +102,8 @@ forward_models.html?highlight=gendata_rft#MERGE_RFT_ERTOBS).
102
102
  def __init__(
103
103
  self,
104
104
  webviz_settings: WebvizSettings,
105
+ rft: str = "share/results/tables/rft.csv",
106
+ rft_ert: str = "share/results/tables/rft_ert.csv",
105
107
  csvfile_rft: Path = None,
106
108
  csvfile_rft_ert: Path = None,
107
109
  ensembles: Optional[List[str]] = None,
@@ -109,11 +111,14 @@ forward_models.html?highlight=gendata_rft#MERGE_RFT_ERTOBS).
109
111
  obsdata: Path = None,
110
112
  faultlines: Path = None,
111
113
  ) -> None:
114
+ # pylint: disable = too-many-arguments
112
115
  super().__init__()
113
116
 
114
117
  self._datamodel = RftPlotterDataModel(
115
118
  webviz_settings,
116
119
  ensembles,
120
+ rft,
121
+ rft_ert,
117
122
  formations,
118
123
  faultlines,
119
124
  obsdata,
@@ -27,12 +27,15 @@ class RftPlotterDataModel:
27
27
  self,
28
28
  webviz_settings: WebvizSettings,
29
29
  ensembles: Optional[List[str]],
30
+ rft: str,
31
+ rft_ert: str,
30
32
  formations: Path = None,
31
33
  faultlines: Path = None,
32
34
  obsdata: Path = None,
33
35
  csvfile_rft: Path = None,
34
36
  csvfile_rft_ert: Path = None,
35
37
  ):
38
+ # pylint: disable = too-many-arguments
36
39
  self.formations = formations
37
40
  self.faultlines = faultlines
38
41
  self.obsdata = obsdata
@@ -67,12 +70,12 @@ class RftPlotterDataModel:
67
70
 
68
71
  self.ertdatadf = create_csvfile_providerset_from_paths(
69
72
  ens_paths,
70
- "share/results/tables/rft_ert.csv",
73
+ rft_ert,
71
74
  ).get_aggregated_dataframe()
72
75
 
73
76
  try:
74
77
  self.simdf = create_csvfile_providerset_from_paths(
75
- ens_paths, "share/results/tables/rft.csv"
78
+ ens_paths, rft
76
79
  ).get_aggregated_dataframe()
77
80
 
78
81
  except ValueError as err:
@@ -557,9 +557,9 @@ def make_status_df(
557
557
  if len(set(range(min(reals), max(reals) + 1))) > len(set(reals)):
558
558
  missing_df = ens_dfs[0].copy()
559
559
  missing_df["STATUS"] = "Realization not started"
560
- missing_df["RUNTIME"] = np.NaN
561
- missing_df["JOB_SCALED_RUNTIME"] = np.NaN
562
- missing_df["ENS_SCALED_RUNTIME"] = np.NaN
560
+ missing_df["RUNTIME"] = np.nan
561
+ missing_df["JOB_SCALED_RUNTIME"] = np.nan
562
+ missing_df["ENS_SCALED_RUNTIME"] = np.nan
563
563
  for missing_real in set(range(min(reals), max(reals) + 1)).difference(
564
564
  set(reals)
565
565
  ):
@@ -49,7 +49,7 @@ e.g. [xtgeo](https://xtgeo.readthedocs.io/en/latest/).
49
49
 
50
50
  self.zunit = zunit
51
51
  self.segyfiles: List[str] = [str(segy) for segy in segyfiles]
52
- self.initial_colors = (
52
+ self.colors = (
53
53
  colors
54
54
  if colors
55
55
  else [
@@ -68,7 +68,6 @@ e.g. [xtgeo](https://xtgeo.readthedocs.io/en/latest/).
68
68
  ]
69
69
  )
70
70
  self.init_state = self.update_state(self.segyfiles[0])
71
- self.init_state.get("colorscale", self.initial_colors)
72
71
  self.init_state.get("uirevision", str(uuid4()))
73
72
 
74
73
  self.plotly_theme = webviz_settings.theme.plotly_theme
@@ -86,7 +85,6 @@ e.g. [xtgeo](https://xtgeo.readthedocs.io/en/latest/).
86
85
  "color_min_value": float(f"{round(cube.values.min(), 2):2f}"),
87
86
  "color_max_value": float(f"{round(cube.values.max(), 2):2f}"),
88
87
  "uirevision": str(uuid4()),
89
- "colorscale": self.initial_colors,
90
88
  }
91
89
  if kwargs:
92
90
  for key, value in kwargs.items():
@@ -121,10 +119,6 @@ e.g. [xtgeo](https://xtgeo.readthedocs.io/en/latest/).
121
119
  "id": self.uuid("zslice"),
122
120
  "content": "Selected zslice for the seismic cube.",
123
121
  },
124
- {
125
- "id": self.uuid("color-scale"),
126
- "content": "Click this button to change colorscale",
127
- },
128
122
  {
129
123
  "id": self.uuid("color-values"),
130
124
  "content": "Drag either node of slider to truncate color ranges.",
@@ -160,18 +154,6 @@ e.g. [xtgeo](https://xtgeo.readthedocs.io/en/latest/).
160
154
  clearable=False,
161
155
  ),
162
156
  ),
163
- html.Div(
164
- children=[
165
- wcc.Label(
166
- children="Set colorscale",
167
- ),
168
- wcc.ColorScales(
169
- id=self.uuid("color-scale"),
170
- colorscale=self.initial_colors,
171
- nSwatches=12,
172
- ),
173
- ],
174
- ),
175
157
  html.Div(
176
158
  children=[
177
159
  wcc.RangeSlider(
@@ -183,7 +165,8 @@ e.g. [xtgeo](https://xtgeo.readthedocs.io/en/latest/).
183
165
  self.init_state["min_value"],
184
166
  self.init_state["max_value"],
185
167
  ],
186
- tooltip={"placement": "bottom"},
168
+ marks=None,
169
+ tooltip={"placement": "bottom", "always_visible": True},
187
170
  step=calculate_slider_step(
188
171
  min_value=self.init_state["min_value"],
189
172
  max_value=self.init_state["max_value"],
@@ -257,7 +240,6 @@ e.g. [xtgeo](https://xtgeo.readthedocs.io/en/latest/).
257
240
  Input(self.uuid("xline"), "clickData"),
258
241
  Input(self.uuid("zslice"), "clickData"),
259
242
  Input(self.uuid("color-values"), "value"),
260
- Input(self.uuid("color-scale"), "colorscale"),
261
243
  Input(self.uuid("zoom"), "n_clicks"),
262
244
  Input(self.uuid("color-reset"), "n_clicks"),
263
245
  ],
@@ -272,7 +254,6 @@ e.g. [xtgeo](https://xtgeo.readthedocs.io/en/latest/).
272
254
  xcd: Union[dict, None],
273
255
  zcd: Union[dict, None],
274
256
  color_values: List[float],
275
- colorscale: List[float],
276
257
  _zoom_btn: Union[int, None],
277
258
  _reset_range_btn: Union[int, None],
278
259
  zfig: Union[dict, None],
@@ -311,7 +292,6 @@ e.g. [xtgeo](https://xtgeo.readthedocs.io/en/latest/).
311
292
  else:
312
293
  store["color_min_value"] = color_values[0]
313
294
  store["color_max_value"] = color_values[1]
314
- store["colorscale"] = colorscale
315
295
  return json.dumps(store)
316
296
 
317
297
  @app.callback(
@@ -358,7 +338,7 @@ e.g. [xtgeo](https://xtgeo.readthedocs.io/en/latest/).
358
338
  reverse_y=False,
359
339
  zmin=state["color_min_value"],
360
340
  zmax=state["color_max_value"],
361
- colorscale=state["colorscale"],
341
+ colorscale=self.colors,
362
342
  uirevision=state["uirevision"],
363
343
  )
364
344
  fig["layout"]["shapes"] = shapes
@@ -406,7 +386,7 @@ e.g. [xtgeo](https://xtgeo.readthedocs.io/en/latest/).
406
386
  yaxis_title=self.zunit,
407
387
  zmin=state["color_min_value"],
408
388
  zmax=state["color_max_value"],
409
- colorscale=state["colorscale"],
389
+ colorscale=self.colors,
410
390
  uirevision=state["uirevision"],
411
391
  )
412
392
  fig["layout"]["shapes"] = shapes
@@ -451,7 +431,7 @@ e.g. [xtgeo](https://xtgeo.readthedocs.io/en/latest/).
451
431
  yaxis_title=self.zunit,
452
432
  zmin=state["color_min_value"],
453
433
  zmax=state["color_max_value"],
454
- colorscale=state["colorscale"],
434
+ colorscale=self.colors,
455
435
  uirevision=state["uirevision"],
456
436
  )
457
437
  fig["layout"]["shapes"] = shapes
@@ -93,7 +93,7 @@ e.g. [xtgeo](https://xtgeo.readthedocs.io/en/latest/).
93
93
  Path(gridfile).stem for gridfile in gridparameterfiles
94
94
  ]
95
95
  self.plotly_theme = webviz_settings.theme.plotly_theme
96
- self.initial_colors = (
96
+ self.colors = (
97
97
  colors
98
98
  if colors is not None
99
99
  else [
@@ -154,10 +154,6 @@ e.g. [xtgeo](https://xtgeo.readthedocs.io/en/latest/).
154
154
  "id": self.ids("gridparameter"),
155
155
  "content": "The visualized grid parameter.",
156
156
  },
157
- {
158
- "id": self.ids("color-scale"),
159
- "content": ("Click this button to change colorscale"),
160
- },
161
157
  {
162
158
  "id": self.ids("color-values"),
163
159
  "content": ("Drag either node of slider to truncate color ranges"),
@@ -224,14 +220,6 @@ e.g. [xtgeo](https://xtgeo.readthedocs.io/en/latest/).
224
220
  value=self.gridparafiles[0],
225
221
  clearable=False,
226
222
  ),
227
- wcc.Label(
228
- children="Set colorscale",
229
- ),
230
- wcc.ColorScales(
231
- id=self.ids("color-scale"),
232
- colorscale=self.initial_colors,
233
- nSwatches=12,
234
- ),
235
223
  wcc.RangeSlider(
236
224
  label="Set color range",
237
225
  id=self.ids("color-values"),
@@ -335,10 +323,9 @@ e.g. [xtgeo](https://xtgeo.readthedocs.io/en/latest/).
335
323
  Input(self.ids("gridparameter"), "value"),
336
324
  Input(self.ids("surface"), "value"),
337
325
  Input(self.ids("color-values"), "value"),
338
- Input(self.ids("color-scale"), "colorscale"),
339
326
  ],
340
327
  )
341
- def _render_fence(coords, gridparameter, surfacepath, color_values, colorscale):
328
+ def _render_fence(coords, gridparameter, surfacepath, color_values):
342
329
  if not coords:
343
330
  raise PreventUpdate
344
331
  grid = load_grid(get_path(self.gridfile))
@@ -369,7 +356,7 @@ e.g. [xtgeo](https://xtgeo.readthedocs.io/en/latest/).
369
356
  s_arr=s_arr,
370
357
  theme=self.plotly_theme,
371
358
  s_name=self.surfacenames[self.surfacefiles.index(surfacepath)],
372
- colorscale=colorscale,
359
+ colorscale=self.colors,
373
360
  xmin=hmin,
374
361
  xmax=hmax,
375
362
  ymin=vmin,
@@ -85,7 +85,7 @@ e.g. [xtgeo](https://xtgeo.readthedocs.io/en/latest/).
85
85
  else:
86
86
  self.segynames = [Path(segyfile).stem for segyfile in segyfiles]
87
87
  self.plotly_theme = webviz_settings.theme.plotly_theme
88
- self.initial_colors = (
88
+ self.colors = (
89
89
  colors
90
90
  if colors is not None
91
91
  else [
@@ -148,10 +148,6 @@ e.g. [xtgeo](https://xtgeo.readthedocs.io/en/latest/).
148
148
  "id": self.ids("cube"),
149
149
  "content": "The visualized cube.",
150
150
  },
151
- {
152
- "id": self.ids("color-scale"),
153
- "content": ("Click this button to change colorscale"),
154
- },
155
151
  {
156
152
  "id": self.ids("color-values"),
157
153
  "content": ("Drag either node of slider to truncate color ranges"),
@@ -216,14 +212,6 @@ e.g. [xtgeo](https://xtgeo.readthedocs.io/en/latest/).
216
212
  value=self.segyfiles[0],
217
213
  clearable=False,
218
214
  ),
219
- wcc.Label(
220
- children="Set colorscale",
221
- ),
222
- wcc.ColorScales(
223
- id=self.ids("color-scale"),
224
- colorscale=self.initial_colors,
225
- nSwatches=12,
226
- ),
227
215
  wcc.RangeSlider(
228
216
  label="Set color range",
229
217
  id=self.ids("color-values"),
@@ -320,10 +308,9 @@ e.g. [xtgeo](https://xtgeo.readthedocs.io/en/latest/).
320
308
  Input(self.ids("cube"), "value"),
321
309
  Input(self.ids("surface"), "value"),
322
310
  Input(self.ids("color-values"), "value"),
323
- Input(self.ids("color-scale"), "colorscale"),
324
311
  ],
325
312
  )
326
- def _render_fence(coords, cubepath, surfacepath, color_values, colorscale):
313
+ def _render_fence(coords, cubepath, surfacepath, color_values):
327
314
  if not coords:
328
315
  raise PreventUpdate
329
316
  cube = load_cube_data(get_path(cubepath))
@@ -337,7 +324,7 @@ e.g. [xtgeo](https://xtgeo.readthedocs.io/en/latest/).
337
324
  s_arr=s_arr,
338
325
  theme=self.plotly_theme,
339
326
  s_name=self.surfacenames[self.surfacefiles.index(surfacepath)],
340
- colorscale=colorscale,
327
+ colorscale=self.colors,
341
328
  xmin=hmin,
342
329
  xmax=hmax,
343
330
  ymin=vmin,
@@ -1,4 +1,4 @@
1
- from typing import Callable, Optional
1
+ from typing import Callable, List, Optional
2
2
 
3
3
  import numpy as np
4
4
  import pandas as pd
@@ -32,7 +32,7 @@ from ..views.distribution_main_layout import (
32
32
 
33
33
  # pylint: disable=too-many-statements
34
34
  def distribution_controllers(
35
- get_uuid: Callable, volumemodel: InplaceVolumesModel
35
+ get_uuid: Callable, volumemodel: InplaceVolumesModel, colors: List[str]
36
36
  ) -> None:
37
37
  @callback(
38
38
  Output({"id": get_uuid("main-voldist"), "page": "custom"}, "children"),
@@ -105,18 +105,18 @@ def distribution_controllers(
105
105
  nbins=selections["hist_bins"],
106
106
  facet_col=selections["Subplots"],
107
107
  color=selections["Color by"],
108
- color_discrete_sequence=selections["Colorscale"],
109
- color_continuous_scale=selections["Colorscale"],
110
- color_discrete_map=FLUID_COLORS
111
- if selections["Color by"] == "FLUID_ZONE"
112
- else None,
108
+ color_discrete_sequence=colors,
109
+ color_continuous_scale=colors,
110
+ color_discrete_map=(
111
+ FLUID_COLORS if selections["Color by"] == "FLUID_ZONE" else None
112
+ ),
113
113
  barmode=selections["barmode"],
114
114
  boxmode=selections["barmode"],
115
- text_auto=get_text_format_bar_plot(
116
- selected_data, selections, volumemodel
117
- )
118
- if selections["Plot type"] == "bar"
119
- else False,
115
+ text_auto=(
116
+ get_text_format_bar_plot(selected_data, selections, volumemodel)
117
+ if selections["Plot type"] == "bar"
118
+ else False
119
+ ),
120
120
  layout={
121
121
  "title": (
122
122
  {
@@ -151,18 +151,22 @@ def distribution_controllers(
151
151
 
152
152
  return custom_plotting_layout(
153
153
  figure=figure,
154
- tables=make_tables(
155
- dframe=dframe,
156
- responses=list({selections["X Response"], selections["Y Response"]}),
157
- groups=groups,
158
- volumemodel=volumemodel,
159
- page_selected=page_selected,
160
- selections=selections,
161
- table_type="Statistics table",
162
- view_height=37,
163
- )
164
- if selections["bottom_viz"] == "table"
165
- else None,
154
+ tables=(
155
+ make_tables(
156
+ dframe=dframe,
157
+ responses=list(
158
+ {selections["X Response"], selections["Y Response"]}
159
+ ),
160
+ groups=groups,
161
+ volumemodel=volumemodel,
162
+ page_selected=page_selected,
163
+ selections=selections,
164
+ table_type="Statistics table",
165
+ view_height=37,
166
+ )
167
+ if selections["bottom_viz"] == "table"
168
+ else None
169
+ ),
166
170
  )
167
171
 
168
172
  @callback(
@@ -233,7 +237,7 @@ def distribution_controllers(
233
237
  data_frame=dframe,
234
238
  values=selections["X Response"],
235
239
  names=selector,
236
- color_discrete_sequence=selections["Colorscale"],
240
+ color_discrete_sequence=colors,
237
241
  color=selector,
238
242
  )
239
243
  .update_traces(marker_line={"color": "#000000", "width": 1})
@@ -250,7 +254,7 @@ def distribution_controllers(
250
254
  title=f"{selections['X Response']} per {selector}",
251
255
  barmode="overlay" if selector == selections["Color by"] else "group",
252
256
  layout={"bargap": 0.05},
253
- color_discrete_sequence=selections["Colorscale"],
257
+ color_discrete_sequence=colors,
254
258
  color=selections["Color by"],
255
259
  xaxis={
256
260
  "type": "category",
@@ -263,9 +267,9 @@ def distribution_controllers(
263
267
  selections=selections,
264
268
  volumemodel=volumemodel,
265
269
  ),
266
- color_discrete_map=FLUID_COLORS
267
- if selections["Color by"] == "FLUID_ZONE"
268
- else None,
270
+ color_discrete_map=(
271
+ FLUID_COLORS if selections["Color by"] == "FLUID_ZONE" else None
272
+ ),
269
273
  ).update_layout(margin_t=35)
270
274
 
271
275
  if selections["X Response"] not in volumemodel.hc_responses:
@@ -21,10 +21,6 @@ def selections_controllers(
21
21
  {"id": get_uuid("filters"), "tab": ALL, "selector": ALL, "type": ALL},
22
22
  "value",
23
23
  ),
24
- Input(
25
- {"id": get_uuid("selections"), "tab": ALL, "settings": "Colorscale"},
26
- "colorscale",
27
- ),
28
24
  Input(get_uuid("initial-load-info"), "data"),
29
25
  State(get_uuid("page-selected"), "data"),
30
26
  State(get_uuid("tabs"), "value"),
@@ -37,7 +33,6 @@ def selections_controllers(
37
33
  def _update_selections(
38
34
  selectors: list,
39
35
  filters: list,
40
- colorscale: str,
41
36
  initial_load: dict,
42
37
  selected_page: str,
43
38
  selected_tab: str,
@@ -63,7 +58,6 @@ def selections_controllers(
63
58
  if id_value["tab"] == selected_tab
64
59
  }
65
60
 
66
- page_selections.update(Colorscale=colorscale[0] if colorscale else None)
67
61
  page_selections.update(ctx_clicked=ctx["prop_id"])
68
62
 
69
63
  # check if a page needs to be updated due to page refresh or
@@ -240,9 +234,9 @@ def selections_controllers(
240
234
 
241
235
  settings["bottom_viz"] = {
242
236
  "options": visualization_options,
243
- "value": "none"
244
- if selected_page != "custom"
245
- else selections.get("bottom_viz"),
237
+ "value": (
238
+ "none" if selected_page != "custom" else selections.get("bottom_viz")
239
+ ),
246
240
  }
247
241
 
248
242
  return tuple(
@@ -336,9 +330,11 @@ def selections_controllers(
336
330
  selector_is_multi = page_filter_settings[selector]["multi"]
337
331
  if not multi and selector_is_multi:
338
332
  values = [
339
- "rms_seed"
340
- if selector == "SENSNAME_CASE" and "rms_seed" in options
341
- else options[0]
333
+ (
334
+ "rms_seed"
335
+ if selector == "SENSNAME_CASE" and "rms_seed" in options
336
+ else options[0]
337
+ )
342
338
  ]
343
339
  elif multi and not selector_is_multi:
344
340
  values = options
@@ -3,7 +3,6 @@ from typing import Callable, Optional
3
3
  import pandas as pd
4
4
  import webviz_core_components as wcc
5
5
  from dash import dcc
6
- from webviz_config import WebvizConfigTheme
7
6
 
8
7
  from webviz_subsurface._models import InplaceVolumesModel
9
8
 
@@ -22,7 +21,6 @@ from .tornado_view import tornado_main_layout, tornado_selections_layout
22
21
  def main_view(
23
22
  get_uuid: Callable,
24
23
  volumemodel: InplaceVolumesModel,
25
- theme: WebvizConfigTheme,
26
24
  disjoint_set_df: Optional[pd.DataFrame] = None,
27
25
  ) -> dcc.Tabs:
28
26
  tabs = []
@@ -37,7 +35,6 @@ def main_view(
37
35
  uuid=get_uuid("selections"),
38
36
  tab="voldist",
39
37
  volumemodel=volumemodel,
40
- theme=theme,
41
38
  ),
42
39
  filter_layout(
43
40
  uuid=get_uuid("filters"), tab="voldist", volumemodel=volumemodel
@@ -2,7 +2,6 @@ from typing import List, Optional
2
2
 
3
3
  import webviz_core_components as wcc
4
4
  from dash import dcc, html
5
- from webviz_config import WebvizConfigTheme
6
5
 
7
6
  from webviz_subsurface._models import InplaceVolumesModel
8
7
 
@@ -10,7 +9,6 @@ from webviz_subsurface._models import InplaceVolumesModel
10
9
  def selections_layout(
11
10
  uuid: str,
12
11
  volumemodel: InplaceVolumesModel,
13
- theme: WebvizConfigTheme,
14
12
  tab: str,
15
13
  ) -> html.Div:
16
14
  selectors = "/".join(
@@ -33,7 +31,7 @@ def selections_layout(
33
31
  ],
34
32
  ),
35
33
  plot_selections_layout(uuid, volumemodel, tab),
36
- settings_layout(volumemodel, uuid, theme, tab),
34
+ settings_layout(volumemodel, uuid, tab),
37
35
  ]
38
36
  )
39
37
 
@@ -157,9 +155,8 @@ def plot_selector_dropdowns(
157
155
 
158
156
 
159
157
  def settings_layout(
160
- volumemodel: InplaceVolumesModel, uuid: str, theme: WebvizConfigTheme, tab: str
158
+ volumemodel: InplaceVolumesModel, uuid: str, tab: str
161
159
  ) -> wcc.Selectors:
162
- theme_colors = theme.plotly_theme.get("layout", {}).get("colorway", [])
163
160
  return wcc.Selectors(
164
161
  label="⚙️ SETTINGS",
165
162
  open_details=False,
@@ -168,13 +165,6 @@ def settings_layout(
168
165
  subplot_xaxis_range(uuid=uuid, tab=tab),
169
166
  histogram_options(uuid=uuid, tab=tab),
170
167
  bar_text_options(uuid=uuid, tab=tab),
171
- html.Span("Colors", style={"font-weight": "bold"}),
172
- wcc.ColorScales(
173
- id={"id": uuid, "tab": tab, "settings": "Colorscale"},
174
- colorscale=theme_colors,
175
- fixSwatches=True,
176
- nSwatches=12,
177
- ),
178
168
  ],
179
169
  )
180
170