reduction

Contents

reduction#

Tasks related to reducing events for use on further tasks.

Classes:

ReduceEvents(*args, **kwargs)

ReduceEventsWrapper(*args, **kwargs)

MergeReductionStats(*args, **kwargs)

MergeReductionStatsWrapper(*args, **kwargs)

MergeReducedEventsUser(*args, **kwargs)

MergeReducedEvents(*args, **kwargs)

MergeReducedEventsWrapper(*args, **kwargs)

class ReduceEvents(*args, **kwargs)[source]#

Bases: SelectorStepsMixin, CalibratorsMixin, ChunkedIOMixin, DatasetTask, LocalWorkflow, RemoteWorkflow

Attributes:

sandbox

reqs

missing_column_alias_strategy

check_overlapping_inputs

exclude_index

exclude_params_branch

exclude_params_htcondor_workflow

exclude_params_index

exclude_params_remote_workflow

exclude_params_repr

exclude_params_repr_empty

exclude_params_req

exclude_params_req_get

exclude_params_req_set

exclude_params_sandbox

exclude_params_slurm_workflow

exclude_params_workflow

Methods:

workflow_requires()

Hook to add workflow requirements.

requires()

The Tasks that this Task depends on.

output()

The output that this Task produces.

run()

The task run method, to be overridden in a subclass.

sandbox = 'bash::$CF_BASE/sandboxes/venv_columnar.sh'#
reqs = {'BuildBashSandbox': <class 'columnflow.tasks.framework.remote.BuildBashSandbox'>, 'BundleBashSandbox': <class 'columnflow.tasks.framework.remote.BundleBashSandbox'>, 'BundleCMSSWSandbox': <class 'columnflow.tasks.framework.remote.BundleCMSSWSandbox'>, 'BundleRepo': <class 'columnflow.tasks.framework.remote.BundleRepo'>, 'BundleSoftware': <class 'columnflow.tasks.framework.remote.BundleSoftware'>, 'CalibrateEvents': <class 'columnflow.tasks.calibration.CalibrateEvents'>, 'GetDatasetLFNs': <class 'columnflow.tasks.external.GetDatasetLFNs'>, 'SelectEvents': <class 'columnflow.tasks.selection.SelectEvents'>}#
missing_column_alias_strategy = 'original'#
workflow_requires()[source]#

Hook to add workflow requirements. This method is expected to return a dictionary. When this method is called from a branch task, an exception is raised.

requires()[source]#

The Tasks that this Task depends on.

A Task will only run if all of the Tasks that it requires are completed. If your Task does not require any other Tasks, then you don’t need to override this method. Otherwise, a subclass can override this method to return a single Task, a list of Task instances, or a dict whose values are Task instances.

See Task.requires

output()[source]#

The output that this Task produces.

The output of the Task determines if the Task needs to be run–the task is considered finished iff the outputs all exist. Subclasses should override this method to return a single Target or a list of Target instances.

Implementation note

If running multiple workers, the output must be a resource that is accessible by all workers, such as a DFS or database. Otherwise, workers might compute the same output since they don’t see the work done by other workers.

See Task.output

run()[source]#

The task run method, to be overridden in a subclass.

See Task.run

check_overlapping_inputs = <luigi.parameter.BoolParameter object>#
exclude_index = False#
exclude_params_branch = {'acceptance', 'branches', 'cancel_jobs', 'cleanup_jobs', 'htcondor_cpus', 'htcondor_flavor', 'htcondor_gpus', 'htcondor_logs', 'htcondor_memory', 'htcondor_pool', 'htcondor_scheduler', 'htcondor_share_software', 'ignore_submission', 'job_workers', 'max_runtime', 'no_poll', 'parallel_jobs', 'pilot', 'poll_fails', 'poll_interval', 'retries', 'shuffle_jobs', 'slurm_flavor', 'slurm_partition', 'submission_threads', 'tasks_per_job', 'tolerance', 'transfer_logs', 'walltime'}#
exclude_params_htcondor_workflow = {}#
exclude_params_index = {'effective_workflow', 'local_shift'}#
exclude_params_remote_workflow = {'local_shift'}#
exclude_params_repr = {'cancel_jobs', 'cleanup_jobs', 'workflow'}#
exclude_params_repr_empty = {'selector_steps'}#
exclude_params_req = {'check_finite_output', 'check_overlapping_inputs', 'effective_workflow', 'local_shift'}#
exclude_params_req_get = {}#
exclude_params_req_set = {}#
exclude_params_sandbox = {'local_shift', 'log_file', 'sandbox'}#
exclude_params_slurm_workflow = {}#
exclude_params_workflow = {'branch'}#
class ReduceEventsWrapper(*args, **kwargs)#

