Skip to content

Commit 9105785

Browse files
author
siranipour
committed
Assigning default value of None to theoryID
1 parent fe48936 commit 9105785

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

validphys2/src/validphys/config.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,6 @@ def produce_cuts(self, *, commondata, use_cuts, rules, fit=None, theoryid=None):
381381
except LoadFailedError as e:
382382
raise ConfigError(e) from e
383383
elif use_cuts is CutsPolicy.INTERNAL:
384-
if not theoryid:
385-
raise ConfigError("theoryid must be specified for internal cuts")
386384
return self.loader.check_internal_cuts(commondata, rules)
387385
elif use_cuts is CutsPolicy.FROM_CUT_INTERSECTION_NAMESPACE:
388386
cut_list = []
@@ -1046,9 +1044,9 @@ def parse_default_filter_rules_recorded_spec_(self, spec):
10461044

10471045
def produce_rules(
10481046
self,
1049-
theoryid,
10501047
use_cuts,
10511048
defaults,
1049+
theoryid=None,
10521050
default_filter_rules=None,
10531051
filter_rules=None,
10541052
default_filter_rules_recorded_spec_=None,
@@ -1061,8 +1059,6 @@ def produce_rules(
10611059
default_filter_rules_input,
10621060
)
10631061

1064-
theory_parameters = theoryid.get_description()
1065-
10661062
if filter_rules is None:
10671063
# Don't bother loading the rules if we are not using them.
10681064
if use_cuts is not CutsPolicy.INTERNAL:
@@ -1076,6 +1072,14 @@ def produce_rules(
10761072
else:
10771073
filter_rules = default_filter_rules_input()
10781074

1075+
if theoryid is None:
1076+
raise ConfigError(
1077+
"Valid theoryid is required when rules are set to "
1078+
f"`{CutsPolicy.INTERNAL}`"
1079+
)
1080+
1081+
theory_parameters = theoryid.get_description()
1082+
10791083
try:
10801084
rule_list = [
10811085
Rule(

0 commit comments

Comments
 (0)