Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions validphys2/src/validphys/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down