Bases: AnalysisTask, WrapperTask

Attributes:

configs

datasets

exclude_index

exclude_params_index

exclude_params_repr

exclude_params_repr_empty

exclude_params_req

exclude_params_req_get

exclude_params_req_set

exclude_params_sandbox

shifts

skip_configs

skip_datasets

skip_shifts

Methods:

requires()

Collect requirements defined by the underlying require_cls of the WrapperTask depending on optional additional parameters.

update_wrapper_params(params)

configs = <law.parameter.CSVParameter object>#
datasets = <law.parameter.CSVParameter object>#
exclude_index = False#
exclude_params_index = {}#
exclude_params_repr = {}#
exclude_params_repr_empty = {}#
exclude_params_req = {}#
exclude_params_req_get = {}#
exclude_params_req_set = {}#
exclude_params_sandbox = {'log_file', 'sandbox'}#
requires() Requirements#

Collect requirements defined by the underlying require_cls of the WrapperTask depending on optional additional parameters.

Return type:

Requirements

Returns:

Requirements for the WrapperTask instance.

shifts = <law.parameter.CSVParameter object>#
skip_configs = <law.parameter.CSVParameter object>#
skip_datasets = <law.parameter.CSVParameter object>#
skip_shifts = <law.parameter.CSVParameter object>#
update_wrapper_params(params)#
class MergeReductionStats(*args, **kwargs)[source]#

Bases: SelectorStepsMixin, CalibratorsMixin, DatasetTask

Attributes:

n_inputs

merged_size

reqs

exclude_index

exclude_params_index

exclude_params_remote_workflow

exclude_params_repr

exclude_params_repr_empty

exclude_params_req

exclude_params_req_get

exclude_params_req_set

exclude_params_sandbox

Methods:

resolve_param_values(params)

Resolve values params and check against possible default values and selector step groups.

requires()

The Tasks that this Task depends on.

output()

The output that this Task produces.

run()

The task run method, to be overridden in a subclass.

n_inputs = <luigi.parameter.IntParameter object>#
merged_size = <law.parameter.BytesParameter object>#
reqs = {'ReduceEvents': <class 'columnflow.tasks.reduction.ReduceEvents'>}#
classmethod resolve_param_values(params)[source]#

Resolve values params and check against possible default values and selector step groups.

Check the values in params against the default value "default_selector_steps" and the group "selector_step_groups" in the current config inst. For more information, see resolve_config_default(). If SelectorStepsMixin.selector_steps_order_sensitive is True, sort the selector steps.

Parameters:

params – Parameter values to resolve

Returns:

Dictionary of parameters that contains the requested selector steps under the keyword "selector_steps".

requires()[source]#

The Tasks that this Task depends on.

A Task will only run if all of the Tasks that it requires are completed. If your Task does not require any other Tasks, then you don’t need to override this method. Otherwise, a subclass can override this method to return a single Task, a list of Task instances, or a dict whose values are Task instances.

See Task.requires

output()[source]#

The output that this Task produces.

The output of the Task determines if the Task needs to be run–the task is considered finished iff the outputs all exist. Subclasses should override this method to return a single Target or a list of Target instances.

Implementation note

If running multiple workers, the output must be a resource that is accessible by all workers, such as a DFS or database. Otherwise, workers might compute the same output since they don’t see the work done by other workers.

See Task.output

run()[source]#

The task run method, to be overridden in a subclass.

See Task.run

