Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pvt issue 1202 #1212

Merged
merged 4 commits into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions webviz_subsurface/_datainput/pvt_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ def filter_pvt_data_frame(
"The dataframe must contain a column for the ratio (OGR, GOR, R, RV, RS)."
)
if not "VOLUMEFACTOR_UNIT" in data_frame.columns:
data_frame["VOLUMEFACTOR_UNIT"] = "rm鲁/sm鲁"
data_frame["VOLUMEFACTOR_UNIT"] = "Rm鲁/Sm鲁"
if not "PRESSURE_UNIT" in data_frame.columns:
data_frame["PRESSURE_UNIT"] = "bar"
if not "VISCOSITY_UNIT" in data_frame.columns:
data_frame["VISCOSITY_UNIT"] = "cP"
if not "DENSITY_UNIT" in data_frame.columns:
data_frame["DENSITY_UNIT"] = "kg/m鲁"
if not "RATIO_UNIT" in data_frame.columns:
data_frame["RATIO_UNIT"] = "Scm鲁/Scm鲁"
data_frame["RATIO_UNIT"] = "Sm鲁/Sm鲁"

if not "DENSITY" in data_frame.columns:
data_frame = calculate_densities(data_frame)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ def plot_visibility_options(phase: str = "") -> Dict[str, str]:
"fvf": "Formation Volume Factor",
"viscosity": "Viscosity",
"density": "Density",
"ratio": "Gas/Oil Ratio (Rs)",
"ratio": "Fluid Ratio",
}
if phase == "OIL":
options["ratio"] = "Gas/Oil Ratio (Rs)"
options["ratio"] = "Gas/Oil Ratio (Rs) at Psat"
if phase == "GAS":
options["ratio"] = "Vaporized Oil Ratio (Rv)"
options["ratio"] = "Vaporized Oil Ratio (Rv) at Psat"
if phase == "WATER":
options.pop("ratio")
return options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ def create_traces(
data_frame = data_frame.loc[data_frame["KEYWORD"] == "PVTW"]
dim_column_name = "PRESSURE"

data_frame = data_frame.sort_values(
["PRESSURE", "VOLUMEFACTOR", "VISCOSITY"],
ascending=[True, True, True],
)
# data_frame = data_frame.sort_values(
# ["PRESSURE", "VOLUMEFACTOR", "VISCOSITY"],
# ascending=[True, True, True],
# )
Comment on lines +92 to +95
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember correctly this was only to ensure that the list is sorted and that the points plotted are connected with lines in the correct order (under the assumption that Plotly is plotting in the order given by the input array). This might not have an effect since the data frame might already be sorted beforehand. However, I wonder if the plots would still be correct if the df wasn't. If we are 100% sure that the df is always sorted correctly, this can be removed.


constant_group = (
data_frame["PVTNUM"].iloc[0]
Expand Down Expand Up @@ -180,7 +180,6 @@ def create_traces(
realization,
set_value,
)

traces.extend(
[
{
Expand Down Expand Up @@ -217,6 +216,7 @@ def create_traces(
"xaxis": "x",
"yaxis": "y",
"legendgroup": group,
"name": group,
"line": {
"width": 1,
"color": colors.get(group, colors[list(colors.keys())[-1]]),
Expand Down Expand Up @@ -267,7 +267,7 @@ def create_graph(
"ratio": {
"x_axis_title": rf"Pressure [{data_frame['PRESSURE_UNIT'].iloc[0]}]",
"y_axis_title": rf"[{data_frame['RATIO_UNIT'].iloc[0]}]",
"df_column": "DENSITY",
"df_column": "RATIO",
"show_scatter_values": False,
"show_border_values": True,
"show_border_markers": True,
Expand Down
4 changes: 1 addition & 3 deletions webviz_subsurface/plugins/_pvt_plot/_views/_pvt/_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ def _update_plots(
plot_id["plot"]: plot_id["plot"] in visibility
for plot_id, visibility in zip(plots_visibility_ids, plots_visibility)
}

graph_height = max(
40.0,
80.0
Expand All @@ -210,7 +209,6 @@ def _update_plots(
for plot in ViewSettings.plot_visibility_options(phase):
if not visible_plots[plot]:
continue

current_element = wcc.WebvizViewElement(
id=self.unique_id(plot),
children=create_graph(
Expand All @@ -219,7 +217,7 @@ def _update_plots(
colors,
phase,
plot,
ViewSettings.plot_visibility_options(self.phases[phase])[plot],
ViewSettings.plot_visibility_options(phase)[plot],
self.plotly_theme,
graph_height,
),
Expand Down
Loading