Parameter
AbstractParameter
Bases: abc.ABC
Source code in taskchain/parameter.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
__init__(default=NO_DEFAULT, ignore_persistence=False, dont_persist_default_value=True)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
default |
Any
|
value used if not provided in config, default to NO_DEFAULT meaning that param is required |
NO_DEFAULT
|
ignore_persistence |
bool
|
do not use this parameter in persistence, useful params without influence on output |
False
|
dont_persist_default_value |
bool
|
if value of parameter is same as default, do not use it in persistence, useful for adding new parameters without recomputation of data |
True
|
Source code in taskchain/parameter.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
Parameter
Bases: AbstractParameter
Source code in taskchain/parameter.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
|
__init__(name, dtype=None, default=NO_DEFAULT, name_in_config=None, ignore_persistence=False, dont_persist_default_value=False)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
name for referencing from task |
required |
dtype |
Union[type]
|
expected datatype |
None
|
default |
Any
|
value used if not provided in config, default to NO_DEFAULT meaning that param is required |
NO_DEFAULT
|
name_in_config |
str
|
name used for search in config, defaults to |
None
|
ignore_persistence |
bool
|
do not use this parameter in persistence, useful params without influence on output |
False
|
dont_persist_default_value |
bool
|
if value of parameter is same as default, do not use it in persistence, useful for adding new parameters without recomputation of data |
False
|
Source code in taskchain/parameter.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|
ParameterObject
Bases: abc.ABC
Every class used in configs has to be inherit from this class.
Source code in taskchain/parameter.py
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
|
repr()
abstractmethod
Representation which should uniquely describe object, i.e. be based on all arguments of init.
Source code in taskchain/parameter.py
222 223 224 225 226 227 228 |
|
AutoParameterObject
Bases: ParameterObject
ParameterObject with automatic repr
method based on arguments of init method.
For correct functionality, is necessary store all init argument values as self.arg_name or self._arg_name
Source code in taskchain/parameter.py
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 |
|
ignore_persistence_args()
staticmethod
List of init argument names which are ignored in persistence.
Source code in taskchain/parameter.py
292 293 294 295 |
|
dont_persist_default_value_args()
staticmethod
List of init argument names which are ignored in persistence when they take default value.
Source code in taskchain/parameter.py
297 298 299 300 301 302 303 |
|