diff --git a/ophyd/tests/test_utils.py b/ophyd/tests/test_utils.py index 2fd1a26d4..bd1b26af3 100644 --- a/ophyd/tests/test_utils.py +++ b/ophyd/tests/test_utils.py @@ -48,15 +48,15 @@ def test_records_from_db(): @pytest.mark.parametrize( "value, dtype, shape", [ - [1, "integer", []], - [1.0, "number", []], - [1e-3, "number", []], - ["foo", "string", []], - [np.array([1, 2, 3]), "array", [3]], - [np.array([[1, 2], [3, 4]]), "array", [2, 2]], - [(1, 2, 3), "array", [3]], - [[1, 2, 3], "array", [3]], - [[], "array", [0]], + [1, "integer", ()], + [1.0, "number", ()], + [1e-3, "number", ()], + ["foo", "string", ()], + [np.array([1, 2, 3]), "array", (3,)], + [np.array([[1, 2], [3, 4]]), "array", (2, 2)], + [(1, 2, 3), "array", (3,)], + [[1, 2, 3], "array", (3,)], + [[], "array", (0,)], ], ) def test_data_type_and_shape(value, dtype, shape): diff --git a/ophyd/utils/epics_pvs.py b/ophyd/utils/epics_pvs.py index ce3733e0c..39d9ad298 100644 --- a/ophyd/utils/epics_pvs.py +++ b/ophyd/utils/epics_pvs.py @@ -401,12 +401,12 @@ def data_shape(val): ``list(np.ndarray.shape)`` """ if data_type(val) != "array": - return [] + return () try: - return list(val.shape) + return tuple(val.shape) except AttributeError: - return [len(val)] + return (len(val),) # Vendored from pyepics v3.3.0