DiamondLightSource / DiamondLightSource/dodal

How do we deal with devices that need configuration to initialise

Open
#54 1 comment 0 reactions 0 assignees View on GitHub
enhancement python question
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.