Skip to content

Commit

Permalink
clean up after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
jsouter committed Feb 12, 2025
1 parent df0af09 commit ebb58d8
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 28 deletions.
5 changes: 3 additions & 2 deletions src/ophyd_async/tango/testing/_one_of_everything.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import textwrap
from dataclasses import dataclass
from random import choice
from typing import Any, Generic
from typing import Any, Generic, TypeVar

import numpy as np

from ophyd_async.core import (
Array1D,
DTypeScalar_co,
StrictEnum,
T,
)
from ophyd_async.testing import float_array_value, int_array_value
from tango import AttrDataFormat, AttrWriteType, DevState
from tango.server import Device, attribute, command

T = TypeVar("T")


class ExampleStrEnum(StrictEnum):
A = "AAA"
Expand Down
26 changes: 13 additions & 13 deletions tests/core/test_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,25 +375,25 @@ async def test_assert_reading_optional_fields(
):
# alarm_severity of 0 and timestamp of ANY supplied if none given
await assert_reading(
one_of_everything_device.int, {"everything-device-int": {"value": 1}}
one_of_everything_device.a_int, {"everything-device-a_int": {"value": 1}}
)

with pytest.raises(AssertionError):
await assert_reading(
one_of_everything_device.int,
{"everything-device-int": {"value": 1, "timestamp": -1}},
one_of_everything_device.a_int,
{"everything-device-a_int": {"value": 1, "timestamp": -1}},
)

with pytest.raises(AssertionError):
await assert_reading(
one_of_everything_device.int,
{"everything-device-int": {"value": 1, "alarm_severity": 1}},
one_of_everything_device.a_int,
{"everything-device-a_int": {"value": 1, "alarm_severity": 1}},
)

await assert_reading(
one_of_everything_device.int,
one_of_everything_device.a_int,
{
"everything-device-int": {
"everything-device-a_int": {
"value": 1,
"alarm_severity": 0,
"timestamp": time.monotonic(),
Expand Down Expand Up @@ -428,13 +428,13 @@ async def test_assert_configuration_everything(
"timestamp": ANY,
"alarm_severity": 0,
},
"everything-device-boola": {
"value": _array_vals["boola"],
"everything-device-a_enum": {
"value": "Bbb",
"timestamp": ANY,
"alarm_severity": 0,
},
"everything-device-enum": {
"value": "Bbb",
"everything-device-boola": {
"value": _array_vals["boola"],
"timestamp": ANY,
"alarm_severity": 0,
},
Expand Down Expand Up @@ -573,9 +573,9 @@ async def test_assert_reading_everything(
},
)
await assert_reading(
one_of_everything_device.enum,
one_of_everything_device.a_enum,
{
"everything-device-enum": {
"everything-device-a_enum": {
"value": ExampleEnum.B,
"timestamp": ANY,
"alarm_severity": 0,
Expand Down
29 changes: 16 additions & 13 deletions tests/test_data/test_yaml_save.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
_sig_rw: Top level private SignalRW
child.a_bool: true
child.enum: Bbb
child.a_enum: Bbb
child.a_float: 1.234
child.a_int: 1
child.a_str: test_string
child.boola: [false, false, true]
child.enuma:
- Aaa
- Ccc
child.a_float: 1.234
child.float32a:
[
-3.4028234663852886e+38,
Expand All @@ -19,21 +22,19 @@ child.float32a:
child.float64a:
[
-1.7976931348623157e+308,
1.7976931348623157e+308,
1.7976931348623158e+308,
2.2250738585072014e-308,
5.0e-324,
0.0,
1.234,
234000.0,
3.45e-06,
]
child.a_int: 1
child.int16a: [-32768, 32767, 0, 1, 2, 3, 4]
child.int32a: [-2147483648, 2147483647, 0, 1, 2, 3, 4]
child.int64a: [-9223372036854775808, 9223372036854775807, 0, 1, 2, 3, 4]
child.int8a: [-128, 127, 0, 1, 2, 3, 4]
child.ndarray: [[1, 2, 3], [4, 5, 6]]
child.a_str: test_string
child.stra:
- one
- two
Expand All @@ -58,11 +59,14 @@ child.uint64a: [0, 18446744073709551615, 0, 1, 2, 3, 4]
child.uint8a: [0, 255, 0, 1, 2, 3, 4]
sig_rw: Top level SignalRW
vector.1.a_bool: true
vector.1.enum: Bbb
vector.1.a_enum: Bbb
vector.1.a_float: 1.234
vector.1.a_int: 1
vector.1.a_str: test_string
vector.1.boola: [false, false, true]
vector.1.enuma:
- Aaa
- Ccc
vector.1.a_float: 1.234
vector.1.float32a:
[
-3.4028234663852886e+38,
Expand All @@ -85,13 +89,11 @@ vector.1.float64a:
234000.0,
3.45e-06,
]
vector.1.a_int: 1
vector.1.int16a: [-32768, 32767, 0, 1, 2, 3, 4]
vector.1.int32a: [-2147483648, 2147483647, 0, 1, 2, 3, 4]
vector.1.int64a: [-9223372036854775808, 9223372036854775807, 0, 1, 2, 3, 4]
vector.1.int8a: [-128, 127, 0, 1, 2, 3, 4]
vector.1.ndarray: [[1, 2, 3], [4, 5, 6]]
vector.1.a_str: test_string
vector.1.stra:
- one
- two
Expand All @@ -115,11 +117,14 @@ vector.1.uint32a: [0, 4294967295, 0, 1, 2, 3, 4]
vector.1.uint64a: [0, 18446744073709551615, 0, 1, 2, 3, 4]
vector.1.uint8a: [0, 255, 0, 1, 2, 3, 4]
vector.3.a_bool: true
vector.3.enum: Bbb
vector.3.a_enum: Bbb
vector.3.a_float: 1.234
vector.3.a_int: 1
vector.3.a_str: test_string
vector.3.boola: [false, false, true]
vector.3.enuma:
- Aaa
- Ccc
vector.3.a_float: 1.234
vector.3.float32a:
[
-3.4028234663852886e+38,
Expand All @@ -142,13 +147,11 @@ vector.3.float64a:
234000.0,
3.45e-06,
]
vector.3.a_int: 1
vector.3.int16a: [-32768, 32767, 0, 1, 2, 3, 4]
vector.3.int32a: [-2147483648, 2147483647, 0, 1, 2, 3, 4]
vector.3.int64a: [-9223372036854775808, 9223372036854775807, 0, 1, 2, 3, 4]
vector.3.int8a: [-128, 127, 0, 1, 2, 3, 4]
vector.3.ndarray: [[1, 2, 3], [4, 5, 6]]
vector.3.a_str: test_string
vector.3.stra:
- one
- two
Expand Down

0 comments on commit ebb58d8

Please sign in to comment.