Skip to content

MNT: Added analyze-snapshot test cases. - #1290

Merged
skoudoro merged 2 commits into
fury-gl:masterfrom
maharshi-gor:analyze-snapshot-tests
Jul 1, 2026
Merged

MNT: Added analyze-snapshot test cases.#1290
skoudoro merged 2 commits into
fury-gl:masterfrom
maharshi-gor:analyze-snapshot-tests

Conversation

@maharshi-gor

Copy link
Copy Markdown
Contributor
  • Verify if the actor is present in the window.

- Verify if the actor is present in the window.
@maharshi-gor
maharshi-gor force-pushed the analyze-snapshot-tests branch from c13d0a7 to 3b2b58d Compare June 28, 2026 15:28

@skoudoro skoudoro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 thread fury/actor/tests/test_visibility.py Outdated
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

all of this could be in helpers.py that you just created and can be reuse

Comment thread fury/ui/tests/test_visibility.py Outdated
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same helpers.py

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

comment not addressed @maharshi-gor

@skoudoro skoudoro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @maharshi-gor,

It is closed to be done. Thanks for the future fix. see below

Comment thread fury/ui/tests/test_visibility.py Outdated
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

comment not addressed @maharshi-gor

Comment thread fury/ui/tests/test_visibility.py Outdated
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

in helpers.py

@maharshi-gor
maharshi-gor force-pushed the analyze-snapshot-tests branch from a59f8d8 to fff84d1 Compare June 30, 2026 14:41

@skoudoro skoudoro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @maharshi-gor, merging


from fury import actor, window

# --- Shared real inputs for visibility/snapshot tests -----------------------

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

comment not relevant, to remove

@skoudoro
skoudoro merged commit a2476b7 into fury-gl:master Jul 1, 2026
22 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