Skip to content

Commit 565bca1

Browse files
Remove DeprecationWarning from using "+" operator
This used to be an easy way to return a copy of the array. Now we must use the explicit copy function.
1 parent 63995ce commit 565bca1

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ Added:
1515
- `Add Channel Access Report functions <../../pull/115>`_
1616
- Add ``WaveformIn`` to default exports from ``softioc.builder``
1717

18+
Fixed:
19+
20+
- `Fix DeprecationWarning from numpy when using "+" <../../pull/123>`_
21+
1822
4.2.0_ - 2022-11-08
1923
-------------------
2024

softioc/device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ def _value_to_epics(self, value):
409409
# common class of bug, at the cost of duplicated code and data, here we
410410
# ensure a copy is taken of the value.
411411
assert len(value) <= self._nelm, 'Value too long for waveform'
412-
return +value
412+
return numpy.copy(value)
413413

414414
def _epics_to_value(self, value):
415415
return value

softioc/fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,4 @@ def __set_time(self, address, new_time):
147147

148148

149149

150-
__all__ = ['RecordFactory', 'DbfCodeToNumpy', 'ca_timestamp']
150+
__all__ = ['RecordFactory', 'ca_timestamp']

0 commit comments

Comments
 (0)