ewoksdata 0.4.1__tar.gz → 0.4.2__tar.gz
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.
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/PKG-INFO +1 -1
- ewoksdata-0.4.2/src/ewoksdata/__init__.py +1 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata/data/blissdata/blissdatav1.py +26 -19
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata/data/blissdata/blissdatavid31.py +25 -17
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata.egg-info/PKG-INFO +1 -1
- ewoksdata-0.4.1/src/ewoksdata/__init__.py +0 -1
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/LICENSE.md +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/README.md +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/pyproject.toml +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/setup.cfg +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/setup.py +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata/data/__init__.py +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata/data/bliss.py +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata/data/blissdata/__init__.py +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata/data/blissdata/blissdatav0.py +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata/data/blissdata/exceptions.py +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata/data/hdf5/__init__.py +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata/data/hdf5/config.py +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata/data/hdf5/dataset_writer.py +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata/data/hdf5/types.py +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata/data/nexus.py +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata/data/url.py +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata/data/utils.py +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata/tests/__init__.py +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata/tests/conftest.py +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata/tests/data/__init__.py +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata/tests/data/bliss_scans.py +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata/tests/test_data_bliss.py +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata/tests/test_data_hdf5.py +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata/tests/test_data_nexus.py +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata/tests/test_dataset_writer.py +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata.egg-info/SOURCES.txt +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata.egg-info/dependency_links.txt +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata.egg-info/requires.txt +0 -0
- {ewoksdata-0.4.1 → ewoksdata-0.4.2}/src/ewoksdata.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.4.2"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from numbers import Number
|
|
2
|
+
from collections import Counter
|
|
2
3
|
from typing import List, Optional
|
|
3
4
|
|
|
4
5
|
from numpy.typing import ArrayLike
|
|
@@ -44,32 +45,38 @@ def iter_bliss_scan_data_from_memory(
|
|
|
44
45
|
counter_streams[name] = stream
|
|
45
46
|
|
|
46
47
|
client = StreamingClient({**lima_streams, **counter_streams})
|
|
48
|
+
lima_buffer_count = Counter()
|
|
47
49
|
|
|
48
50
|
while True:
|
|
49
51
|
try:
|
|
50
52
|
output = client.read()
|
|
51
53
|
except EndOfStream:
|
|
52
54
|
break
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
55
|
+
for stream, (_, payload) in output.items():
|
|
56
|
+
name_parts = stream.name.split(":")
|
|
57
|
+
if stream.name in lima_streams:
|
|
58
|
+
# payload is a sequence of JSON statuses
|
|
59
|
+
ctr_name = name_parts[-2]
|
|
60
|
+
last_status = payload[-1]
|
|
61
|
+
lima_client = lima_clients[stream.name]
|
|
62
|
+
lima_client.update(**last_status)
|
|
63
|
+
n_already_read = lima_buffer_count[ctr_name]
|
|
64
|
+
try:
|
|
65
|
+
data = lima_client[n_already_read:]
|
|
66
|
+
except IndexNoMoreThereError:
|
|
67
|
+
continue
|
|
68
|
+
buffers[ctr_name].extend(data)
|
|
69
|
+
lima_buffer_count[ctr_name] += len(data)
|
|
70
|
+
else:
|
|
71
|
+
# payload is a sequence of data points (0D, 1D, 2D)
|
|
72
|
+
ctr_name = name_parts[-1]
|
|
73
|
+
buffers[ctr_name].extend(payload)
|
|
67
74
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
75
|
+
nyield = min(len(v) for v in buffers.values())
|
|
76
|
+
if nyield:
|
|
77
|
+
for i in range(nyield):
|
|
78
|
+
yield {name: values[i] for name, values in buffers.items()}
|
|
79
|
+
buffers = {name: values[nyield:] for name, values in buffers.items()}
|
|
73
80
|
|
|
74
81
|
|
|
75
82
|
def last_lima_image(channel_info: dict) -> ArrayLike:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from numbers import Number
|
|
2
|
+
from collections import Counter
|
|
2
3
|
from typing import List, Optional
|
|
3
4
|
|
|
4
5
|
from numpy.typing import ArrayLike
|
|
@@ -35,39 +36,46 @@ def iter_bliss_scan_data_from_memory(
|
|
|
35
36
|
|
|
36
37
|
lima_streams = dict()
|
|
37
38
|
lima_clients = dict()
|
|
39
|
+
lima_buffer_count = dict()
|
|
38
40
|
counter_streams = dict()
|
|
39
41
|
for name, stream in scan.streams.items():
|
|
40
42
|
if stream.encoding["type"] == "json" and "lima" in stream.info["format"]:
|
|
41
43
|
if name.split(":")[-2] in lima_names:
|
|
42
44
|
lima_streams[name] = stream
|
|
43
45
|
lima_clients[name] = lima_client_factory(stream.info)
|
|
46
|
+
lima_buffer_count[name] = 0
|
|
44
47
|
elif name.split(":")[-1] in counter_names:
|
|
45
48
|
counter_streams[name] = stream
|
|
46
49
|
|
|
47
50
|
client = StreamingClient({**lima_streams, **counter_streams})
|
|
51
|
+
lima_buffer_count = Counter()
|
|
48
52
|
|
|
49
53
|
while True:
|
|
50
54
|
try:
|
|
51
55
|
output = client.read()
|
|
52
56
|
except EndOfStream:
|
|
53
57
|
break
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
58
|
+
for stream, (_, payload) in output.items():
|
|
59
|
+
name_parts = stream.name.split(":")
|
|
60
|
+
if stream.name in lima_streams:
|
|
61
|
+
# payload is a sequence of JSON statuses
|
|
62
|
+
ctr_name = name_parts[-2]
|
|
63
|
+
lima_client = lima_clients[stream.name]
|
|
64
|
+
lima_client.update(**payload[-1])
|
|
65
|
+
n_already_read = lima_buffer_count[ctr_name]
|
|
66
|
+
data = lima_client[n_already_read:]
|
|
67
|
+
buffers[ctr_name].extend(data)
|
|
68
|
+
lima_buffer_count[ctr_name] += len(data)
|
|
69
|
+
else:
|
|
70
|
+
# payload is a sequence of data points (0D, 1D, 2D)
|
|
71
|
+
ctr_name = name_parts[-1]
|
|
72
|
+
buffers[ctr_name].extend(payload)
|
|
73
|
+
|
|
74
|
+
nyield = min(len(v) for v in buffers.values())
|
|
75
|
+
if nyield:
|
|
76
|
+
for i in range(nyield):
|
|
77
|
+
yield {name: values[i] for name, values in buffers.items()}
|
|
78
|
+
buffers = {name: values[nyield:] for name, values in buffers.items()}
|
|
71
79
|
|
|
72
80
|
|
|
73
81
|
def last_lima_image(channel_info: dict) -> ArrayLike:
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.4.1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|