Skip to content

Commit

Permalink
Various bugfixes (#1014)
Browse files Browse the repository at this point in the history
* various bugfixes
  • Loading branch information
tnatt authored Apr 28, 2022
1 parent 9362b33 commit 4cce8cd
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#938](https://github.com/equinor/webviz-subsurface/pull/938) - `ProdMisfit` - New plugin for well production misfit visualization. Features visualization of production misfit at selected dates, production coverage at selected dates and heatmap representation of ensemble mean misfit for selected dates.
- [#1013](https://github.com/equinor/webviz-subsurface/pull/1013) - `MapViewerFMU` - Added option to specify the folder where maps are located (relative to runpath in each realization).

### Fixed

- [#1014](https://github.com/equinor/webviz-subsurface/pull/1014) - `ParameterResponseCorrelation` and `BhpQc` - fix bug in range slider. `VolumetricAnalysis` - prevent "Totals" volumes (if present) beeing included in the sum when comparing static and dynamic volumes, and do not include non-numeric columns as volumetric responses.

## [0.2.12] - 2022-04-07

### Added
Expand Down
5 changes: 4 additions & 1 deletion webviz_subsurface/_models/inplace_volumes_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import numpy as np
import pandas as pd
from pandas.api.types import is_numeric_dtype

from .ensemble_set_model import EnsembleSetModel
from .parameter_model import ParametersModel
Expand Down Expand Up @@ -164,7 +165,9 @@ def volume_columns(self) -> List[str]:
return [
x
for x in self._dataframe
if x not in self.selectors and x not in self.property_columns
if x not in self.selectors
and x not in self.property_columns
and is_numeric_dtype(self._dataframe[x])
]

@property
Expand Down
1 change: 1 addition & 0 deletions webviz_subsurface/plugins/_bhp_qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ def layout(self) -> wcc.FlexBox:
id=self.uuid("n_wells"),
min=1,
max=len(self.wells),
step=1,
value=min(10, len(self.wells)),
marks={1: 1, len(self.wells): len(self.wells)},
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ def control_layout(self):
id=self.uuid("max-params"),
min=1,
max=max_params,
step=1,
marks={1: "1", max_params: str(max_params)},
value=max_params,
),
Expand Down
4 changes: 4 additions & 0 deletions webviz_subsurface/plugins/_swatinit_qc/_business_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ def __init__(
self.faultlines_df = read_csv(faultlines) if faultlines else None

if ensemble is not None:
if isinstance(ensemble, list):
raise TypeError(
'Incorrent argument type, "ensemble" must be a string instead of a list'
)
if realization is None:
raise ValueError('Incorrent arguments, "realization" must be specified')

Expand Down
3 changes: 2 additions & 1 deletion webviz_subsurface/plugins/_swatinit_qc/_figures.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ def add_contacts_to_plot(self) -> None:
if contact in self.dframe and self.dframe["EQLNUM"].nunique() == 1:
# contacts are assumed constant in the dataframe
value = self.dframe[contact].values[0]
if value not in [0, 1000]:
# do not include dummy contacts (shallower than the dataset)
if value > self.dframe["Z"].min():
self._figure.add_hline(
value,
line={"color": "black", "dash": "dash", "width": 1.5},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ def __init__(self, volumes_table: pd.DataFrame, fipfile: Path = None):
self.disjoint_set_df = (
fipmapper.FipMapper(yamlfile=fipfile).disjoint_sets() if fipfile else None
)
self.dframe = self.validate_and_combine_sources(volumes_table)
self.drop_rows_with_totals_from_selectors()

self.dframe = self.validate_and_combine_sources(
self.drop_rows_with_totals_from_selectors(volumes_table)
)
self.volume_type = self.set_volumetric_type()

if self.volume_type == "mixed":
Expand Down Expand Up @@ -218,7 +220,10 @@ def drop_total_columns(self) -> None:
)
self.dframe.drop(columns=total_columns, inplace=True)

def drop_rows_with_totals_from_selectors(self) -> None:
@staticmethod
def drop_rows_with_totals_from_selectors(dframe: pd.DataFrame) -> pd.DataFrame:
"""Drop rows containing total volumes ("Totals") if present"""
for sel in [col for col in self.VALID_STATIC_SELECTORS if col in self.dframe]:
self.dframe = self.dframe.loc[self.dframe[sel] != "Totals"]
selectors = [col for col in ["ZONE", "REGION", "FACIES"] if col in dframe]
for sel in selectors:
dframe = dframe.loc[dframe[sel] != "Totals"]
return dframe

0 comments on commit 4cce8cd

Please sign in to comment.