You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there's no way for a user to know what EPICS record attributes are accessible on a RecordWrapper without just trying to get the attribute - and only a small handful are accessible at the moment. This would also help static type checkers such as mypy to better reason about the values retrieved from the record.
To act as a starting point, here's a list of things I would like to have type hinting for. These are all in active use in my current project.
For RecordWrapper:
add_alias method - just the one string parameter (and documenting it requires the record prefix)
name attribute (I use this one a lot)
set , whose signature varies based on whether the record is In or Out, and based on the type of the record
set_alarm method, only available on In records.
get method, although the type this returns may be very difficult to work out
It may be useful to create InRecordWrapper and OutRecordWrapper types as well - these would help with typing to clearly show the different methods and signatures between the two. This would also serve as a fix to #52 , as all I really needed from that issue was to know whether it was an In or Out record so I knew which signature to use.
Under builder.records:
The bi/stringout etc. methods for creating records could have at least minimal hinting, the record name field, although documenting all possible EPICS keywords would be a chore.
Currently there's no way for a user to know what EPICS record attributes are accessible on a
RecordWrapper
without just trying to get the attribute - and only a small handful are accessible at the moment. This would also help static type checkers such asmypy
to better reason about the values retrieved from the record.A basic introduction to stubs can be found here: https://mypy.readthedocs.io/en/stable/stubs.html
The text was updated successfully, but these errors were encountered: