Skip to content

Commit

Permalink
Add mean in tornado table VolumetricAnalysis (#1297)
Browse files Browse the repository at this point in the history
  • Loading branch information
tnatt authored Aug 19, 2024
1 parent c7b388a commit 04b4aab
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [UNRELEASED] - YYYY-MM-DD

### Added
- [#1297](https://github.com/equinor/webviz-subsurface/pull/1297) - Added mean for mc sensitivities in the tornadotable in `VolumetricAnalysis`.

## [0.2.30] - 2024-06-10

### Added
- [#1293](https://github.com/equinor/webviz-subsurface/pull/1293) - Added automatic calculation of `STOIIP_TOTAL` / `GIIP_TOTAL` in `VolumetricAnalysis`.

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"pytest-xdist",
"pytest-forked",
"selenium>=3.141",
"types-pkg-resources",
"types-setuptools",
"types-pyyaml",
]

Expand Down
3 changes: 3 additions & 0 deletions webviz_subsurface/_components/tornado/_tornado_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ def __init__(
self._cut_sensitivities_by_ref()
self._sort_sensitivities_by_max()
self._real_df = self._create_real_df(dframe)
self.mean_per_mc_sens = (
dframe[dframe["SENSTYPE"] == "mc"].groupby("SENSNAME")["VALUE"].mean()
)

def _validate_input(self, dframe: pd.DataFrame) -> None:
for col in self.REQUIRED_COLUMNS:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,16 @@ def create_tornado_table(
use_si_format=use_si_format,
precision=4 if use_si_format else 3,
)
mean_col = "Mean (mc)"
table_data = tornado_table.as_plotly_table
for data in table_data:
data["Reference"] = tornado_data.reference_average
data[mean_col] = tornado_data.mean_per_mc_sens.get(data["Sensitivity"])
if group is not None:
data[subplots] = group

columns = create_table_columns(columns=[subplots]) if subplots is not None else []
columns.extend(tornado_table.columns)
columns.insert(
-3, create_table_columns(columns=[mean_col], use_si_format=[mean_col])[0]
)
return table_data, columns

0 comments on commit 04b4aab

Please sign in to comment.