-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Hi @halx
While running the maize-contrib/docs/reinvent.ipynb example, I encountered a pydantic_core.ValidationError related to the ExternalProcess configuration. This error persists even after modifying the input TOML file, as discussed in REINVENT4 Issue #262.
pydantic_core._pydantic_core.ValidationError: 1 validation error for Parameters
property
Field required [type=missing, input_value=ArgsKwargs((), {'args': [...e': ['./intercept.py']}), input_type=ArgsKwargs]
For further information visit https://errors.pydantic.dev/2.11/v/missing
The Issue: In maize-contrib/maize/steps/mai/misc/reinvent.py, the ReInvent.run() method calls _patch_config(), which dynamically generates the ExternalProcess configuration. In the latest REINVENT4 versions, the property field is now mandatory for external processes.
Since the node packages scores using the key "predictions": scores_data = {"version": 4, "payload": {"predictions": list(scores)}}
The _patch_config function must explicitly define this property.
Suggested Fix: I have fixed this by adding "property": "predictions" to the score_conf dictionary in _patch_config:
score_conf = {
"name": "maize",
"weight": weight,
"params": {
"executable": "./intercept.py",
"args": "",
"property": "predictions", # Add this line
},
"transform": {
"low": low,
"high": high,
"k": k,
"type": "reverse_sigmoid" if reverse else "sigmoid",
},
}
This change resolves the validation error and the workflow now runs successfully. Could you please consider committing this fix?
Best regards,