Skip to content

Commit

Permalink
fmuobs Warning when using ERROR_MODE != ABS (#628)
Browse files Browse the repository at this point in the history
  • Loading branch information
alifbe authored Oct 27, 2023
1 parent f761f64 commit 38cbb53
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/subscript/fmuobs/fmuobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,23 @@ def fmuobs(
if not validate_internal_dframe(dframe):
logger.error("Observation dataframe is invalid!")

# Trigger warning if user specify ERROR_MODE != ABS
# in BLOCK_OBSERVATION and SUMMARY_OBSERVATION
if isinstance(dframe, pd.DataFrame) and "ERROR_MODE" in dframe.columns:
error_mode = list(
dframe[
(dframe["CLASS"].isin(["BLOCK_OBSERVATION", "SUMMARY_OBSERVATION"]))
& (dframe["ERROR_MODE"] != "ABS")
]["ERROR_MODE"]
.dropna()
.unique()
)
if len(error_mode) > 0:
logger.warn(
f"Unsupported ERROR_MODE : {', '.join(error_mode)}. "
"Please verify the output file"
)

dump_results(dframe, csv, yml, resinsight, ertobs)


Expand Down

0 comments on commit 38cbb53

Please sign in to comment.