mixins
#
Lightweight mixins task classes.
Classes:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- class CalibratorMixin(*args, **kwargs)[source]#
Bases:
ConfigTask
Attributes:
Methods:
get_calibrator_inst
(calibrator[, kwargs])resolve_param_values
(params)get_known_shifts
(config_inst, params)Returns two sets of shifts in a tuple: shifts implemented by _this_ task, and depdenent shifts implemented by upstream tasks.
req_params
(inst, **kwargs)Returns parameters that are jointly defined in this class and another task instance of some other class.
Returns a
law.util.InsertableDict
whose values are used to create a store path.- calibrator = <luigi.parameter.Parameter object>#
- register_calibrator_shifts = False#
- classmethod get_known_shifts(config_inst, params)[source]#
Returns two sets of shifts in a tuple: shifts implemented by _this_ task, and depdenent shifts implemented by upstream tasks.
- classmethod req_params(inst, **kwargs)[source]#
Returns parameters that are jointly defined in this class and another task instance of some other class. The parameters are used when calling
Task.req(self)
.- Return type:
- property calibrator_inst#
- store_parts()[source]#
Returns a
law.util.InsertableDict
whose values are used to create a store path. For instance, the parts{"keyA": "a", "keyB": "b", 2: "c"}
lead to the path “a/b/c”. The keys can be used by subclassing tasks to overwrite values.
- 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'}#
- class CalibratorsMixin(*args, **kwargs)[source]#
Bases:
ConfigTask
Attributes:
Methods:
get_calibrator_insts
(calibrators[, kwargs])resolve_param_values
(params)get_known_shifts
(config_inst, params)Returns two sets of shifts in a tuple: shifts implemented by _this_ task, and depdenent shifts implemented by upstream tasks.
req_params
(inst, **kwargs)Returns parameters that are jointly defined in this class and another task instance of some other class.
Returns a
law.util.InsertableDict
whose values are used to create a store path.- calibrators = <law.parameter.CSVParameter object>#
- register_calibrators_shifts = False#
- classmethod get_known_shifts(config_inst, params)[source]#
Returns two sets of shifts in a tuple: shifts implemented by _this_ task, and depdenent shifts implemented by upstream tasks.
- classmethod req_params(inst, **kwargs)[source]#
Returns parameters that are jointly defined in this class and another task instance of some other class. The parameters are used when calling
Task.req(self)
.- Return type:
- property calibrator_insts#
- store_parts()[source]#
Returns a
law.util.InsertableDict
whose values are used to create a store path. For instance, the parts{"keyA": "a", "keyB": "b", 2: "c"}
lead to the path “a/b/c”. The keys can be used by subclassing tasks to overwrite values.
- 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'}#
- class SelectorMixin(*args, **kwargs)[source]#
Bases:
ConfigTask
Attributes:
Methods:
get_selector_inst
(selector[, kwargs])resolve_param_values
(params)get_known_shifts
(config_inst, params)Returns two sets of shifts in a tuple: shifts implemented by _this_ task, and depdenent shifts implemented by upstream tasks.
req_params
(inst, **kwargs)Returns parameters that are jointly defined in this class and another task instance of some other class.
Returns a
law.util.InsertableDict
whose values are used to create a store path.- selector = <luigi.parameter.Parameter object>#
- register_selector_shifts = False#
- classmethod get_known_shifts(config_inst, params)[source]#
Returns two sets of shifts in a tuple: shifts implemented by _this_ task, and depdenent shifts implemented by upstream tasks.
- classmethod req_params(inst, **kwargs)[source]#
Returns parameters that are jointly defined in this class and another task instance of some other class. The parameters are used when calling
Task.req(self)
.- Return type:
- property selector_inst#
- store_parts()[source]#
Returns a
law.util.InsertableDict
whose values are used to create a store path. For instance, the parts{"keyA": "a", "keyB": "b", 2: "c"}
lead to the path “a/b/c”. The keys can be used by subclassing tasks to overwrite values.
- 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'}#
- class SelectorStepsMixin(*args, **kwargs)[source]#
Bases:
SelectorMixin
Attributes:
Methods:
resolve_param_values
(params)req_params
(inst, **kwargs)Returns parameters that are jointly defined in this class and another task instance of some other class.
Returns a
law.util.InsertableDict
whose values are used to create a store path.- selector_steps = <law.parameter.CSVParameter object>#
- exclude_params_repr_empty = {'selector_steps'}#
- selector_steps_order_sensitive = False#
- classmethod req_params(inst, **kwargs)[source]#
Returns parameters that are jointly defined in this class and another task instance of some other class. The parameters are used when calling
Task.req(self)
.- Return type:
- store_parts()[source]#
Returns a
law.util.InsertableDict
whose values are used to create a store path. For instance, the parts{"keyA": "a", "keyB": "b", 2: "c"}
lead to the path “a/b/c”. The keys can be used by subclassing tasks to overwrite values.- Return type:
- exclude_index = False#
- exclude_params_index = {}#
- exclude_params_repr = {}#
- exclude_params_req = {}#
- exclude_params_req_get = {}#
- exclude_params_req_set = {}#
- exclude_params_sandbox = {'log_file', 'sandbox'}#
- class ProducerMixin(*args, **kwargs)[source]#
Bases:
ConfigTask
Attributes:
Methods:
get_producer_inst
(producer[, kwargs])resolve_param_values
(params)get_known_shifts
(config_inst, params)Returns two sets of shifts in a tuple: shifts implemented by _this_ task, and depdenent shifts implemented by upstream tasks.
req_params
(inst, **kwargs)Returns parameters that are jointly defined in this class and another task instance of some other class.
Returns a
law.util.InsertableDict
whose values are used to create a store path.- producer = <luigi.parameter.Parameter object>#
- register_producer_shifts = False#
- classmethod get_known_shifts(config_inst, params)[source]#
Returns two sets of shifts in a tuple: shifts implemented by _this_ task, and depdenent shifts implemented by upstream tasks.
- classmethod req_params(inst, **kwargs)[source]#
Returns parameters that are jointly defined in this class and another task instance of some other class. The parameters are used when calling
Task.req(self)
.- Return type:
- property producer_inst#
- store_parts()[source]#
Returns a
law.util.InsertableDict
whose values are used to create a store path. For instance, the parts{"keyA": "a", "keyB": "b", 2: "c"}
lead to the path “a/b/c”. The keys can be used by subclassing tasks to overwrite values.
- 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'}#
- class ProducersMixin(*args, **kwargs)[source]#
Bases:
ConfigTask
Attributes:
Methods:
get_producer_insts
(producers[, kwargs])resolve_param_values
(params)get_known_shifts
(config_inst, params)Returns two sets of shifts in a tuple: shifts implemented by _this_ task, and depdenent shifts implemented by upstream tasks.
req_params
(inst, **kwargs)Returns parameters that are jointly defined in this class and another task instance of some other class.
Returns a
law.util.InsertableDict
whose values are used to create a store path.- producers = <law.parameter.CSVParameter object>#
- register_producers_shifts = False#
- classmethod get_known_shifts(config_inst, params)[source]#
Returns two sets of shifts in a tuple: shifts implemented by _this_ task, and depdenent shifts implemented by upstream tasks.
- classmethod req_params(inst, **kwargs)[source]#
Returns parameters that are jointly defined in this class and another task instance of some other class. The parameters are used when calling
Task.req(self)
.- Return type:
- property producer_insts#
- store_parts()[source]#
Returns a
law.util.InsertableDict
whose values are used to create a store path. For instance, the parts{"keyA": "a", "keyB": "b", 2: "c"}
lead to the path “a/b/c”. The keys can be used by subclassing tasks to overwrite values.
- 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'}#
- class MLModelMixinBase(*args, **kwargs)[source]#
Bases:
AnalysisTask
Attributes:
Methods:
req_params
(inst, **kwargs)Returns parameters that are jointly defined in this class and another task instance of some other class.
get_ml_model_inst
(ml_model, analysis_inst[, ...])- rtype:
MLModel
events_used_in_training
(config_inst, ...)- rtype:
- ml_model = <luigi.parameter.Parameter object>#
- exclude_params_repr_empty = {'ml_model'}#
- classmethod req_params(inst, **kwargs)[source]#
Returns parameters that are jointly defined in this class and another task instance of some other class. The parameters are used when calling
Task.req(self)
.- Return type:
- classmethod get_ml_model_inst(ml_model, analysis_inst, requested_configs=None, **kwargs)[source]#
- Return type:
- exclude_index = False#
- exclude_params_index = {}#
- exclude_params_repr = {}#
- exclude_params_req = {}#
- exclude_params_req_get = {}#
- exclude_params_req_set = {}#
- exclude_params_sandbox = {'log_file', 'sandbox'}#
- class MLModelTrainingMixin(*args, **kwargs)[source]#
Bases:
MLModelMixinBase
Attributes:
Methods:
resolve_calibrators
(ml_model_inst, params)resolve_selectors
(ml_model_inst, params)resolve_producers
(ml_model_inst, params)resolve_param_values
(params)Returns a
law.util.InsertableDict
whose values are used to create a store path.- configs = <law.parameter.CSVParameter object>#
- calibrators = <law.parameter.MultiCSVParameter object>#
- selectors = <law.parameter.CSVParameter object>#
- producers = <law.parameter.MultiCSVParameter object>#
- store_parts()[source]#
Returns a
law.util.InsertableDict
whose values are used to create a store path. For instance, the parts{"keyA": "a", "keyB": "b", 2: "c"}
lead to the path “a/b/c”. The keys can be used by subclassing tasks to overwrite values.- Return type:
- exclude_index = False#
- exclude_params_index = {}#
- exclude_params_repr = {}#
- exclude_params_repr_empty = {'ml_model'}#
- exclude_params_req = {}#
- exclude_params_req_get = {}#
- exclude_params_req_set = {}#
- exclude_params_sandbox = {'log_file', 'sandbox'}#
- class MLModelMixin(*args, **kwargs)[source]#
Bases:
ConfigTask
,MLModelMixinBase
Attributes:
Methods:
resolve_param_values
(params)Returns a
law.util.InsertableDict
whose values are used to create a store path.- ml_model = <luigi.parameter.Parameter object>#
- allow_empty_ml_model = True#
- exclude_params_repr_empty = {'ml_model'}#
- store_parts()[source]#
Returns a
law.util.InsertableDict
whose values are used to create a store path. For instance, the parts{"keyA": "a", "keyB": "b", 2: "c"}
lead to the path “a/b/c”. The keys can be used by subclassing tasks to overwrite values.- Return type:
- exclude_index = False#
- exclude_params_index = {}#
- exclude_params_repr = {}#
- exclude_params_req = {}#
- exclude_params_req_get = {}#
- exclude_params_req_set = {}#
- exclude_params_sandbox = {'log_file', 'sandbox'}#
- class MLModelDataMixin(*args, **kwargs)[source]#
Bases:
MLModelMixin
Attributes:
Methods:
Returns a
law.util.InsertableDict
whose values are used to create a store path.- allow_empty_ml_model = False#
- store_parts()[source]#
Returns a
law.util.InsertableDict
whose values are used to create a store path. For instance, the parts{"keyA": "a", "keyB": "b", 2: "c"}
lead to the path “a/b/c”. The keys can be used by subclassing tasks to overwrite values.- Return type:
- exclude_index = False#
- exclude_params_index = {}#
- exclude_params_repr = {}#
- exclude_params_repr_empty = {'ml_model'}#
- exclude_params_req = {}#
- exclude_params_req_get = {}#
- exclude_params_req_set = {}#
- exclude_params_sandbox = {'log_file', 'sandbox'}#
- class MLModelsMixin(*args, **kwargs)[source]#
Bases:
ConfigTask
Attributes:
Methods:
resolve_param_values
(params)req_params
(inst, **kwargs)Returns parameters that are jointly defined in this class and another task instance of some other class.
Returns a
law.util.InsertableDict
whose values are used to create a store path.- ml_models = <law.parameter.CSVParameter object>#
- allow_empty_ml_models = True#
- exclude_params_repr_empty = {'ml_models'}#
- classmethod req_params(inst, **kwargs)[source]#
Returns parameters that are jointly defined in this class and another task instance of some other class. The parameters are used when calling
Task.req(self)
.- Return type:
- store_parts()[source]#
Returns a
law.util.InsertableDict
whose values are used to create a store path. For instance, the parts{"keyA": "a", "keyB": "b", 2: "c"}
lead to the path “a/b/c”. The keys can be used by subclassing tasks to overwrite values.- Return type:
- exclude_index = False#
- exclude_params_index = {}#
- exclude_params_repr = {}#
- exclude_params_req = {}#
- exclude_params_req_get = {}#
- exclude_params_req_set = {}#
- exclude_params_sandbox = {'log_file', 'sandbox'}#
- class InferenceModelMixin(*args, **kwargs)[source]#
Bases:
ConfigTask
Attributes:
Methods:
resolve_param_values
(params)get_inference_model_inst
(inference_model, ...)- rtype:
req_params
(inst, **kwargs)Returns parameters that are jointly defined in this class and another task instance of some other class.
Returns a
law.util.InsertableDict
whose values are used to create a store path.- inference_model = <luigi.parameter.Parameter object>#
- classmethod req_params(inst, **kwargs)[source]#
Returns parameters that are jointly defined in this class and another task instance of some other class. The parameters are used when calling
Task.req(self)
.- Return type:
- store_parts()[source]#
Returns a
law.util.InsertableDict
whose values are used to create a store path. For instance, the parts{"keyA": "a", "keyB": "b", 2: "c"}
lead to the path “a/b/c”. The keys can be used by subclassing tasks to overwrite values.- Return type:
- 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'}#
- class CategoriesMixin(*args, **kwargs)[source]#
Bases:
ConfigTask
Attributes:
Methods:
resolve_param_values
(params)- categories = <law.parameter.CSVParameter object>#
- default_categories = None#
- allow_empty_categories = False#
- property categories_repr#
- 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'}#
- class VariablesMixin(*args, **kwargs)[source]#
Bases:
ConfigTask
Attributes:
Methods:
resolve_param_values
(params)split_multi_variable
(variable)Splits a multi-dimensional variable given in the format
"var_a[-var_b[-...]]"
into separate variable names using a delimiter ("-"
) and returns a tuple.join_multi_variable
(variables)Joins the name of multiple variables using a delimiter (
"-"
) into a single string that represents a multi-dimensional variable and returns it.- variables = <law.parameter.CSVParameter object>#
- default_variables = None#
- allow_empty_variables = False#
- classmethod split_multi_variable(variable)[source]#
Splits a multi-dimensional variable given in the format
"var_a[-var_b[-...]]"
into separate variable names using a delimiter ("-"
) and returns a tuple.
- classmethod join_multi_variable(variables)[source]#
Joins the name of multiple variables using a delimiter (
"-"
) into a single string that represents a multi-dimensional variable and returns it.- Return type:
- property variables_repr#
- 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'}#
- class DatasetsProcessesMixin(*args, **kwargs)[source]#
Bases:
ConfigTask
Attributes:
Methods:
resolve_param_values
(params)get_known_shifts
(config_inst, params)Returns two sets of shifts in a tuple: shifts implemented by _this_ task, and depdenent shifts implemented by upstream tasks.
- datasets = <law.parameter.CSVParameter object>#
- processes = <law.parameter.CSVParameter object>#
- allow_empty_datasets = False#
- allow_empty_processes = False#
- classmethod get_known_shifts(config_inst, params)[source]#
Returns two sets of shifts in a tuple: shifts implemented by _this_ task, and depdenent shifts implemented by upstream tasks.
- property datasets_repr#
- property processes_repr#
- 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'}#
- class ShiftSourcesMixin(*args, **kwargs)[source]#
Bases:
ConfigTask
Attributes:
Methods:
resolve_param_values
(params)expand_shift_sources
(sources)- rtype:
list[str]
reduce_shifts
(shifts)- rtype:
list[str]
- shift_sources = <law.parameter.CSVParameter object>#
- allow_empty_shift_sources = False#
- property shift_sources_repr#
- 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'}#
- class EventWeightMixin(*args, **kwargs)[source]#
Bases:
ConfigTask
Methods:
get_known_shifts
(config_inst, params)Returns two sets of shifts in a tuple: shifts implemented by _this_ task, and depdenent shifts implemented by upstream tasks.
Attributes:
- classmethod get_known_shifts(config_inst, params)[source]#
Returns two sets of shifts in a tuple: shifts implemented by _this_ task, and depdenent shifts implemented by upstream tasks.
- 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'}#
- class ChunkedIOMixin(*args, **kwargs)[source]#
Bases:
AnalysisTask
Attributes:
Methods:
iter_chunked_io
(*args, **kwargs)raise_if_not_finite
(ak_array)Perform explicit check whether all values in array ak_array are finite.
- check_finite = <luigi.parameter.BoolParameter object>#
- exclude_params_req = {'check_finite'}#
- exclude_index = False#
- exclude_params_index = {}#
- exclude_params_repr = {}#
- exclude_params_repr_empty = {}#
- exclude_params_req_get = {}#
- exclude_params_req_set = {}#
- exclude_params_sandbox = {'log_file', 'sandbox'}#
- classmethod raise_if_not_finite(ak_array)[source]#
Perform explicit check whether all values in array ak_array are finite.
The check is performed using the
numpy.isfinite()
function- Parameters:
ak_array (
Array
) – Array with events to check.- Raises:
ValueError – If any value in ak_array is not finite.
- Return type: