nip.parameters.base_run.BaseRunPreserve

nip.parameters.base_run.BaseRunPreserve#

class nip.parameters.base_run.BaseRunPreserve(*base_run_types: Literal['none', 'parameters', 'rerun_tests'])[source]#

Type annotation to preserve a parameter when initializing from a base run.

Any parameter with this type annotation will be preserved when initializing from a base run of the given type.

Example

>>> from typing import Annotated
>>> @register_parameter_class
>>> @dataclass
>>> class TestParameters(SubParameters):
>>>     preserved_param: Annotated[int, BaseRunPreserve("rerun_tests")]
Parameters:

*base_run_types (BaseRunType) – The base run types to preserve the parameter for.

Methods Summary

__init__(*base_run_types)

Methods

__init__(*base_run_types: Literal['none', 'parameters', 'rerun_tests'])[source]#