Skip to content

Commit

Permalink
Fix bug when grouping on FACIES for non-standard static sources
Browse files Browse the repository at this point in the history
  • Loading branch information
tnatt committed May 16, 2024
1 parent c7c139d commit 8a755f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [UNRELEASED] - YYYY-MM-DD

### Fixed
- [#1287](https://github.com/equinor/webviz-subsurface/pull/1287) - Fixed bug when grouping on FACIES for non-standard static sources.

## [0.2.25] - 2024-03-18

### Added
- [#1266](https://github.com/equinor/webviz-subsurface/pull/1266) - Added waterfall plot for analysing volume changes in `VolumetricAnalysis`.

Expand Down
7 changes: 4 additions & 3 deletions webviz_subsurface/_models/inplace_volumes_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,10 @@ def get_df(
filters_excl_facies, groups, parameters, properties
)
# Remove "FACIES" to compute facies fraction for the individual groups
groups = [x for x in groups if x != "FACIES"]
df = dframe.groupby(groups) if groups else dframe
dframe["FACIES_FRACTION"] = df["BULK"].transform(lambda x: x / x.sum())
if "FACIES_FRACTION" in self.property_columns:
groups = [x for x in groups if x != "FACIES"]
df = dframe.groupby(groups) if groups else dframe
dframe["FACIES_FRACTION"] = df["BULK"].transform(lambda x: x / x.sum())

return dframe[dframe["FACIES"].isin(filters["FACIES"])] if filters else dframe

Expand Down

0 comments on commit 8a755f8

Please sign in to comment.