exclude_index = False#
exclude_params_index = {'local_shift'}#
exclude_params_remote_workflow = {'local_shift'}#
exclude_params_repr = {}#
exclude_params_repr_empty = {'selector_steps'}#
exclude_params_req = {'local_shift'}#
exclude_params_req_get = {}#
exclude_params_req_set = {}#
exclude_params_sandbox = {'local_shift', 'log_file', 'sandbox'}#
class MergeReductionStatsWrapper(*args, **kwargs)#

Bases: AnalysisTask, WrapperTask

Attributes:

configs

datasets

exclude_index

exclude_params_index

exclude_params_repr

exclude_params_repr_empty

exclude_params_req

exclude_params_req_get

exclude_params_req_set

exclude_params_sandbox

shifts

skip_configs

skip_datasets

skip_shifts

Methods:

requires()

Collect requirements defined by the underlying require_cls of the WrapperTask depending on optional additional parameters.

update_wrapper_params(params)

configs = <law.parameter.CSVParameter object>#
datasets = <law.parameter.CSVParameter object>#
exclude_index = False#
exclude_params_index = {}#
exclude_params_repr = {}#
exclude_params_repr_empty = {}#
exclude_params_req = {}#
exclude_params_req_get = {}#
exclude_params_req_set = {}#
exclude_params_sandbox = {'log_file', 'sandbox'}#
requires() Requirements#

Collect requirements defined by the underlying require_cls of the WrapperTask depending on optional additional parameters.

Return type:

Requirements

Returns:

Requirements for the WrapperTask instance.

shifts = <law.parameter.CSVParameter object>#
skip_configs = <law.parameter.CSVParameter object>#
skip_datasets = <law.parameter.CSVParameter object>#
skip_shifts = <law.parameter.CSVParameter object>#
update_wrapper_params(params)#
class MergeReducedEventsUser(*args, **kwargs)[source]#

Bases: DatasetTask

Attributes:

merge_factor

cache_branch_map_default

reqs

file_merging

Needed by DatasetTask to define the default branch map.

merging_stats_exist

exclude_index

exclude_params_index

exclude_params_remote_workflow

exclude_params_repr

exclude_params_repr_empty

exclude_params_req

exclude_params_req_get

exclude_params_req_set

exclude_params_sandbox

Methods:

reduced_dummy_output()

maybe_dummy(func)

merge_factor = 20#
cache_branch_map_default = False#
reqs = {'MergeReductionStats': <class 'columnflow.tasks.reduction.MergeReductionStats'>}#
property file_merging#

Needed by DatasetTask to define the default branch map.

property merging_stats_exist#
reduced_dummy_output()[source]#
classmethod maybe_dummy(func)[source]#
exclude_index = False#
exclude_params_index = {'local_shift'}#
exclude_params_remote_workflow = {'local_shift'}#
exclude_params_repr = {}#
exclude_params_repr_empty = {}#
exclude_params_req = {'local_shift'}#
exclude_params_req_get = {}#
exclude_params_req_set = {}#
exclude_params_sandbox = {'local_shift', 'log_file', 'sandbox'}#
class MergeReducedEvents(*args, **kwargs)[source]#

Bases: SelectorStepsMixin, CalibratorsMixin, MergeReducedEventsUser, ForestMerge, RemoteWorkflow

Attributes:

sandbox

reqs

exclude_index

exclude_params_branch

exclude_params_forest_merge

exclude_params_htcondor_workflow

exclude_params_index

exclude_params_remote_workflow

exclude_params_repr

exclude_params_repr_empty

exclude_params_req

exclude_params_req_get

exclude_params_req_set

exclude_params_sandbox

exclude_params_slurm_workflow

exclude_params_workflow

Methods:

is_sandboxed()

create_branch_map()

Define the branch map for when this task is used as a workflow.

merge_workflow_requires()

merge_requires(start_branch, end_branch)

trace_merge_workflow_inputs(inputs)

trace_merge_inputs(inputs)

reduced_dummy_output()

merge_output()

merge(inputs, output)

