DiamondLightSource / DiamondLightSource/dodal
How do we deal with devices that need configuration to initialise
- Dominant language
- Python
- Stars
- 5
- Forks
- 13
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 10
Description
Currently the `ApertureScatterguard` and the `Eiger` devices need to be passed a set of parameters to be valid devices. This is done by doing something like the following:
```python
def eiger(params: Optional[Parameters] = None):
eiger = EigerDetector(...)
if params is not None:
eiger.set_params(params)
return eiger
```
This causes issues as it's easy to make an invalid Eiger that has no parameters. Instead it would be nicer to do one of the following:
1. Require parameters to be set when instantiating the device - this then make it very hard to easily create all devices on the beamline
2. Have some method of getting a good default set of parameters - this opens up cans of worms around proper storage of configurations. e.g. do we have a configuration service that dodal will interrogate when trying to initialise a device?
Contributor guide
Assessment
This issue has not been assessed yet.