ophyd-async 0.3.4a1__py3-none-any.whl → 0.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ophyd_async/_version.py +2 -2
- ophyd_async/core/__init__.py +20 -8
- ophyd_async/core/_providers.py +186 -24
- ophyd_async/core/detector.py +14 -15
- ophyd_async/core/device.py +18 -6
- ophyd_async/core/signal.py +32 -8
- ophyd_async/core/soft_signal_backend.py +21 -6
- ophyd_async/epics/_backend/_aioca.py +3 -0
- ophyd_async/epics/_backend/_p4p.py +50 -2
- ophyd_async/epics/_backend/common.py +3 -1
- ophyd_async/epics/areadetector/aravis.py +3 -3
- ophyd_async/epics/areadetector/controllers/aravis_controller.py +1 -0
- ophyd_async/epics/areadetector/drivers/ad_base.py +3 -2
- ophyd_async/epics/areadetector/kinetix.py +3 -3
- ophyd_async/epics/areadetector/pilatus.py +3 -3
- ophyd_async/epics/areadetector/vimba.py +3 -3
- ophyd_async/epics/areadetector/writers/__init__.py +2 -2
- ophyd_async/epics/areadetector/writers/general_hdffile.py +97 -0
- ophyd_async/epics/areadetector/writers/hdf_writer.py +27 -10
- ophyd_async/epics/areadetector/writers/nd_file_hdf.py +3 -0
- ophyd_async/epics/areadetector/writers/nd_plugin.py +30 -0
- ophyd_async/epics/demo/demo_ad_sim_detector.py +3 -3
- ophyd_async/epics/motion/motor.py +132 -2
- ophyd_async/panda/__init__.py +15 -1
- ophyd_async/panda/_common_blocks.py +22 -1
- ophyd_async/panda/_hdf_panda.py +5 -3
- ophyd_async/panda/_table.py +20 -18
- ophyd_async/panda/_trigger.py +62 -7
- ophyd_async/panda/writers/_hdf_writer.py +17 -8
- ophyd_async/plan_stubs/ensure_connected.py +7 -2
- ophyd_async/plan_stubs/fly.py +58 -7
- ophyd_async/sim/pattern_generator.py +71 -182
- ophyd_async/sim/sim_pattern_detector_control.py +3 -3
- ophyd_async/sim/sim_pattern_detector_writer.py +9 -5
- ophyd_async/sim/sim_pattern_generator.py +12 -5
- {ophyd_async-0.3.4a1.dist-info → ophyd_async-0.4.0.dist-info}/METADATA +7 -2
- {ophyd_async-0.3.4a1.dist-info → ophyd_async-0.4.0.dist-info}/RECORD +41 -43
- {ophyd_async-0.3.4a1.dist-info → ophyd_async-0.4.0.dist-info}/WHEEL +1 -1
- ophyd_async/epics/areadetector/writers/_hdfdataset.py +0 -10
- ophyd_async/epics/areadetector/writers/_hdffile.py +0 -54
- ophyd_async/panda/writers/_panda_hdf_file.py +0 -54
- {ophyd_async-0.3.4a1.dist-info → ophyd_async-0.4.0.dist-info}/LICENSE +0 -0
- {ophyd_async-0.3.4a1.dist-info → ophyd_async-0.4.0.dist-info}/entry_points.txt +0 -0
- {ophyd_async-0.3.4a1.dist-info → ophyd_async-0.4.0.dist-info}/top_level.txt +0 -0
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
from pathlib import Path
|
|
2
|
-
from typing import Iterator, List
|
|
3
|
-
|
|
4
|
-
from event_model import StreamDatum, StreamResource, compose_stream_resource
|
|
5
|
-
|
|
6
|
-
from ophyd_async.core import DirectoryInfo
|
|
7
|
-
|
|
8
|
-
from ._hdfdataset import _HDFDataset
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class _HDFFile:
|
|
12
|
-
"""
|
|
13
|
-
:param directory_info: Contains information about how to construct a StreamResource
|
|
14
|
-
:param full_file_name: Absolute path to the file to be written
|
|
15
|
-
:param datasets: Datasets to write into the file
|
|
16
|
-
"""
|
|
17
|
-
|
|
18
|
-
def __init__(
|
|
19
|
-
self,
|
|
20
|
-
directory_info: DirectoryInfo,
|
|
21
|
-
full_file_name: Path,
|
|
22
|
-
datasets: List[_HDFDataset],
|
|
23
|
-
) -> None:
|
|
24
|
-
self._last_emitted = 0
|
|
25
|
-
self._bundles = [
|
|
26
|
-
compose_stream_resource(
|
|
27
|
-
spec="AD_HDF5_SWMR_SLICE",
|
|
28
|
-
root=str(directory_info.root),
|
|
29
|
-
data_key=ds.name,
|
|
30
|
-
resource_path=str(full_file_name.relative_to(directory_info.root)),
|
|
31
|
-
resource_kwargs={
|
|
32
|
-
"path": ds.path,
|
|
33
|
-
"multiplier": ds.multiplier,
|
|
34
|
-
"timestamps": "/entry/instrument/NDAttributes/NDArrayTimeStamp",
|
|
35
|
-
},
|
|
36
|
-
)
|
|
37
|
-
for ds in datasets
|
|
38
|
-
]
|
|
39
|
-
|
|
40
|
-
def stream_resources(self) -> Iterator[StreamResource]:
|
|
41
|
-
for bundle in self._bundles:
|
|
42
|
-
yield bundle.stream_resource_doc
|
|
43
|
-
|
|
44
|
-
def stream_data(self, indices_written: int) -> Iterator[StreamDatum]:
|
|
45
|
-
# Indices are relative to resource
|
|
46
|
-
if indices_written > self._last_emitted:
|
|
47
|
-
indices = {
|
|
48
|
-
"start": self._last_emitted,
|
|
49
|
-
"stop": indices_written,
|
|
50
|
-
}
|
|
51
|
-
self._last_emitted = indices_written
|
|
52
|
-
for bundle in self._bundles:
|
|
53
|
-
yield bundle.compose_stream_datum(indices)
|
|
54
|
-
return None
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
from dataclasses import dataclass
|
|
2
|
-
from pathlib import Path
|
|
3
|
-
from typing import Iterator, List
|
|
4
|
-
|
|
5
|
-
from event_model import StreamDatum, StreamResource, compose_stream_resource
|
|
6
|
-
|
|
7
|
-
from ophyd_async.core import DirectoryInfo
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@dataclass
|
|
11
|
-
class _HDFDataset:
|
|
12
|
-
data_key: str
|
|
13
|
-
internal_path: str
|
|
14
|
-
shape: List[int]
|
|
15
|
-
multiplier: int
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class _HDFFile:
|
|
19
|
-
def __init__(
|
|
20
|
-
self,
|
|
21
|
-
directory_info: DirectoryInfo,
|
|
22
|
-
full_file_name: Path,
|
|
23
|
-
datasets: List[_HDFDataset],
|
|
24
|
-
) -> None:
|
|
25
|
-
self._last_emitted = 0
|
|
26
|
-
self._bundles = [
|
|
27
|
-
compose_stream_resource(
|
|
28
|
-
spec="AD_HDF5_SWMR_SLICE",
|
|
29
|
-
root=str(directory_info.root),
|
|
30
|
-
data_key=ds.data_key,
|
|
31
|
-
resource_path=(f"{str(directory_info.root)}/{full_file_name}"),
|
|
32
|
-
resource_kwargs={
|
|
33
|
-
"path": ds.internal_path,
|
|
34
|
-
"multiplier": ds.multiplier,
|
|
35
|
-
"timestamps": "/entry/instrument/NDAttributes/NDArrayTimeStamp",
|
|
36
|
-
},
|
|
37
|
-
)
|
|
38
|
-
for ds in datasets
|
|
39
|
-
]
|
|
40
|
-
|
|
41
|
-
def stream_resources(self) -> Iterator[StreamResource]:
|
|
42
|
-
for bundle in self._bundles:
|
|
43
|
-
yield bundle.stream_resource_doc
|
|
44
|
-
|
|
45
|
-
def stream_data(self, indices_written: int) -> Iterator[StreamDatum]:
|
|
46
|
-
# Indices are relative to resource
|
|
47
|
-
if indices_written > self._last_emitted:
|
|
48
|
-
indices = {
|
|
49
|
-
"start": self._last_emitted,
|
|
50
|
-
"stop": indices_written,
|
|
51
|
-
}
|
|
52
|
-
self._last_emitted = indices_written
|
|
53
|
-
for bundle in self._bundles:
|
|
54
|
-
yield bundle.compose_stream_datum(indices)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|