-
Notifications
You must be signed in to change notification settings - Fork 6
Panda conversion improvements #72
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
Conversation
Also added options for formatting the pv names.
Use a method instead.
26042a2 to
3cd53f9
Compare
3cd53f9 to
f2554b1
Compare
|
Scan tasks are not ending correctly in the tests on main: ========================================================== 30 passed in 2.93s =========================================================== EditThis has been handled in the below commit. |
Also made it so that scan tasks are explicitly torn down when the backend is deleted.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #72 +/- ##
==========================================
- Coverage 82.75% 81.65% -1.11%
==========================================
Files 23 23
Lines 928 1074 +146
==========================================
+ Hits 768 877 +109
- Misses 160 197 +37 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
For example, updating an attribute to have an `Int` with different units will make the epics backend update `EGU` of the corresponding record.
|
Looks like this will fix #55 |
|
This is quite a lot. It would be good to split this into smaller PRs. I think some of it can be merged now and then we can continue developing and discussing the rest. It will also help resolve conflicts with the various PRs @marcelldls is working on in smaller chunks. |
I agree, I had a philosophy of putting all the changes together since I've amended them so much. Let me know which features you want now and I can cherry pick them into their own issues/PRs |
|
Closing as these have all been separated out into separate PRs. (We'll keep panda-conversion-branch for now). |
Changes
Attributes
Mapping
Controllers can now define
which is another way to provide attributes without
setattron the controller. The keys are checked to be distinct from the attributes found from the attributes of the controller.The user can also pass in
search_device_for_attributes=Falseon the controller which will prevent the mapping automatically searching forAttributes, it will only useadditional_attributes.Description
Added a field called
descriptiontoAttribute, which is used asDESCon theEPICSrecord.Initial value
Added an option for
initial_valueonSignalR/SignalRW. If provided this will be used instead of the default of the_datatype.dtypefor the initial value of the attribute.Changing the datatype
We still want
DataTypeto be frozen, but we also might want to change the value of a field in it - e.gunits, corresponding toEGUin the epics backend.To do this I've made a method called
update_datatypewhich will change the_datatypeof the attribute. This alone wouldn't update the corresponding record, so the backend runsset_update_databack_callback.update_datatypewill then run this so changing the attribute datatype will update the backend.Scan Tasks
Errors
Currently, errors in a scan future will be swallowed. Now an error will be printed.
Killing Scan Tasks
We were getting problems for scan tasks not being torn down after the end of tests. Now the backend will stop the tasks on
__del__, or running the newstop_scan_tasksmethod.DataTypes
Methods
Rather than just using
DataType.dtype()we now have aDataType.initial_valueproperty.We also have a
DataType.castwhich is used to cast inputted values and validated against metadata fields in the datatype.Added metadata to the datatype
Added a bunch of optional fields to
String, Int, Floatwhich are used for relevant fields e.gHOPRin the epics backend.IntandFloatAttributesare validated against theirmaxandminon put.New Datatypes (PENDING)
Waveform
A waveform to correspond to a single pv without any pva structure beyond regular pvi.
Table
A waveform which is indexable using pvi PVs generated from names of the columns of the numpy structured datatype. These will be added in a new PVXS backend.
Epics Backend
Options
Naming conventions are now passed into the ioc through
EpicsIOCOptions, which can be passed into the backend on init.Handlers
Poll Period
update_periodis now optional in fields, designating that theUpdatershouldn't be ran periodically. In panda we get all the changes at once in the top levelupdatescan method. We want to then update all the relevant attributes from there.