Skip to content

Commit

Permalink
ENH: Set NET equal BULK if missing in inplace_volumes (equinor#948)
Browse files Browse the repository at this point in the history
  • Loading branch information
tnatt committed Jan 3, 2025
1 parent e5ca3bf commit 82ad2f6
Show file tree
Hide file tree
Showing 3 changed files with 542 additions and 504 deletions.
12 changes: 12 additions & 0 deletions src/fmu/dataio/export/rms/inplace_volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,17 @@ def _add_missing_columns_to_table(table: pd.DataFrame) -> pd.DataFrame:
table[col] = np.nan
return table

@staticmethod
def _set_net_equal_to_bulk_if_missing_in_table(table: pd.DataFrame) -> pd.DataFrame:
"""
Add a NET column to the table equal to the BULK column if NET is missing,
since the absence implies a net-to-gross ratio of 1.
"""
if _VolumetricColumns.NET.value not in table:
_logger.debug("NET column missing, setting NET equal BULK...")
table[_VolumetricColumns.NET.value] = table[_VolumetricColumns.BULK.value]
return table

@staticmethod
def _set_table_column_order(table: pd.DataFrame) -> pd.DataFrame:
"""Set the column order in the table."""
Expand Down Expand Up @@ -230,6 +241,7 @@ def _convert_table_from_legacy_to_standard_format(
]
table = self._compute_water_zone_volumes_from_totals(table)
table = self._transform_and_add_fluid_column_to_table(table, table_index)
table = self._set_net_equal_to_bulk_if_missing_in_table(table)
table = self._add_missing_columns_to_table(table)
return self._set_table_column_order(table)

Expand Down
Loading

0 comments on commit 82ad2f6

Please sign in to comment.