diff --git a/src/flownet/ahm/_run_ahm.py b/src/flownet/ahm/_run_ahm.py index 0a769ac63..4d725903b 100644 --- a/src/flownet/ahm/_run_ahm.py +++ b/src/flownet/ahm/_run_ahm.py @@ -36,12 +36,6 @@ def _find_training_set_fraction( training_set_fraction = 1.0 if config.flownet.training_set_end_date is not None: - if config.flownet.training_set_fraction is not None: - print( - "\nTraining set fraction and training set end date are both defined in config file.\n" - "The input given for training set fraction will be ignored.\n" - "The training set end date will be used to calculate the training set fraction.\n" - ) if ( not schedule.get_first_date() <= config.flownet.training_set_end_date diff --git a/src/flownet/config_parser/_config_parser.py b/src/flownet/config_parser/_config_parser.py index 5c2d873ae..2c72c6526 100644 --- a/src/flownet/config_parser/_config_parser.py +++ b/src/flownet/config_parser/_config_parser.py @@ -344,7 +344,7 @@ def create_schema(_to_abs_path) -> Dict: MK.Type: types.NamedDict, MK.Content: { "scheme": {MK.Type: types.String, MK.Default: "global"}, - "datum_depth": {MK.Type: types.Number}, + "datum_depth": {MK.Type: types.Number, MK.AllowNone: True}, "datum_pressure": { MK.Type: types.NamedDict, MK.Content: { @@ -518,4 +518,10 @@ def _to_abs_path(path: Optional[str]) -> str: ): raise ValueError(f"The input case {suffix} file does not exist") + if config.flownet.training_set_end_date and config.flownet.training_set_fraction: + raise ValueError( + "Ambiguous configuration input: 'training_set_fraction' and 'training_set_end_date' are " + "both defined in the configuration file." + ) + return config diff --git a/tests/configs/norne_parameters.yml b/tests/configs/norne_parameters.yml index a103011b3..9380b3872 100644 --- a/tests/configs/norne_parameters.yml +++ b/tests/configs/norne_parameters.yml @@ -10,7 +10,6 @@ flownet: random_seed: 999 perforation_handling_strategy: bottom_point fast_pyscal: True - training_set_fraction: 0.7 # Fraction of observations (from 0 to 1) to use as training data training_set_end_date: 2005-01-31 #YYYY-MM-DD. If defined training set fraction is calculated from this date fault_tolerance: 0.1