ophyd-async 0.10.0a1__py3-none-any.whl → 0.10.0a2__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 +1 -1
- ophyd_async/core/_derived_signal.py +1 -1
- ophyd_async/core/_table.py +4 -3
- ophyd_async/testing/_assert.py +21 -15
- ophyd_async/testing/_single_derived.py +2 -0
- {ophyd_async-0.10.0a1.dist-info → ophyd_async-0.10.0a2.dist-info}/METADATA +1 -1
- {ophyd_async-0.10.0a1.dist-info → ophyd_async-0.10.0a2.dist-info}/RECORD +10 -10
- {ophyd_async-0.10.0a1.dist-info → ophyd_async-0.10.0a2.dist-info}/WHEEL +1 -1
- {ophyd_async-0.10.0a1.dist-info → ophyd_async-0.10.0a2.dist-info}/licenses/LICENSE +0 -0
- {ophyd_async-0.10.0a1.dist-info → ophyd_async-0.10.0a2.dist-info}/top_level.txt +0 -0
ophyd_async/_version.py
CHANGED
|
@@ -173,7 +173,7 @@ def _make_factory(
|
|
|
173
173
|
|
|
174
174
|
# Update the signature for raw_to_derived to match what we are passed as this
|
|
175
175
|
# will be checked in DerivedSignalFactory
|
|
176
|
-
DerivedTransform.raw_to_derived.__annotations__ = raw_to_derived
|
|
176
|
+
DerivedTransform.raw_to_derived.__annotations__ = get_type_hints(raw_to_derived)
|
|
177
177
|
|
|
178
178
|
return DerivedSignalFactory(
|
|
179
179
|
DerivedTransform, set_derived=set_derived, **(raw_devices or {})
|
ophyd_async/core/_table.py
CHANGED
|
@@ -93,18 +93,19 @@ class Table(BaseModel):
|
|
|
93
93
|
|
|
94
94
|
def __add__(self, right: TableSubclass) -> TableSubclass:
|
|
95
95
|
"""Concatenate the arrays in field values."""
|
|
96
|
-
|
|
96
|
+
cls = type(right)
|
|
97
|
+
if type(self) is not cls:
|
|
97
98
|
raise RuntimeError(
|
|
98
99
|
f"{right} is not a `Table`, or is not the same "
|
|
99
100
|
f"type of `Table` as {self}."
|
|
100
101
|
)
|
|
101
102
|
|
|
102
|
-
return
|
|
103
|
+
return cls(
|
|
103
104
|
**{
|
|
104
105
|
field_name: _concat(
|
|
105
106
|
getattr(self, field_name), getattr(right, field_name)
|
|
106
107
|
)
|
|
107
|
-
for field_name in
|
|
108
|
+
for field_name in cls.model_fields
|
|
108
109
|
}
|
|
109
110
|
)
|
|
110
111
|
|
ophyd_async/testing/_assert.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
+
from collections.abc import Mapping
|
|
2
3
|
from contextlib import AbstractContextManager
|
|
3
|
-
from typing import Any
|
|
4
|
+
from typing import Any, cast
|
|
4
5
|
from unittest.mock import Mock, call
|
|
5
6
|
|
|
6
7
|
import pytest
|
|
@@ -43,7 +44,7 @@ async def assert_value(signal: SignalR[SignalDatatypeT], value: Any) -> None:
|
|
|
43
44
|
|
|
44
45
|
async def assert_reading(
|
|
45
46
|
readable: AsyncReadable,
|
|
46
|
-
expected_reading:
|
|
47
|
+
expected_reading: Mapping[str, Mapping[str, Any]],
|
|
47
48
|
) -> None:
|
|
48
49
|
"""Assert that a readable Device has the given reading.
|
|
49
50
|
|
|
@@ -54,20 +55,25 @@ async def assert_reading(
|
|
|
54
55
|
_assert_readings_approx_equal(expected_reading, actual_reading)
|
|
55
56
|
|
|
56
57
|
|
|
57
|
-
def
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
58
|
+
def _approx_reading(expected: Mapping[str, Any], actual: Reading) -> Reading:
|
|
59
|
+
ret = dict(
|
|
60
|
+
expected,
|
|
61
|
+
value=approx_value(expected["value"]),
|
|
62
|
+
timestamp=pytest.approx(expected["timestamp"], rel=0.1)
|
|
63
|
+
if "timestamp" in expected
|
|
64
|
+
else actual["timestamp"],
|
|
65
|
+
)
|
|
66
|
+
if "alarm_severity" in actual and "alarm_severity" not in expected:
|
|
67
|
+
ret["alarm_severity"] = actual["alarm_severity"]
|
|
68
|
+
return cast(Reading, ret)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def _assert_readings_approx_equal(
|
|
72
|
+
expected: Mapping[str, Mapping[str, Any]], actual: Mapping[str, Reading]
|
|
73
|
+
):
|
|
74
|
+
assert actual == {
|
|
75
|
+
k: _approx_reading(v, actual[k]) for k, v in expected.items() if k in actual
|
|
69
76
|
}
|
|
70
|
-
assert actual == approx_expected_reading
|
|
71
77
|
|
|
72
78
|
|
|
73
79
|
async def assert_configuration(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ophyd-async
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.0a2
|
|
4
4
|
Summary: Asynchronous Bluesky hardware abstraction code, compatible with control systems like EPICS and Tango
|
|
5
5
|
Author-email: Tom Cobb <tom.cobb@diamond.ac.uk>
|
|
6
6
|
License: BSD 3-Clause License
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
ophyd_async/__init__.py,sha256=dcAA3qsj1nNIMe5l-v2tlduZ_ypwBmyuHe45Lsq4k4w,206
|
|
2
2
|
ophyd_async/__main__.py,sha256=n_U4O9bgm97OuboUB_9eK7eFiwy8BZSgXJ0OzbE0DqU,481
|
|
3
3
|
ophyd_async/_docs_parser.py,sha256=gPYrigfSbYCF7QoSf2UvE-cpQu4snSssl7ZWN-kKDzI,352
|
|
4
|
-
ophyd_async/_version.py,sha256=
|
|
4
|
+
ophyd_async/_version.py,sha256=vwU_BgU9ApXpWH564vijXNOtjK-ww1iSaNC4uWmoIT4,515
|
|
5
5
|
ophyd_async/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
ophyd_async/core/__init__.py,sha256=eFRVN5WJQKNcZbFtP8abDcra6d_mwFLA0A60AbXL2Vw,4484
|
|
7
|
-
ophyd_async/core/_derived_signal.py,sha256=
|
|
7
|
+
ophyd_async/core/_derived_signal.py,sha256=DS2-t_N8WOGjZjzt-0xRHaWIr3VzKFyV-WiRKRxf7ks,10404
|
|
8
8
|
ophyd_async/core/_derived_signal_backend.py,sha256=5_J9AfRPueJZ-CEgpE7GSG9B1nHUFzanD0N2D1mrGrY,12216
|
|
9
9
|
ophyd_async/core/_detector.py,sha256=J5Chu4sI9WgupB_3qh1c7ZOtlv9tSMJ3tXkHnsc9WIw,14517
|
|
10
10
|
ophyd_async/core/_device.py,sha256=UjpKuGvwCYN0-I0qpdWzBI9uLSLieHryDsLf_9Qeu-Y,14593
|
|
@@ -21,7 +21,7 @@ ophyd_async/core/_signal.py,sha256=kqIvQXRP3n34-uhgTmbwm2fTIz_phJYyTT4Rm7P-gSs,2
|
|
|
21
21
|
ophyd_async/core/_signal_backend.py,sha256=T8vJi-QuMfjB_uBB6iu_aApAY0j5pAFkDn5g2oSCbmI,6826
|
|
22
22
|
ophyd_async/core/_soft_signal_backend.py,sha256=zrE7H2ojHY6oQBucLkFgukszrkdvbIZuavLjEUqc_xM,6227
|
|
23
23
|
ophyd_async/core/_status.py,sha256=h4TtWFM7wFtpxxyAYYSITgcVzArYZdYBHbya6qIX5t0,6553
|
|
24
|
-
ophyd_async/core/_table.py,sha256=
|
|
24
|
+
ophyd_async/core/_table.py,sha256=l5GzL3La68ZkXpcOOVntnYr8ofFV8kWGr1hzY1ek83w,6897
|
|
25
25
|
ophyd_async/core/_utils.py,sha256=zEA3lLeOP0N17XGUH8irxvEW8hq0slkxY4gJV3f4YzE,11382
|
|
26
26
|
ophyd_async/core/_yaml_settings.py,sha256=txy4_Igbsr8Yo132yv8jnCcsLpal8klM7DcPNow2KBs,2078
|
|
27
27
|
ophyd_async/epics/__init__.py,sha256=ou4yEaH9VZHz70e8oM614-arLMQvUfQyXhRJsnEpWn8,60
|
|
@@ -136,14 +136,14 @@ ophyd_async/tango/testing/__init__.py,sha256=SYXPAS00ny3jlUMOJKpaewO4ljPjK1_z1sm
|
|
|
136
136
|
ophyd_async/tango/testing/_one_of_everything.py,sha256=rPAgOoNGvaHMVhB79Gz70NI9tWk3QV5iKg5wAlAtqxU,6571
|
|
137
137
|
ophyd_async/testing/__init__.py,sha256=f53HUj2hpIfrza9OlcOpHmq5wnziQNwixawAK4F1xgc,1698
|
|
138
138
|
ophyd_async/testing/__pytest_assert_rewrite.py,sha256=_SU2UfChPgEf7CFY7aYH2B7MLp-07_qYnVLyu6QtDL8,129
|
|
139
|
-
ophyd_async/testing/_assert.py,sha256=
|
|
139
|
+
ophyd_async/testing/_assert.py,sha256=FrMgMfo-ABq_cMT-hJmoaTxhAY4TwAvGe4ae1SF1rME,7657
|
|
140
140
|
ophyd_async/testing/_mock_signal_utils.py,sha256=d-n_923ii59-ae9TbqVuIK9MAJpDmu0k47fzgJLj8t8,5195
|
|
141
141
|
ophyd_async/testing/_one_of_everything.py,sha256=Di0hPoKwrDOSsx50-2UdSHM2EbIKrPG9s0Vp11nE9V8,4773
|
|
142
|
-
ophyd_async/testing/_single_derived.py,sha256=
|
|
142
|
+
ophyd_async/testing/_single_derived.py,sha256=5-HOTzgePcZ354NK_ssVpyIbJoJmKyjVQCxSwQXUC-4,2730
|
|
143
143
|
ophyd_async/testing/_utils.py,sha256=zClRo5ve8RGia7wQnby41W-Zprj-slOA5da1LfYnuhw,45
|
|
144
144
|
ophyd_async/testing/_wait_for_pending.py,sha256=YZAR48n-CW0GsPey3zFRzMJ4byDAr3HvMIoawjmTrHw,732
|
|
145
|
-
ophyd_async-0.10.
|
|
146
|
-
ophyd_async-0.10.
|
|
147
|
-
ophyd_async-0.10.
|
|
148
|
-
ophyd_async-0.10.
|
|
149
|
-
ophyd_async-0.10.
|
|
145
|
+
ophyd_async-0.10.0a2.dist-info/licenses/LICENSE,sha256=pU5shZcsvWgz701EbT7yjFZ8rMvZcWgRH54CRt8ld_c,1517
|
|
146
|
+
ophyd_async-0.10.0a2.dist-info/METADATA,sha256=HhNyZ27Piz8QHIz_DzFZnRD_ZJ5oCRRxfEGY5YF9WlU,7075
|
|
147
|
+
ophyd_async-0.10.0a2.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
148
|
+
ophyd_async-0.10.0a2.dist-info/top_level.txt,sha256=-hjorMsv5Rmjo3qrgqhjpal1N6kW5vMxZO3lD4iEaXs,12
|
|
149
|
+
ophyd_async-0.10.0a2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|