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

numpy arrays in slm_image break repr #206

Closed
hinderling opened this issue Nov 25, 2024 · 0 comments · Fixed by #207
Closed

numpy arrays in slm_image break repr #206

hinderling opened this issue Nov 25, 2024 · 0 comments · Fixed by #207
Labels
bug Something isn't working

Comments

@hinderling
Copy link
Contributor

Using an np.array in SLMImage leads to an error in _non_default_repr_args when validating the fields.

Code to reproduce:

img_255 = (np.ones((slm_height,slm_width))*255).astype(np.uint8)
event_slm_all_on = MDAEvent(slm_image=SLMImage(data=img_255,device=slm_dev))
mmc.mda.run([event_slm_all_on])

Error:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

As discussed here:
pymmcore-plus/pymmcore-plus#406 (comment)

@tlambert03 tlambert03 added the bug Something isn't working label Nov 25, 2024
@tlambert03 tlambert03 changed the title support slm_image from useq v0.6 numpy arrays in slm_image break repr Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants