Closed GDYendell closed 8 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 89.65%. Comparing base (
50cb1be
) to head (62609fe
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I wouldn't say that re-constructing the validation error was super tidy. So I have a slight preference for catch - print - re-raise.
Yeah I think this is just as good and less code:
+ ibek runtime generate /epics/ioc/config/ioc.yaml /epics/ibek-defs/ADCore.ibek.support.yaml /epics/ibek-defs/ADSimDetector.ibek.support.yaml /epics/ibek-defs/asyn.ibek.support.yaml /epics/ibek-defs/autosave.ibek.support.yaml /epics/ibek-defs/epics.ibek.support.yaml /epics/ibek-defs/iocStats.ibek.support.yaml
Failed to validate `/epics/pvi-defs/asynNDArrayDriver.pvi.device.yaml` as Device:
Traceback (most recent call last):
File "/venv/bin/ibek", line 8, in <module>
sys.exit(cli())
File "/venv/lib/python3.10/site-packages/ibek/runtime_cmds/commands.py", line 47, in generate
pvi_index_entries, pvi_databases = generate_pvi(ioc_instance)
File "/venv/lib/python3.10/site-packages/ibek/runtime_cmds/commands.py", line 91, in generate_pvi
device.deserialize_parents([GLOBALS.PVI_DEFS])
File "/workspaces/pvi/src/pvi/device.py", line 483, in deserialize_parents
parent_parameters = find_components(self.parent, yaml_paths)
File "/workspaces/pvi/src/pvi/device.py", line 526, in find_components
list(find_components(device.parent, yaml_paths))
File "/workspaces/pvi/src/pvi/device.py", line 523, in find_components
device = Device.deserialize(device_yaml)
File "/workspaces/pvi/src/pvi/device.py", line 468, in deserialize
return cls(**serialized)
File "/venv/lib/python3.10/site-packages/pydantic/main.py", line 171, in __init__
self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 2 validation errors for Device
children.0.Group.children.3.SignalR.read_pv
Field required [type=missing, input_value={'name': 'SerialNumber', ...RBV', 'read_widget': {}}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.6/v/missing
children.0.Group.children.3.SignalR.red_pv
Extra inputs are not permitted [type=extra_forbidden, input_value='$(P)$(R)SerialNumber_RBV', input_type=str]
For further information visit https://errors.pydantic.dev/2.6/v/extra_forbidden
This prints the file path with pydantic
ValidationError
s raised when trying to create aDevice
instance from a dictionary loaded from a YAML file.Fixes #99