webviz-subsurface 0.2.37__py3-none-any.whl → 0.2.39__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.
- tests/unit_tests/plugin_tests/test_tornado_data.py +10 -1
- webviz_subsurface/_components/tornado/_tornado_bar_chart.py +31 -11
- webviz_subsurface/_components/tornado/_tornado_data.py +20 -2
- webviz_subsurface/_datainput/well_completions.py +2 -1
- webviz_subsurface/_providers/ensemble_table_provider/ensemble_table_provider_factory.py +4 -0
- webviz_subsurface/_utils/design_matrix.py +36 -0
- webviz_subsurface/plugins/_co2_leakage/_plugin.py +623 -493
- webviz_subsurface/plugins/_co2_leakage/_types.py +7 -0
- webviz_subsurface/plugins/_co2_leakage/_utilities/callbacks.py +96 -52
- webviz_subsurface/plugins/_co2_leakage/_utilities/co2volume.py +300 -82
- webviz_subsurface/plugins/_co2_leakage/_utilities/containment_info.py +31 -0
- webviz_subsurface/plugins/_co2_leakage/_utilities/initialization.py +16 -7
- webviz_subsurface/plugins/_co2_leakage/_utilities/surface_publishing.py +102 -9
- webviz_subsurface/plugins/_co2_leakage/views/mainview/mainview.py +14 -1
- webviz_subsurface/plugins/_co2_leakage/views/mainview/settings.py +181 -58
- webviz_subsurface/plugins/_parameter_analysis/_types.py +1 -0
- webviz_subsurface/plugins/_parameter_analysis/_utils/_parameters_model.py +10 -2
- webviz_subsurface/plugins/_parameter_analysis/_views/_parameter_distributions_view/_settings/_visualization_type.py +2 -1
- {webviz_subsurface-0.2.37.dist-info → webviz_subsurface-0.2.39.dist-info}/METADATA +1 -1
- {webviz_subsurface-0.2.37.dist-info → webviz_subsurface-0.2.39.dist-info}/RECORD +25 -22
- {webviz_subsurface-0.2.37.dist-info → webviz_subsurface-0.2.39.dist-info}/LICENSE +0 -0
- {webviz_subsurface-0.2.37.dist-info → webviz_subsurface-0.2.39.dist-info}/LICENSE.chromedriver +0 -0
- {webviz_subsurface-0.2.37.dist-info → webviz_subsurface-0.2.39.dist-info}/WHEEL +0 -0
- {webviz_subsurface-0.2.37.dist-info → webviz_subsurface-0.2.39.dist-info}/entry_points.txt +0 -0
- {webviz_subsurface-0.2.37.dist-info → webviz_subsurface-0.2.39.dist-info}/top_level.txt +0 -0
|
@@ -20,8 +20,10 @@ from webviz_subsurface._providers import (
|
|
|
20
20
|
from webviz_subsurface._providers.ensemble_surface_provider.ensemble_surface_provider import (
|
|
21
21
|
SurfaceStatistic,
|
|
22
22
|
)
|
|
23
|
+
from webviz_subsurface.plugins._co2_leakage._types import LegendData
|
|
23
24
|
from webviz_subsurface.plugins._co2_leakage._utilities import plume_extent
|
|
24
25
|
from webviz_subsurface.plugins._co2_leakage._utilities.co2volume import (
|
|
26
|
+
generate_co2_box_plot_figure,
|
|
25
27
|
generate_co2_statistics_figure,
|
|
26
28
|
generate_co2_time_containment_figure,
|
|
27
29
|
generate_co2_time_containment_one_realization_figure,
|
|
@@ -30,6 +32,10 @@ from webviz_subsurface.plugins._co2_leakage._utilities.co2volume import (
|
|
|
30
32
|
from webviz_subsurface.plugins._co2_leakage._utilities.containment_data_provider import (
|
|
31
33
|
ContainmentDataProvider,
|
|
32
34
|
)
|
|
35
|
+
from webviz_subsurface.plugins._co2_leakage._utilities.containment_info import (
|
|
36
|
+
ContainmentInfo,
|
|
37
|
+
StatisticsTabOption,
|
|
38
|
+
)
|
|
33
39
|
from webviz_subsurface.plugins._co2_leakage._utilities.ensemble_well_picks import (
|
|
34
40
|
EnsembleWellPicks,
|
|
35
41
|
)
|
|
@@ -120,6 +126,17 @@ class SurfaceData:
|
|
|
120
126
|
)
|
|
121
127
|
|
|
122
128
|
|
|
129
|
+
def extract_legendonly(figure: go.Figure) -> List[str]:
|
|
130
|
+
# Finds the names OR legendgroup of the traces in the figure which have their
|
|
131
|
+
# visibility set to "legendonly". In the figure, these traces are toggled OFF in the
|
|
132
|
+
# legend.
|
|
133
|
+
return [
|
|
134
|
+
d.get("legendgroup", d.get("name"))
|
|
135
|
+
for d in figure["data"]
|
|
136
|
+
if d.get("visible", "") == "legendonly"
|
|
137
|
+
]
|
|
138
|
+
|
|
139
|
+
|
|
123
140
|
def derive_surface_address(
|
|
124
141
|
surface_name: str,
|
|
125
142
|
attribute: MapAttribute,
|
|
@@ -385,18 +402,16 @@ def generate_containment_figures(
|
|
|
385
402
|
co2_scale: Union[Co2MassScale, Co2VolumeScale],
|
|
386
403
|
realizations: List[int],
|
|
387
404
|
y_limits: List[Optional[float]],
|
|
388
|
-
containment_info:
|
|
405
|
+
containment_info: ContainmentInfo,
|
|
406
|
+
legenddata: LegendData,
|
|
389
407
|
) -> Tuple[go.Figure, go.Figure, go.Figure]:
|
|
390
408
|
try:
|
|
391
|
-
fig0 = (
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
co2_scale,
|
|
398
|
-
containment_info,
|
|
399
|
-
)
|
|
409
|
+
fig0 = generate_co2_volume_figure(
|
|
410
|
+
table_provider,
|
|
411
|
+
table_provider.realizations,
|
|
412
|
+
co2_scale,
|
|
413
|
+
containment_info,
|
|
414
|
+
legenddata["bar_legendonly"],
|
|
400
415
|
)
|
|
401
416
|
fig1 = (
|
|
402
417
|
generate_co2_time_containment_figure(
|
|
@@ -404,6 +419,7 @@ def generate_containment_figures(
|
|
|
404
419
|
realizations,
|
|
405
420
|
co2_scale,
|
|
406
421
|
containment_info,
|
|
422
|
+
legenddata["time_legendonly"],
|
|
407
423
|
)
|
|
408
424
|
if len(realizations) > 1
|
|
409
425
|
else generate_co2_time_containment_one_realization_figure(
|
|
@@ -414,12 +430,26 @@ def generate_containment_figures(
|
|
|
414
430
|
containment_info,
|
|
415
431
|
)
|
|
416
432
|
)
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
433
|
+
if (
|
|
434
|
+
containment_info.statistics_tab_option
|
|
435
|
+
== StatisticsTabOption.PROBABILITY_PLOT
|
|
436
|
+
):
|
|
437
|
+
fig2 = generate_co2_statistics_figure(
|
|
438
|
+
table_provider,
|
|
439
|
+
realizations,
|
|
440
|
+
co2_scale,
|
|
441
|
+
containment_info,
|
|
442
|
+
legenddata["stats_legendonly"],
|
|
443
|
+
)
|
|
444
|
+
else: # "box_plot"
|
|
445
|
+
# Deliberately uses same legend as statistics
|
|
446
|
+
fig2 = generate_co2_box_plot_figure(
|
|
447
|
+
table_provider,
|
|
448
|
+
realizations,
|
|
449
|
+
co2_scale,
|
|
450
|
+
containment_info,
|
|
451
|
+
legenddata["stats_legendonly"],
|
|
452
|
+
)
|
|
423
453
|
except KeyError as exc:
|
|
424
454
|
warnings.warn(f"Could not generate CO2 figures: {exc}")
|
|
425
455
|
raise exc
|
|
@@ -466,6 +496,7 @@ def process_visualization_info(
|
|
|
466
496
|
return stored_info
|
|
467
497
|
|
|
468
498
|
|
|
499
|
+
# pylint: disable=too-many-locals
|
|
469
500
|
def process_containment_info(
|
|
470
501
|
zone: Optional[str],
|
|
471
502
|
region: Optional[str],
|
|
@@ -477,8 +508,10 @@ def process_containment_info(
|
|
|
477
508
|
sorting: str,
|
|
478
509
|
lines_to_show: str,
|
|
479
510
|
date_option: str,
|
|
511
|
+
statistics_tab_option: StatisticsTabOption,
|
|
512
|
+
box_show_points: str,
|
|
480
513
|
menu_options: MenuOptions,
|
|
481
|
-
) ->
|
|
514
|
+
) -> ContainmentInfo:
|
|
482
515
|
if mark_choice is None:
|
|
483
516
|
mark_choice = "phase"
|
|
484
517
|
zones = menu_options["zones"]
|
|
@@ -502,48 +535,57 @@ def process_containment_info(
|
|
|
502
535
|
region = "all"
|
|
503
536
|
if "region" in [mark_choice, color_choice]:
|
|
504
537
|
zone = "all"
|
|
505
|
-
return
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
538
|
+
return ContainmentInfo(
|
|
539
|
+
zone=zone,
|
|
540
|
+
region=region,
|
|
541
|
+
zones=zones,
|
|
542
|
+
regions=regions,
|
|
543
|
+
phase=phase,
|
|
544
|
+
containment=containment,
|
|
545
|
+
plume_group=plume_group,
|
|
546
|
+
color_choice=color_choice,
|
|
547
|
+
mark_choice=mark_choice,
|
|
548
|
+
sorting=sorting,
|
|
549
|
+
phases=[phase for phase in menu_options["phases"] if phase != "total"],
|
|
550
|
+
containments=["hazardous", "outside", "contained"],
|
|
551
|
+
plume_groups=plume_groups,
|
|
552
|
+
use_stats=lines_to_show == "stat",
|
|
553
|
+
date_option=date_option,
|
|
554
|
+
statistics_tab_option=statistics_tab_option,
|
|
555
|
+
box_show_points=box_show_points,
|
|
556
|
+
)
|
|
522
557
|
|
|
523
558
|
|
|
524
559
|
def make_plot_ids(
|
|
525
560
|
ensemble: str,
|
|
526
561
|
source: GraphSource,
|
|
527
562
|
scale: Union[Co2MassScale, Co2VolumeScale],
|
|
528
|
-
containment_info:
|
|
563
|
+
containment_info: ContainmentInfo,
|
|
529
564
|
realizations: List[int],
|
|
530
|
-
lines_to_show: str,
|
|
565
|
+
# lines_to_show: str,
|
|
531
566
|
num_figs: int,
|
|
532
567
|
) -> List[str]:
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
568
|
+
"""
|
|
569
|
+
Removed some keywords from plot id that we don't want to trigger updates for
|
|
570
|
+
with respect to visible legends and potentially zoom level.
|
|
571
|
+
|
|
572
|
+
Note: Currently the legends are reset if you swap to a plot with different plot id
|
|
573
|
+
and back, so it works temporarily, in a sense. This might be good enough for now.
|
|
574
|
+
If we want to store it more extensively, we need to do something like what's been
|
|
575
|
+
outlined in _plugin.py.
|
|
576
|
+
"""
|
|
577
|
+
zone_str = containment_info.zone if containment_info.zone is not None else "None"
|
|
536
578
|
region_str = (
|
|
537
|
-
containment_info
|
|
579
|
+
containment_info.region if containment_info.region is not None else "None"
|
|
538
580
|
)
|
|
539
581
|
plume_group_str = (
|
|
540
|
-
containment_info
|
|
541
|
-
if containment_info
|
|
582
|
+
containment_info.plume_group
|
|
583
|
+
if containment_info.plume_group is not None
|
|
542
584
|
else "None"
|
|
543
585
|
)
|
|
544
586
|
mark_choice_str = (
|
|
545
|
-
containment_info
|
|
546
|
-
if containment_info
|
|
587
|
+
containment_info.mark_choice
|
|
588
|
+
if containment_info.mark_choice is not None
|
|
547
589
|
else "None"
|
|
548
590
|
)
|
|
549
591
|
plot_id = "-".join(
|
|
@@ -554,17 +596,19 @@ def make_plot_ids(
|
|
|
554
596
|
zone_str,
|
|
555
597
|
region_str,
|
|
556
598
|
plume_group_str,
|
|
557
|
-
str(containment_info
|
|
558
|
-
str(containment_info
|
|
559
|
-
containment_info
|
|
599
|
+
str(containment_info.phase),
|
|
600
|
+
str(containment_info.containment),
|
|
601
|
+
containment_info.color_choice,
|
|
560
602
|
mark_choice_str,
|
|
561
|
-
containment_info
|
|
562
|
-
containment_info
|
|
603
|
+
containment_info.sorting,
|
|
604
|
+
containment_info.date_option,
|
|
563
605
|
)
|
|
564
606
|
)
|
|
565
|
-
ids = [plot_id]
|
|
566
|
-
ids += [plot_id + f"-{realizations}"] * (num_figs - 1)
|
|
567
|
-
ids[1] += f"-{lines_to_show}"
|
|
607
|
+
ids = [plot_id] * num_figs
|
|
608
|
+
# ids += [plot_id + f"-{realizations}"] * (num_figs - 1)
|
|
609
|
+
# ids[1] += f"-{lines_to_show}"
|
|
610
|
+
ids[1] += "-single" if len(realizations) == 1 else "-multiple"
|
|
611
|
+
ids[2] += f"-{containment_info.statistics_tab_option}"
|
|
568
612
|
return ids
|
|
569
613
|
|
|
570
614
|
|