DiamondLightSource / pythonSoftIOC

Embed an EPICS IOC in a Python process
Apache License 2.0
34 stars 9 forks source link

Ensure returned numpy arrays are not writeable #164

Closed AlexanderWells-diamond closed 3 months ago

AlexanderWells-diamond commented 3 months ago

As we return a reference to the numpy array, rather than a copy, we want to ensure that the value is not modified under our noses.

Now when you try and modify a returned array there will be a ValueError raised.

See documentation here: https://numpy.org/doc/stable/reference/generated/numpy.ndarray.flags.html

github-actions[bot] commented 3 months ago

Unit Test Results

       6 files  ±0      6 suites  ±0   4m 58s :stopwatch: -1s    299 tests +1  282 :heavy_check_mark: +1    16 :zzz: ±0  0 :x: ±0  1 :fire: ±0  1 196 runs  +4  968 :heavy_check_mark: +4  224 :zzz: ±0  0 :x: ±0  4 :fire: ±0 

For more details on these errors, see this check.

Results for commit 8c4b516f. ± Comparison against base commit d38df9bd.

:recycle: This comment has been updated with latest results.