Skip to content

add colorbar to hlut tool, add pause_events() context manager#550

Closed
kushalkolar wants to merge 3 commits into
mainfrom
hlut-cbar
Closed

add colorbar to hlut tool, add pause_events() context manager#550
kushalkolar wants to merge 3 commits into
mainfrom
hlut-cbar

Conversation

@kushalkolar

@kushalkolar kushalkolar commented Jul 10, 2024

Copy link
Copy Markdown
Member

adds a dynamic colobar to the HistogramLUT tool

cbar-2024-07-10_03.00.57.mp4

@clewis7 this will modify the test screenshot, but I will do that after getting your thoughts on this 😄

@kushalkolar

kushalkolar commented Jul 10, 2024

Copy link
Copy Markdown
Member Author

I realized there's a better way to manage temporary event blocking, added a context manager that takes Graphics as args and blocks events until the context manager exits.

@clewis7 you will like this :D , simple example:

a = np.random.rand(10, 10)
ig = fpl.ImageGraphic(a)

with fpl.pause_events(ig):
    print("enter context manager")
    print(ig.block_events)
    print("doing some stuff that can cause infinite recursion")
    print(ig.block_events)

print("done doing stuff")
print(ig.block_events)

results in:

enter context manager
True
doing some stuff that can cause infinite recursion
True
done doing stuff
False

Comment thread fastplotlib/widgets/histogram_lut.py
@kushalkolar kushalkolar changed the title add colorbar to hlut tool add colorbar to hlut tool, add pause_events() context manager Jul 10, 2024
Comment thread fastplotlib/graphics/utils.py

@clewis7 clewis7 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM aside from maybe adding some code comments

I think the pause_events() will be super useful for pynaviz stuff

@kushalkolar

Copy link
Copy Markdown
Member Author

closing because I merged this into axes #551

@kushalkolar kushalkolar deleted the hlut-cbar branch July 27, 2024 06:42
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