Skip to content

Commit 04b4aab

Browse files
authored
Add mean in tornado table VolumetricAnalysis (#1297)
1 parent c7b388a commit 04b4aab

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## [UNRELEASED] - YYYY-MM-DD
1010

11+
### Added
12+
- [#1297](https://github.com/equinor/webviz-subsurface/pull/1297) - Added mean for mc sensitivities in the tornadotable in `VolumetricAnalysis`.
13+
14+
## [0.2.30] - 2024-06-10
15+
1116
### Added
1217
- [#1293](https://github.com/equinor/webviz-subsurface/pull/1293) - Added automatic calculation of `STOIIP_TOTAL` / `GIIP_TOTAL` in `VolumetricAnalysis`.
1318

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"pytest-xdist",
1515
"pytest-forked",
1616
"selenium>=3.141",
17-
"types-pkg-resources",
17+
"types-setuptools",
1818
"types-pyyaml",
1919
]
2020

webviz_subsurface/_components/tornado/_tornado_data.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ def __init__(
2525
self._cut_sensitivities_by_ref()
2626
self._sort_sensitivities_by_max()
2727
self._real_df = self._create_real_df(dframe)
28+
self.mean_per_mc_sens = (
29+
dframe[dframe["SENSTYPE"] == "mc"].groupby("SENSNAME")["VALUE"].mean()
30+
)
2831

2932
def _validate_input(self, dframe: pd.DataFrame) -> None:
3033
for col in self.REQUIRED_COLUMNS:

webviz_subsurface/plugins/_volumetric_analysis/controllers/tornado_controllers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,12 +359,16 @@ def create_tornado_table(
359359
use_si_format=use_si_format,
360360
precision=4 if use_si_format else 3,
361361
)
362+
mean_col = "Mean (mc)"
362363
table_data = tornado_table.as_plotly_table
363364
for data in table_data:
364-
data["Reference"] = tornado_data.reference_average
365+
data[mean_col] = tornado_data.mean_per_mc_sens.get(data["Sensitivity"])
365366
if group is not None:
366367
data[subplots] = group
367368

368369
columns = create_table_columns(columns=[subplots]) if subplots is not None else []
369370
columns.extend(tornado_table.columns)
371+
columns.insert(
372+
-3, create_table_columns(columns=[mean_col], use_si_format=[mean_col])[0]
373+
)
370374
return table_data, columns

0 commit comments

Comments
 (0)