Skip to content

Commit 1b1bb17

Browse files
authored
Fix Pvt sorting issue (#1212)
1 parent 7358fb3 commit 1b1bb17

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

webviz_subsurface/_datainput/pvt_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ def filter_pvt_data_frame(
7878
"The dataframe must contain a column for the ratio (OGR, GOR, R, RV, RS)."
7979
)
8080
if not "VOLUMEFACTOR_UNIT" in data_frame.columns:
81-
data_frame["VOLUMEFACTOR_UNIT"] = "rm³/sm³"
81+
data_frame["VOLUMEFACTOR_UNIT"] = "Rm³/Sm³"
8282
if not "PRESSURE_UNIT" in data_frame.columns:
8383
data_frame["PRESSURE_UNIT"] = "bar"
8484
if not "VISCOSITY_UNIT" in data_frame.columns:
8585
data_frame["VISCOSITY_UNIT"] = "cP"
8686
if not "DENSITY_UNIT" in data_frame.columns:
8787
data_frame["DENSITY_UNIT"] = "kg/m³"
8888
if not "RATIO_UNIT" in data_frame.columns:
89-
data_frame["RATIO_UNIT"] = "Scm³/Scm³"
89+
data_frame["RATIO_UNIT"] = "Sm³/Sm³"
9090

9191
if not "DENSITY" in data_frame.columns:
9292
data_frame = calculate_densities(data_frame)

webviz_subsurface/plugins/_pvt_plot/_views/_pvt/_settings/_view_settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ def plot_visibility_options(phase: str = "") -> Dict[str, str]:
1919
"fvf": "Formation Volume Factor",
2020
"viscosity": "Viscosity",
2121
"density": "Density",
22-
"ratio": "Gas/Oil Ratio (Rs)",
22+
"ratio": "Fluid Ratio",
2323
}
2424
if phase == "OIL":
25-
options["ratio"] = "Gas/Oil Ratio (Rs)"
25+
options["ratio"] = "Gas/Oil Ratio (Rs) at Psat"
2626
if phase == "GAS":
27-
options["ratio"] = "Vaporized Oil Ratio (Rv)"
27+
options["ratio"] = "Vaporized Oil Ratio (Rv) at Psat"
2828
if phase == "WATER":
2929
options.pop("ratio")
3030
return options

webviz_subsurface/plugins/_pvt_plot/_views/_pvt/_utils/_plot_utils.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ def create_traces(
8989
data_frame = data_frame.loc[data_frame["KEYWORD"] == "PVTW"]
9090
dim_column_name = "PRESSURE"
9191

92-
data_frame = data_frame.sort_values(
93-
["PRESSURE", "VOLUMEFACTOR", "VISCOSITY"],
94-
ascending=[True, True, True],
95-
)
92+
# data_frame = data_frame.sort_values(
93+
# ["PRESSURE", "VOLUMEFACTOR", "VISCOSITY"],
94+
# ascending=[True, True, True],
95+
# )
9696

9797
constant_group = (
9898
data_frame["PVTNUM"].iloc[0]
@@ -180,7 +180,6 @@ def create_traces(
180180
realization,
181181
set_value,
182182
)
183-
184183
traces.extend(
185184
[
186185
{
@@ -217,6 +216,7 @@ def create_traces(
217216
"xaxis": "x",
218217
"yaxis": "y",
219218
"legendgroup": group,
219+
"name": group,
220220
"line": {
221221
"width": 1,
222222
"color": colors.get(group, colors[list(colors.keys())[-1]]),
@@ -267,7 +267,7 @@ def create_graph(
267267
"ratio": {
268268
"x_axis_title": rf"Pressure [{data_frame['PRESSURE_UNIT'].iloc[0]}]",
269269
"y_axis_title": rf"[{data_frame['RATIO_UNIT'].iloc[0]}]",
270-
"df_column": "DENSITY",
270+
"df_column": "RATIO",
271271
"show_scatter_values": False,
272272
"show_border_values": True,
273273
"show_border_markers": True,

webviz_subsurface/plugins/_pvt_plot/_views/_pvt/_view.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ def _update_plots(
191191
plot_id["plot"]: plot_id["plot"] in visibility
192192
for plot_id, visibility in zip(plots_visibility_ids, plots_visibility)
193193
}
194-
195194
graph_height = max(
196195
40.0,
197196
80.0
@@ -210,7 +209,6 @@ def _update_plots(
210209
for plot in ViewSettings.plot_visibility_options(phase):
211210
if not visible_plots[plot]:
212211
continue
213-
214212
current_element = wcc.WebvizViewElement(
215213
id=self.unique_id(plot),
216214
children=create_graph(
@@ -219,7 +217,7 @@ def _update_plots(
219217
colors,
220218
phase,
221219
plot,
222-
ViewSettings.plot_visibility_options(self.phases[phase])[plot],
220+
ViewSettings.plot_visibility_options(phase)[plot],
223221
self.plotly_theme,
224222
graph_height,
225223
),

0 commit comments

Comments
 (0)