The use case is to write functions that work on old-style databroker.Header and new-style databroker.BlueskyRun:
In [3]: def f(header):
...: "Accept databroker-style or tiled-style Header/BlueskyRun."
...: run = header.v2 # works if header is already a tiled BlueskyRun or if it is a databroker Header
...: return run['primary']['data']['fccd_image']
...:
In [4]: from tiled.client import from_profile
In [5]: c = from_profile("csx")
OBJECT CACHE: Will use up to 20_214_985_728 bytes (15% of total physical RAM)
In [6]: run = c.values().last()
In [7]: f(run)
Out[7]: <ArrayClient shape=(5, 1, 1000, 960) chunks=((5,), (1,), (1000,), (960,)) dtype=int16 dims=('time', 'dim_0', 'dim_1', 'dim_2')>
In [8]: from databroker import Broker
In [9]: db = Broker.named("csx")
OBJECT CACHE: Will use up to 20_214_985_728 bytes (15% of total physical RAM)
In [10]: f(db[-1])
Out[10]: <ArrayClient shape=(5, 1, 1000, 960) chunks=((5,), (1,), (1000,), (960,)) dtype=int16 dims=('time', 'dim_0', 'dim_1', 'dim_2')>
The use case is to write functions that work on old-style
databroker.Header
and new-styledatabroker.BlueskyRun
: