Skip to content

Conversation

@kurup
Copy link
Contributor

@kurup kurup commented Oct 15, 2025

Some small modifications to pvrecipe and the config reader to use custom YAML configs for non-standard rules. I've also included a small change to server.put_pv_value so that puts can be done using the post method of the SharedPV if the PV exists on the server (if not a Context put is called). This allows setting a read-only PV, e.g. when updating the value from hardware.

@kurup kurup requested review from Monarda and aqshafei October 15, 2025 11:24
@kurup kurup self-assigned this Oct 15, 2025

# Process configuration in the yaml specific to a supported rule
# and add this to pvrecipe.rule_configs
rule_configs = [("calc", dict), ("cps_write", dict)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There shouldn't be references to rules which don't exist in p4pillon in the p4pillon code! This indicates that there needs to be an alternate way to handle this, which isn't a growing list of special cases.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may wish to consider entrypoints as a potential generic solution? (https://packaging.python.org/en/latest/specifications/entry-points/) I've not used them myself, so they may not be suitable. @MatInGit has used them and has this example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I agree! I think this can be done in a similar way to how registered_handlers are defined in SharedNT (as a class member) so that external rules can be added to rule_configs.

@kurup kurup merged commit c107fd3 into main Nov 27, 2025
16 checks passed
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 this pull request may close these issues.

Update pvrecipe to allow initialisation of custom rules using the yaml config parser

4 participants