luigi_tools.parameter¶
This module provides some specific luigi parameters.
Classes
|
Class to parse boolean parameters and set explicit parsing when default is True. |
|
Class to parse file extension parameters. |
|
Class to parse optional bool parameters. |
|
Class to parse optional choice parameters. |
|
Class to parse optional dict parameters. |
|
Class to parse optional float parameters. |
|
Class to parse optional int parameters. |
|
Class to parse optional list parameters. |
|
Class to parse optional numerical parameters. |
|
Mixin to make a parameter class optional. |
|
Class to parse optional path parameters. |
|
Class to parse optional ratio parameters. |
|
Class to parse optional str parameters. |
|
Class to parse optional tuple parameters. |
|
Class to parse file path parameters. |
|
Class to parse ratio parameters. |
Exceptions
Warning class for OptionalParameter with wrong type. |
|
Warning class for parameters that are not consumed by the task. |
- class luigi_tools.parameter.BoolParameter(*args, **kwargs)¶
Bases:
BoolParameter
Class to parse boolean parameters and set explicit parsing when default is True.
- class luigi_tools.parameter.ExtParameter(default=<object object>, is_global=False, significant=True, description=None, config_path=None, positional=True, always_in_help=False, batch_method=None, visibility=ParameterVisibility.PUBLIC)¶
Bases:
Parameter
Class to parse file extension parameters.
- normalize(x)¶
Normalize the given value to an extension suffix without dot.
- class luigi_tools.parameter.OptionalBoolParameter(*args, **kwargs)¶
Bases:
OptionalParameter
,BoolParameter
Class to parse optional bool parameters.
Moved to luigi
This feature was moved to the
luigi
package and will be available after the version 3.0.3. It will be deprecated in a future version.
- class luigi_tools.parameter.OptionalChoiceParameter(*args, **kwargs)¶
Bases:
OptionalParameter
,ChoiceParameter
Class to parse optional choice parameters.
Moved to luigi
This feature was moved to the
luigi
package and will be available after the version 3.0.3. It will be deprecated in a future version.
- class luigi_tools.parameter.OptionalDictParameter(*args, **kwargs)¶
Bases:
OptionalParameter
,DictParameter
Class to parse optional dict parameters.
Moved to luigi
This feature was moved to the
luigi
package and will be available after the version 3.0.3. It will be deprecated in a future version.- expected_type¶
alias of
FrozenOrderedDict
- class luigi_tools.parameter.OptionalFloatParameter(*args, **kwargs)¶
Bases:
OptionalParameter
,FloatParameter
Class to parse optional float parameters.
Moved to luigi
This feature was moved to the
luigi
package and will be available after the version 3.0.3. It will be deprecated in a future version.
- class luigi_tools.parameter.OptionalIntParameter(*args, **kwargs)¶
Bases:
OptionalParameter
,IntParameter
Class to parse optional int parameters.
Moved to luigi
This feature was moved to the
luigi
package and will be available after the version 3.0.3. It will be deprecated in a future version.
- class luigi_tools.parameter.OptionalListParameter(*args, **kwargs)¶
Bases:
OptionalParameter
,ListParameter
Class to parse optional list parameters.
Moved to luigi
This feature was moved to the
luigi
package and will be available after the version 3.0.3. It will be deprecated in a future version.
- class luigi_tools.parameter.OptionalNumericalParameter(*args, **kwargs)¶
Bases:
OptionalParameter
,NumericalParameter
Class to parse optional numerical parameters.
Moved to luigi
This feature was moved to the
luigi
package and will be available after the version 3.0.3. It will be deprecated in a future version.
- class luigi_tools.parameter.OptionalParameter(*args, **kwargs)¶
Bases:
object
Mixin to make a parameter class optional.
Moved to luigi
This feature was moved to the
luigi
package and will be available after the version 3.0.3. It will be deprecated in a future version.- normalize(x)¶
Normalize the given value if it is not
None
.
- parse(x)¶
Parse the given value if it is not an empty string and not equal to
'null'
.
- serialize(x)¶
Parse the given value if the value is not None else return an empty string.
- exception luigi_tools.parameter.OptionalParameterTypeWarning¶
Bases:
UserWarning
Warning class for OptionalParameter with wrong type.
Moved to luigi
This feature was moved to the
luigi
package and will be available after the version 3.0.3. It will be deprecated in a future version.
- class luigi_tools.parameter.OptionalPathParameter(*args, **kwargs)¶
Bases:
OptionalParameter
,PathParameter
Class to parse optional path parameters.
Moved to luigi
This feature was moved to the
luigi
package and will be available after the version 3.0.3. It will be deprecated in a future version.
- class luigi_tools.parameter.OptionalRatioParameter(*args, **kwargs)¶
Bases:
OptionalParameter
,RatioParameter
Class to parse optional ratio parameters.
Moved to luigi
This feature was moved to the
luigi
package and will be available after the version 3.0.3. It will be deprecated in a future version.
- class luigi_tools.parameter.OptionalStrParameter(*args, **kwargs)¶
Bases:
OptionalParameter
,Parameter
Class to parse optional str parameters.
Moved to luigi
This feature was moved to the
luigi
package and will be available after the version 3.0.3. It will be deprecated in a future version.
- class luigi_tools.parameter.OptionalTupleParameter(*args, **kwargs)¶
Bases:
OptionalParameter
,TupleParameter
Class to parse optional tuple parameters.
Moved to luigi
This feature was moved to the
luigi
package and will be available after the version 3.0.3. It will be deprecated in a future version.
- class luigi_tools.parameter.PathParameter(*args, absolute=False, create=False, exists=False, **kwargs)¶
Bases:
Parameter
Class to parse file path parameters.
- Parameters:
absolute (bool) – the given path is converted to an absolute path.
create (bool) – a folder is automatically created to the given path.
exists (bool) – raise a
ValueError
if the path does not exist.
Moved to luigi
This feature was moved to the
luigi
package and will be available after the version 3.0.3. It will be deprecated in a future version.The moved version dropped the
create
parameter as it was confusing for users that may use it instead of using a target.- normalize(x)¶
Normalize the given value to a
pathlib.Path
object.
- class luigi_tools.parameter.RatioParameter(*args, left_op=<built-in function le>, right_op=<built-in function le>, **kwargs)¶
Bases:
NumericalParameter
Class to parse ratio parameters.
The argument must be a float between 0 and 1. The operators to include or exclude the boundaries can be set with ‘left_op’ and ‘right_op’ parameters. Defaults operators include the boundaries.
- normalize(x)¶
Ensure that the value is contained in the given interval.
The
parse()
method is not called when the parameters are given to the constructor, but the value check is only done there. Thisnormalize()
method ensures that the interval check is made even when for arguments given to the constructor.
- exception luigi_tools.parameter.UnconsumedParameterWarning¶
Bases:
UserWarning
Warning class for parameters that are not consumed by the task.