sandbox = 'bash::$CF_BASE/sandboxes/venv_columnar.sh'#
reqs = {'BuildBashSandbox': <class 'columnflow.tasks.framework.remote.BuildBashSandbox'>, 'BundleBashSandbox': <class 'columnflow.tasks.framework.remote.BundleBashSandbox'>, 'BundleCMSSWSandbox': <class 'columnflow.tasks.framework.remote.BundleCMSSWSandbox'>, 'BundleRepo': <class 'columnflow.tasks.framework.remote.BundleRepo'>, 'BundleSoftware': <class 'columnflow.tasks.framework.remote.BundleSoftware'>, 'MergeReductionStats': <class 'columnflow.tasks.reduction.MergeReductionStats'>, 'ReduceEvents': <class 'columnflow.tasks.reduction.ReduceEvents'>}#
is_sandboxed()[source]#
create_branch_map()[source]#

Define the branch map for when this task is used as a workflow. By default, use the merging information provided by file_merging_factor to return a dictionary which maps branches to one or more input file indices. E.g. 1 -> [3, 4, 5] would mean that branch 1 is simultaneously handling input file indices 3, 4 and 5.

merge_workflow_requires()[source]#
merge_requires(start_branch, end_branch)[source]#
trace_merge_workflow_inputs(inputs)[source]#
trace_merge_inputs(inputs)[source]#
reduced_dummy_output()[source]#
merge_output()[source]#
merge(inputs, output)[source]#
exclude_index = False#
exclude_params_branch = {'acceptance', 'branches', 'cancel_jobs', 'cleanup_jobs', 'htcondor_cpus', 'htcondor_flavor', 'htcondor_gpus', 'htcondor_logs', 'htcondor_memory', 'htcondor_pool', 'htcondor_scheduler', 'htcondor_share_software', 'ignore_submission', 'job_workers', 'max_runtime', 'no_poll', 'parallel_jobs', 'pilot', 'poll_fails', 'poll_interval', 'retries', 'shuffle_jobs', 'slurm_flavor', 'slurm_partition', 'submission_threads', 'tasks_per_job', 'tolerance', 'transfer_logs', 'walltime'}#
exclude_params_forest_merge = {'branch', 'branches', 'keep_nodes', 'tree_depth', 'tree_index'}#
exclude_params_htcondor_workflow = {}#
exclude_params_index = {'effective_workflow', 'local_shift'}#
exclude_params_remote_workflow = {'local_shift'}#
exclude_params_repr = {'cancel_jobs', 'cleanup_jobs', 'workflow'}#
exclude_params_repr_empty = {'selector_steps'}#
exclude_params_req = {'effective_workflow', 'local_shift'}#
exclude_params_req_get = {}#
exclude_params_req_set = {}#
exclude_params_sandbox = {'local_shift', 'log_file', 'sandbox'}#
exclude_params_slurm_workflow = {}#
exclude_params_workflow = {'branch'}#
class MergeReducedEventsWrapper(*args, **kwargs)#

Bases: AnalysisTask, WrapperTask

Attributes:

configs

datasets

exclude_index

exclude_params_index

exclude_params_repr

exclude_params_repr_empty

exclude_params_req

exclude_params_req_get

exclude_params_req_set

exclude_params_sandbox

shifts

skip_configs

skip_datasets

skip_shifts

Methods:

requires()

Collect requirements defined by the underlying require_cls of the WrapperTask depending on optional additional parameters.

update_wrapper_params(params)

configs = <law.parameter.CSVParameter object>#
datasets = <law.parameter.CSVParameter object>#
exclude_index = False#
exclude_params_index = {}#
exclude_params_repr = {}#
exclude_params_repr_empty = {}#
exclude_params_req = {}#
exclude_params_req_get = {}#
exclude_params_req_set = {}#
exclude_params_sandbox = {'log_file', 'sandbox'}#
requires() Requirements#

Collect requirements defined by the underlying require_cls of the WrapperTask depending on optional additional parameters.

Return type:

Requirements

Returns:

Requirements for the WrapperTask instance.

shifts = <law.parameter.CSVParameter object>#
skip_configs = <law.parameter.CSVParameter object>#
skip_datasets = <law.parameter.CSVParameter object>#
skip_shifts = <law.parameter.CSVParameter object>#
update_wrapper_params(params)#