diff --git a/validphys2/src/validphys/config.py b/validphys2/src/validphys/config.py index 099e3e105f..95d285160f 100644 --- a/validphys2/src/validphys/config.py +++ b/validphys2/src/validphys/config.py @@ -1051,14 +1051,22 @@ def parse_use_t0(self, do_use_t0: bool): # TODO: Find a good name for this def produce_t0set( - self, t0pdfset=None, use_t0_sampling=False, use_t0_fitting=True, + self, t0pdfset=None, use_t0_sampling=False, use_t0_fitting=False, use_t0=False ): """Return the t0set if use_t0 is True and None otherwise. Raises an - error if t0 is requested but no t0set is given. + error if t0 is requested but no t0set is given or if an ambiguous combination is requested + Note that ``n3fit`` will set ``use_t0_fitting`` to `True` by default. """ - if use_t0_sampling or use_t0_fitting: + if not use_t0: + # Check that sampling and fitting t0 are also set to False + if use_t0_sampling: + raise ConfigError("Incompatible: sampling::use_t0 is True, but use_t0 is False") + if use_t0_fitting: + raise ConfigError("Incompatible: fitting::use_t0 is True, but use_t0 is False") + if use_t0: if not t0pdfset: - raise ConfigError("Setting use_t0 requires specifying a valid t0pdfset") + raise ConfigError("""Setting use_t0, use_t0_sampling or use_t0_fitting + requires specifying a valid t0pdfset""") return t0pdfset return None