MNT: Added analyze-snapshot test cases. - #1290
Merged
Merged
Conversation
maharshi-gor
commented
Jun 28, 2026
Contributor
- Verify if the actor is present in the window.
- Verify if the actor is present in the window.
maharshi-gor
force-pushed
the
analyze-snapshot-tests
branch
from
June 28, 2026 15:28
c13d0a7 to
3b2b58d
Compare
skoudoro
requested changes
Jun 29, 2026
skoudoro
left a comment
Contributor
There was a problem hiding this comment.
Hi @maharshi-gor,
Thank you for this.
Overall looks good. I just believe that more stuff should be in helpers.py. Also, helpers does not need to be a private module
Comment on lines
+24
to
+63
| def _gradient_image(n=64): | ||
| """A non-uniform 2D image so the rendered frame is never flat.""" | ||
| ramp = np.linspace(0.0, 1.0, n, dtype=np.float32) | ||
| return np.outer(ramp, ramp) | ||
|
|
||
|
|
||
| def _scalar_volume(n=32): | ||
| """A non-uniform 3D scalar volume (deterministic).""" | ||
| x, y, z = np.mgrid[0:n, 0:n, 0:n] | ||
| return ((x + y + z) % 17).astype(np.float32) | ||
|
|
||
|
|
||
| def _roi_volume(n=20): | ||
| """A binary volume with a solid central cube (for contour actors).""" | ||
| data = np.zeros((n, n, n), dtype=np.float32) | ||
| data[5:15, 5:15, 5:15] = 1.0 | ||
| return data | ||
|
|
||
|
|
||
| def _label_volume(n=20): | ||
| """A labeled volume with one nonzero region.""" | ||
| data = np.zeros((n, n, n), dtype=int) | ||
| data[5:15, 5:15, 5:15] = 1 | ||
| return data | ||
|
|
||
|
|
||
| def _peak_dirs(n=8): | ||
| """A (X, Y, Z, 3, 3) field of unit peak directions.""" | ||
| dirs = np.zeros((n, n, n, 3, 3), dtype=np.float32) | ||
| dirs[..., 0, :] = (1.0, 0.0, 0.0) | ||
| dirs[..., 1, :] = (0.0, 1.0, 0.0) | ||
| dirs[..., 2, :] = (0.0, 0.0, 1.0) | ||
| return dirs | ||
|
|
||
|
|
||
| def _vector_field(n=8): | ||
| """A (X, Y, Z, 3) field of unit vectors.""" | ||
| field = np.zeros((n, n, n, 3), dtype=np.float32) | ||
| field[...] = (1.0, 0.0, 0.0) | ||
| return field |
Contributor
There was a problem hiding this comment.
all of this could be in helpers.py that you just created and can be reuse
Comment on lines
+23
to
+32
| def _icon(fname="play3.png"): | ||
| """Return a real icon image path, fetching the asset set on first use.""" | ||
| fetch_viz_icons() | ||
| return read_viz_icons(fname=fname) | ||
|
|
||
|
|
||
| def _list_box_item(): | ||
| item = ui.ListBoxItem2D(on_select=lambda **kwargs: None, size=(100, 30)) | ||
| item.element = "Hello" | ||
| return item |
skoudoro
requested changes
Jun 30, 2026
skoudoro
left a comment
Contributor
There was a problem hiding this comment.
Hi @maharshi-gor,
It is closed to be done. Thanks for the future fix. see below
Comment on lines
+23
to
+32
| def _icon(fname="play3.png"): | ||
| """Return a real icon image path, fetching the asset set on first use.""" | ||
| fetch_viz_icons() | ||
| return read_viz_icons(fname=fname) | ||
|
|
||
|
|
||
| def _list_box_item(): | ||
| item = ui.ListBoxItem2D(on_select=lambda **kwargs: None, size=(100, 30)) | ||
| item.element = "Hello" | ||
| return item |
Comment on lines
+23
to
+32
| def _icon(fname="play3.png"): | ||
| """Return a real icon image path, fetching the asset set on first use.""" | ||
| fetch_viz_icons() | ||
| return read_viz_icons(fname=fname) | ||
|
|
||
|
|
||
| def _list_box_item(): | ||
| item = ui.ListBoxItem2D(on_select=lambda **kwargs: None, size=(100, 30)) | ||
| item.element = "Hello" | ||
| return item |
maharshi-gor
force-pushed
the
analyze-snapshot-tests
branch
from
June 30, 2026 14:41
a59f8d8 to
fff84d1
Compare
skoudoro
approved these changes
Jul 1, 2026
skoudoro
left a comment
Contributor
There was a problem hiding this comment.
Thanks @maharshi-gor, merging
|
|
||
| from fury import actor, window | ||
|
|
||
| # --- Shared real inputs for visibility/snapshot tests ----------------------- |
Contributor
There was a problem hiding this comment.
comment not relevant, to remove
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.