-
Notifications
You must be signed in to change notification settings - Fork 3
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
Update to use apischema #3
Conversation
Dictionary to be written to yaml file is validated by the schema before being written to file.
- .dict() must include type - Correctly show the Enum value
- "convert" argument added to cli - Main conversion functionality in _convert intended eventually to cover both asyn and stream - _asyn_convert to eventually be asyn specific conversion. The three parameter classes should be generalised. - _parameters defines some base classes for Parameters
- Top level template contains anything that is not currently auto-generated in the template from the pvi.yaml. - This includes any commented lines and any records that are not asyn records. - Perhaps comments directly above a record should be included in the component description in the absence of a DESC field in the record.
- Asyn parameters don't have to be macros so generalise regex - Fill in addr and timeout with default values if missing
- Assuming for now that all prefixes are made up of macros only, and that any macros at the start of a record name are to be considered part of the intended prefix - e.g. If we have two record names: $(P)$(R)$(S)FileName and $(P)$(R)Temperature, $(S) is considered part of the prefix and the error is raised because $(S) is not also present in the Temperature prefix
This reverts commit d93328e.
- Actions use the write record name as $(name) and therefore do not use write_record_suffix - Readbacks check for _RBV at the end of the record name. If present $(name) is the record name stripped of _RBV and there is no read_record_suffix. If the record name does not end with _RBV, $(name) is the record name and read_record_suffix is set equal to $(name) to avoid appending _RBV - SettingPairs use the write record name as $(name). If the read record name is the write record name + _RBV there is no read_record_suffix. Otherwise, read_record_suffix is the read record name
- Keep commented records in the top level - Don't keep commented fields in the top level
- Remove ScanRate enum - Treat SCAN like any other record field - Do not write SCAN field for OUT record (same behaviour as before, achieved differently see _asyn.py diff) - Also add additional record fields common to all record types
- ParamSet now named {yaml_file.stem}ParamSet - yaml_file.stem is taken from the original template.stem
Template conversion See merge request controls/python3/pvi!5
# Conflicts: # tests/test_products.py
Adl screen See merge request controls/python3/pvi!6
Python3.9 failing at the moment, issue wyfo/apischema#279 reported |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have just commented on everything, I but am aware some of it is not things you have changed recently.
subclasses = [] | ||
for sub_cls in cls.__subclasses__(): | ||
subclasses += [sub_cls] + rec_subclasses(sub_cls) | ||
return subclasses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we have some notes about what this is for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rec_subclasses() or the whole of this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just rec_subclasses()
No description provided.