Skip to content

Commit 7b0ff05

Browse files
committed
Warning when using ERROR_MODE != ABS
1 parent f761f64 commit 7b0ff05

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/subscript/fmuobs/fmuobs.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,22 @@ def fmuobs(
346346
if not validate_internal_dframe(dframe):
347347
logger.error("Observation dataframe is invalid!")
348348

349+
# Trigger warning if user specify ERROR_MODE != ABS
350+
# in BLOCK_OBSERVATION and SUMMARY_OBSERVATION
351+
if "ERROR_MODE" in dframe.columns:
352+
error_mode = list(
353+
dframe[
354+
(dframe["CLASS"].isin(["BLOCK_OBSERVATION", "SUMMARY_OBSERVATION"]))
355+
& (dframe["ERROR_MODE"] != "ABS")
356+
]["ERROR_MODE"]
357+
.dropna()
358+
.unique()
359+
)
360+
if len(error_mode) > 0:
361+
logger.warn(
362+
f"Unsupported ERROR_MODE : {', '.join(error_mode)}. Please verify the output file"
363+
)
364+
349365
dump_results(dframe, csv, yml, resinsight, ertobs)
350366

351367

0 commit comments

Comments
 (0)