ophyd_async.core.get_unique#

ophyd_async.core.get_unique(values: Dict[str, T], types: str) T[source]#

If all values are the same, return that value, otherwise return TypeError

>>> get_unique({"a": 1, "b": 1}, "integers")
1
>>> get_unique({"a": 1, "b": 2}, "integers")
Traceback (most recent call last):
 ...
TypeError: Differing integers: a has 1, b has 2