-
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
Panda conversion improvements #72
base: main
Are you sure you want to change the base?
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% 79.31% -3.45%
==========================================
Files 23 23
Lines 928 1078 +150
==========================================
+ Hits 768 855 +87
- Misses 160 223 +63 ☔ View full report in Codecov by Sentry. |
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 |
Changes
Attributes
Mapping
Controllers can now define
which is another way to provide attributes without
setattr
on 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=False
on the controller which will prevent the mapping automatically searching forAttributes
, it will only useadditional_attributes
.Description
Added a field called
description
toAttribute
, which is used asDESC
on theEPICS
record.Initial value
Added an option for
initial_value
onSignalR
/SignalRW
. If provided this will be used instead of the default of the_datatype.dtype
for the initial value of the attribute.Changing the datatype
We still want
DataType
to be frozen, but we also might want to change the value of a field in it - e.gunits
, corresponding toEGU
in the epics backend.To do this I've made a method called
update_datatype
which will change the_datatype
of the attribute. This alone wouldn't update the corresponding record, so the backend runsset_update_databack_callback
.update_datatype
will 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_tasks
method.DataTypes
Added metadata to the datatype
Added a bunch of optional fields to
String, Int, Float
which are used for relevant fields e.gHOPR
in the epics backend.Int
andFloat
Attributes
are validated against theirmax
andmin
on 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.
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_period
is now optional in fields, designating that theUpdater
shouldn't be ran periodically. In panda we get all the changes at once in the top levelupdate
scan method. We want to then update all the relevant attributes from there.