Skip to content
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

Merged
merged 97 commits into from
Dec 22, 2021
Merged

Update to use apischema #3

merged 97 commits into from
Dec 22, 2021

Conversation

thomascobb
Copy link
Contributor

No description provided.

EmmaCD and others added 30 commits June 3, 2020 15:10
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
- 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
@thomascobb
Copy link
Contributor Author

thomascobb commented Dec 17, 2021

Python3.9 failing at the moment, issue wyfo/apischema#279 reported

@thomascobb thomascobb marked this pull request as ready for review December 17, 2021 16:54
@thomascobb thomascobb requested a review from GDYendell December 17, 2021 17:05
Copy link
Member

@GDYendell GDYendell left a 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
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Member

Choose a reason for hiding this comment

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

Just rec_subclasses()

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.

6 participants