Skip to content

Handle parameters starting with numbers and convert them to valid names #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
GDYendell opened this issue May 29, 2025 · 1 comment · May be fixed by #72
Open

Handle parameters starting with numbers and convert them to valid names #71

GDYendell opened this issue May 29, 2025 · 1 comment · May be fixed by #72
Assignees

Comments

@GDYendell
Copy link
Contributor

GDYendell commented May 29, 2025

Currently parameters are failing in two ways:

WARNING:root:Removing parameters with invalid names: ['0/status/decoder/name']
WARNING:root:Removing parameters with invalid names: ['1/status/decoder/name']
WARNING:root:Removing parameters with invalid names: ['2/status/decoder/name']
WARNING:root:Removing parameters with invalid names: ['3/status/decoder/name']
Invalid name:
1 validation error for SignalR
name
  String should match pattern '^([A-Z][a-z0-9]*)*$' [type=string_pattern_mismatch, input_value='0StatusTimestamp', input_type=str]
    For further information visit https://errors.pydantic.dev/2.10/v/string_pattern_mismatch
Invalid name:
1 validation error for SignalR
name
  String should match pattern '^([A-Z][a-z0-9]*)*$' [type=string_pattern_mismatch, input_value='0StatusError', input_type=str]
    For further information visit https://errors.pydantic.dev/2.10/v/string_pattern_mismatch
Invalid name:
1 validation error for SignalR
name
  String should match pattern '^([A-Z][a-z0-9]*)*$' [type=string_pattern_mismatch, input_value='0StatusConnected', input_type=str]
    For further information visit https://errors.pydantic.dev/2.10/v/string_pattern_mismatch

The simplest fix would be to intercept these values during introspection and add a string to the front to make it valid, or move the number to the end. Also these parameters should have Status and Config removed from them to shorten the PVs.

Note the same applies to group names:

2025-05-29T16:03:23.504146465 WARN pvxs.ioc.group.processor
     Group GARYI04:FR:FR0:DECODER:PVI defines no +trigger mappings.  Default to individual/split monitor updates.
2025-05-29T16:03:23.505063821 WARN pvxs.ioc.group.processor
     Group GARYI04:FR:FR1:DECODER:PVI defines no +trigger mappings.  Default to individual/split monitor updates.
2025-05-29T16:03:23.505121630 WARN pvxs.ioc.group.processor
     Group GARYI04:FR:FR2:DECODER:PVI defines no +trigger mappings.  Default to individual/split monitor updates.
2025-05-29T16:03:23.505153269 WARN pvxs.ioc.group.processor
     Group GARYI04:FR:FR3:DECODER:PVI defines no +trigger mappings.  Default to individual/split monitor updates.
GARYI04:EF:PVI: Error Group not created: invalid field name "0_config_acqid"
GARYI04:MW:PVI: Error Group not created: invalid field name "0_config_ctrl_port"

These could potentially be handled in the same logic.

Acceptance Criteria

  • These parameters are handled correctly
  • Unit tests added to show these parameters are handled
@GDYendell
Copy link
Contributor Author

It would also be good to understand why these parameters are failing and others aren't because it is only a few of them and I would have though all FP/FR parameters might have the same problem

@shihab-dls shihab-dls self-assigned this Jun 6, 2025
@shihab-dls shihab-dls transferred this issue from DiamondLightSource/FastCS Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants