Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

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

Closed
wants to merge 3 commits into from

Conversation

kushalkolar
Copy link
Member

@kushalkolar kushalkolar commented Jul 10, 2024

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
Copy link
Member Author

kushalkolar commented Jul 10, 2024

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

@kushalkolar kushalkolar changed the title add colorbar to hlut tool add colorbar to hlut tool, add pause_events() context manager Jul 10, 2024
Copy link
Member

@clewis7 clewis7 left a comment

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
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