Sorry, something went wrong.
|
Should be possible to dynamically add and remove GUIs to edges if the BaseGUI subclass implements a cleanup method. |
Sorry, something went wrong.
|
cmap picker, last thing I'm making before the sliders for ImageWidget 😄 cmap-picker-2024-07-31_02.37.21.mp4 |
Sorry, something went wrong.
|
Might make more sense to subclass Subplot and add the toolbar to it directly |
Sorry, something went wrong.
|
ok now after subsampling the cockatoo video memory consumption when I build locally remains < 1.5GB. Before it was ~2.7 GB. |
Sorry, something went wrong.
| # Ignore and do not use the next 2 lines | ||
| # for the purposes of docs gallery generation we subsample and only use 15 frames | ||
| movie_sub = movie[:15, ::12, ::12].copy() | ||
| del movie |
There was a problem hiding this comment.
@clewis7 until we either figure out a way to hide this from the docs example code (maybe do it under the hood in ImageWidget by checking for RTD_BUILD=1 env variable) or fix the annoying sphinx gallery memory leak
Sorry, something went wrong.
There was a problem hiding this comment.
I think we do it under the hood by checking for env variable
Sorry, something went wrong.
| shared = pygfx.renderers.wgpu.get_shared() | ||
| self._texture_limit_2d = shared.device.limits["max-texture-dimension2d"] | ||
|
|
There was a problem hiding this comment.
@clewis7 so now instead of tiling textures based on the default 8192 WGPU limit, it will read the limits currently set on the adapter and use those 😄 . This way we can set it to whatever we want in the tests, such as 1024 or 2048, and it will dynamically read the value that has been set for creating the texture array!
Sorry, something went wrong.
There was a problem hiding this comment.
cool!
Sorry, something went wrong.
| if "RTD_BUILD" in os.environ.keys(): | ||
| if os.environ["RTD_BUILD"] == "1": | ||
| self._playing["t"] = True | ||
| self._loop = True |
There was a problem hiding this comment.
@clewis7 this is how the video auto-plays upon ImageWidget create for docs gallery generation
Sorry, something went wrong.
| def pytest_sessionstart(session): | ||
| pygfx.renderers.wgpu.set_wgpu_limits(**{"max-texture-dimension2d": MAX_TEXTURE_SIZE}) |
There was a problem hiding this comment.
@clewis7 This is how we set the limit before the test session starts. The limit must be set before any renderer object is created, so it that's why it's in pytest_sessionstart()
Sorry, something went wrong.
There was a problem hiding this comment.
@clewis7 so the difs here make sure that the TextureArray can be created correctly for the various scenarios given a limit of 1024, could you go through it and just check that the logic is correct? I've put notes.
Sorry, something went wrong.
| row_indices_values=np.array([0, MAX_TEXTURE_SIZE]), | ||
| col_indices_values=np.array([0, MAX_TEXTURE_SIZE, 2 * MAX_TEXTURE_SIZE]), |
There was a problem hiding this comment.
So if we have an data array of shape (1200, 2200), and the limit is 1024 then we need a TextureArray of shape (2, 3), that's the buffer_shape here.
for the rows, we need 2 because 1200 with a limit of 1024 means we will have array with 1024 rows and another with 176
Same logic for the columns and the other tests below for test_tall and test_square
Sorry, something went wrong.
There was a problem hiding this comment.
imagewidget tools show up in test screenshots too :D
Sorry, something went wrong.
|
ALL TESTS FINALLY PASSING AND RTD BUILD IS BUILDING 🥳 🥳 🥳 🥳 I didn't expent the hardest thing about this would be dealing with rtd limits and sphinx gallery memory leak 🤦 @clewis7 few final comments up here just to get you up to speed, and if you could do a final check on that TextureArray test stuff I pointed out at the bottom. Other than that good to go!! |
Sorry, something went wrong.
|
I updated the user guide with imgui images, need to figure out why the vids are not looping, I used imageio to make them 🤔 |
Sorry, something went wrong.
|
LGTM! |
Sorry, something went wrong.
|
This looks amazing Kushal!!! |
Sorry, something went wrong.
The actual imgui implementation discussed with @clewis7
Started implemetning ImguiFigure, kinda alright so far.
tasks:
closes #494 , closes #260 , closes #360