Skip to content

Commit 87e748b

Browse files
Add support and tests for List[str]
Note that these tests don't currently pass!
1 parent cb1406d commit 87e748b

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

‎softioc/builder.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def _waveform(value, fields):
220220
initial_value = numpy.require(initial_value, numpy.int32)
221221
elif initial_value.dtype == numpy.uint64:
222222
initial_value = numpy.require(initial_value, numpy.uint32)
223-
elif initial_value.dtype.char == "S":
223+
elif initial_value.dtype.char in ("S", "U"):
224224
initial_value = numpy.require(initial_value, numpy.dtype("S40"))
225225
else:
226226
initial_value = numpy.array([], dtype = datatype)

‎tests/test_record_values.py‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,24 @@ def record_values_names(fixture_value):
207207
),
208208
numpy.ndarray,
209209
),
210+
(
211+
"wIn_string_array",
212+
builder.WaveformIn,
213+
["123", "456", "7890"],
214+
numpy.array(
215+
[b"123", b"456", b"7890"], dtype=numpy.dtype("|S40")
216+
),
217+
numpy.ndarray,
218+
),
219+
(
220+
"wOut_string_array",
221+
builder.WaveformOut,
222+
["123", "456", "7890"],
223+
numpy.array(
224+
[b"123", b"456", b"7890"], dtype=numpy.dtype("|S40")
225+
),
226+
numpy.ndarray,
227+
),
210228
(
211229
"longStringIn_str",
212230
builder.longStringIn,

0 commit comments

Comments
 (0)