Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure returned numpy arrays are not writeable #164

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

AlexanderWells-diamond
Copy link
Collaborator

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

Copy link

github-actions bot commented Jul 11, 2024

Unit Test Results

       6 files  ±0      6 suites  ±0   4m 58s ⏱️ -1s
   299 tests +1  282 ✔️ +1    16 💤 ±0  0 ±0  1 🔥 ±0 
1 196 runs  +4  968 ✔️ +4  224 💤 ±0  0 ±0  4 🔥 ±0 

For more details on these errors, see this check.

Results for commit 8c4b516. ± Comparison against base commit d38df9b.

♻️ This comment has been updated with latest results.

softioc/device.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@Araneidae Araneidae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is technically a breaking change, but not I think worth a major version bump. It would be nice to check if this does break any naughty code ... topup seems a good candidate to check!

@AlexanderWells-diamond AlexanderWells-diamond merged commit 8c4b516 into master Jul 12, 2024
21 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants