Comments (4)
My plan was to remove the enum but leave in the code that checks that we've chosen LCLS1 or LCLS2, which is effectively all that enum is doing. My use-case would be resolved with simply adding a default case, so I'll leave the enum in and do that.
I had not considered happi for this but that might work. The context for what I'm working on is this issue: pcdshub/opcpa-tpr-config#21
This application was originally intended to control only Tpr channels, but now the requirements are getting more complicated and necessitate interacting with other devices/PVs.
I was thinking about a config file structure like this, where I could instantiate effectively any class and then use the configuration data in the file to set it up as required:
devices:
ch0:
desc: "what this is"
base: "my:base:pv"
class: "pcdsdevices.tpr.TprTrigger"
kwargs:
channel: 0
timing_mode: LCLS2
name: "name"
ch1:
....
But thinking more, this kind is effectively what happi does. D'oh.
These are not traditional "beamline" devices, so I hadn't considered using happi. But I kind of like having a separate db.json file. I'll try this out.
from pcdsdevices.
I'm happi to help you get that set up, if you run into a wall at any point
from pcdsdevices.
Nice. :)
I'm happi to help you get that set up
from pcdsdevices.
A string parameter is easier pass around but the enum is meant to restrict us fully to a known subset of options. I think I agree that LCLS2 could be the default, but I think it's worth keeping the enum (or if we do pass in a string, check that the enum has that value)
Your context seems like a job for happi
. Is there something stopping you from loading these devices from happi? Or making your own happi db.json and loading from that?
from pcdsdevices.
Related Issues (20)
- Revisit GMD kinds/docs/RO
- LCLS-II Laser Locker "lxt" class
- QADC Duplication HOT 1
- DOC: Out of date readme
- Add Encoded SmarAct Tip-Tilt Class
- EPICS Motor Record MSTA Field HOT 1
- TPR Trigger Configure Attributes
- ENH: SmarAct_improvements
- Confusing class constants docs
- Typo in GammaController
- Base Velocity and Velocity Max missing from EpicsMotor base class in pcdsdevices.epics_motor HOT 2
- TprTrigger Class Not Connecting HOT 2
- BUG: Entrypoints changed from dict to special object in py3.12 HOT 2
- TprTrigger width is not a configuration_attr
- SmarActEncodedTipTilt.tilt attr refers to wrong PV
- BUG: preset formatting should be more error tolerant
- Create SmarActPicoscale subclass for OL-MDL positioners
- Deprecate ST3K4AutoError
- Test suite failures with numpy 2.0 HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pcdsdevices.