@@ -53,26 +53,27 @@ class Options(DefaultOptions):
metainfo_additional_tags:Optional[list]=[]
_input_config:Any=PrivateAttr()
@root_validator(pre=False,skip_on_failure=True)
def_stream_default(cls,values):
@model_validator(mode="before")
@classmethod
def_stream_default(cls,data):
"""
This is a validator that sets the default "stream" value based on "input_process"
Args:
values (dict): User-specified attributes of the Options object.
data (dict): User-specified attributes of the Options object.
Returns:
dict: Modified attributes of the Options object.
"""
input_process=values.get("input_process")
input_stream=values.get("input_stream")
input_process=data.get("input_process")
input_stream=data.get("input_stream")
ifnotinput_stream.islower():
logging.getLogger(__name__).warning(
f"input_stream is set to '{input_stream}', input_stream should be lower case. It will be made lower case for you in the next step. If you think this is wrong contact DaVinci maintainers."
)
values["input_stream"]=input_stream.lower()
ifinput_stream:
ifnotinput_stream.islower():
logging.getLogger(__name__).warning(
f"input_stream is set to '{input_stream}', input_stream should be lower case. It will be made lower case for you in the next step. If you think this is wrong contact DaVinci maintainers."
)
data["input_stream"]=input_stream.lower()
if (
input_process
...
...
@@ -86,81 +87,62 @@ class Options(DefaultOptions):
logging.getLogger(__name__).warning(
f"input_stream is set to '{input_stream}', but will be reset to '' because current input_process = {input_process}"
)
values["input_stream"]=""
data["input_stream"]=""
returnvalues
returndata
@root_validator(pre=False,skip_on_failure=True)
defvalidate_input_output(cls,values):
@model_validator(mode="after")
defvalidate_input_output(self):
"""
Validator for the consistency of the input process
and input/output file formats for Sprucing jobs.
Args:
values (dict): User-specified attributes of the Options object.