Skip to content

Commit

Permalink
Merge pull request columnflow#501 from columnflow/fix/selection_steps…
Browse files Browse the repository at this point in the history
…_defaults
  • Loading branch information
riga authored Jul 15, 2024
2 parents f891f10 + f3b19ea commit 3be6e1b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion columnflow/tasks/framework/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ def my_inference_model(self):

# interpret missing parameters (e.g. NO_STR) as None
# (special case: an empty string is usually an active decision, but counts as missing too)
if law.is_no_param(param) or resolve_default or param == "":
if law.is_no_param(param) or resolve_default or param == "" or param == ():
param = None

# actual resolution
Expand Down
20 changes: 11 additions & 9 deletions columnflow/tasks/framework/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class CalibratorsMixin(ConfigTask):
calibrators = law.CSVParameter(
default=(RESOLVE_DEFAULT,),
description="comma-separated names of calibrators to be applied; default: value of the "
"'default_calibrator' config in a 1-tuple",
"'default_calibrator' config",
brace_expand=True,
parse_empty=True,
)
Expand Down Expand Up @@ -588,17 +588,17 @@ def find_keep_columns(self: ConfigTask, collection: ColumnCollection) -> set[Rou


class SelectorStepsMixin(SelectorMixin):
"""Mixin to include multiple selector steps into tasks.
"""
Mixin to include multiple selector steps into tasks.
Inheriting from this mixin will allow a task to access selector steps,
which can be a comma-separated list of selector step names and is an input
parameter for this task.
Inheriting from this mixin will allow a task to access selector steps, which can be a
comma-separated list of selector step names and is an input parameter for this task.
"""

selector_steps = law.CSVParameter(
default=(),
default=(RESOLVE_DEFAULT,),
description="a subset of steps of the selector to apply; uses all steps when empty; "
"empty default",
"default: value of the 'default_selector_steps' config",
brace_expand=True,
parse_empty=True,
)
Expand Down Expand Up @@ -881,7 +881,8 @@ class ProducersMixin(ConfigTask):

producers = law.CSVParameter(
default=(RESOLVE_DEFAULT,),
description="comma-separated names of producers to be applied; empty default",
description="comma-separated names of producers to be applied; default: value of the "
"'default_producer' config",
brace_expand=True,
parse_empty=True,
)
Expand Down Expand Up @@ -1591,7 +1592,8 @@ class MLModelsMixin(ConfigTask):

ml_models = law.CSVParameter(
default=(RESOLVE_DEFAULT,),
description="comma-separated names of ML models to be applied; empty default",
description="comma-separated names of ML models to be applied; default: value of the "
"'default_ml_model' config",
brace_expand=True,
parse_empty=True,
)
Expand Down

0 comments on commit 3be6e1b

Please sign in to comment.