epics-containers / pvi

EPICS PV Interface described in YAML
https://epics-containers.github.io/pvi
Apache License 2.0
4 stars 3 forks source link

Unclear error message when ButtonPanel keys for actions are converted to SignalX.name, which needs to be PascalCase #97

Closed GDYendell closed 8 months ago

GDYendell commented 9 months ago
INFO: PVXS QSRV2 is loaded, permitted, and ENABLED.
Traceback (most recent call last):
  File "/scratch/twj43146/Programming/phoebus_testing/.venv/bin/run-ioc", line 8, in <module>
    sys.exit(run_softioc())
             ^^^^^^^^^^^^^
  File "/scratch/twj43146/Programming/phoebus_testing/src/phoebus_testing/__main__.py", line 25, in run_softioc
    Pvi.create_pvi_records(PREFIX)
  File "/scratch/twj43146/Programming/phoebus_testing/src/phoebus_testing/pvi_wrapper.py", line 65, in create_pvi_records
    formatter.format(device, bobfile_path)
  File "/scratch/twj43146/Programming/pvi/src/pvi/_format/dls.py", line 43, in format
    f(device, path)
  File "/scratch/twj43146/Programming/pvi/src/pvi/_format/dls.py", line 342, in format_bob
    screen_formatter, sub_screens = formatter_factory.create_screen_formatter(
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/scratch/twj43146/Programming/pvi/src/pvi/_format/screen.py", line 115, in create_screen_formatter
    self.create_group_formatters(
  File "/scratch/twj43146/Programming/pvi/src/pvi/_format/screen.py", line 241, in create_group_formatters
    group_formatter = self.create_group_formatter(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/scratch/twj43146/Programming/pvi/src/pvi/_format/screen.py", line 318, in create_group_formatter
    self.create_component_widget_formatters(
  File "/scratch/twj43146/Programming/pvi/src/pvi/_format/screen.py", line 374, in create_component_widget_formatters
    widgets = list(
              ^^^^^
  File "/scratch/twj43146/Programming/pvi/src/pvi/_format/screen.py", line 452, in generate_component_formatters
    row_components = [
                     ^
  File "/scratch/twj43146/Programming/pvi/src/pvi/_format/screen.py", line 453, in <listcomp>
    SignalX(name=action, write_pv=c.write_pv, value=value)
  File "/scratch/twj43146/Programming/phoebus_testing/.venv/lib/python3.11/site-packages/pydantic/main.py", line 171, in __init__
    self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for SignalX
name
  String should match pattern '^([A-Z][a-z0-9]*)*$' [type=string_pattern_mismatch, input_value='go', input_type=str]
    For further information visit https://errors.pydantic.dev/2.6/v/string_pattern_mismatch