GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — implemenet `@block_reentrance` decorator by kushalkolar · Pull Request #744 · fastplotlib/fastplotlib

Conversation

@kushalkolar

@kushalkolar kushalkolar commented Mar 3, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This simple decorator applied on all the GraphicFeature.set_value() methods should allow us to create complex event graphs with cycles. Users don't have to think about managing bidirectional events 😄

related #741

Example:

import fastplotlib as fpl
import numpy as np

fig = fpl.Figure((3, 1))
sels = list()

for subplot in fig:
    lg = subplot.add_line(np.sin(np.linspace(0, np.pi * 10, 100)))
    sel = lg.add_linear_selector()
    sels.append(sel)


# create event handler and just add it to all graphics
# don't need to worry worry when event graphs have cycles
def set_selection(ev):
    for sel in sels:
        sel.selection = ev.info["value"]

for sel in sels:
    sel.add_event_handler(set_selection, "selection")

fig.show(maintain_aspect=False)

Need to test with more graphics and also test when exceptions are raised in GraphicFeature.set_value()

@apasarkar @FlynnOConnell you guys will love this!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kushalkolar
implemenet block_reentrance decorator
9e0e3a8
@kushalkolar
kushalkolar requested a review from clewis7 as a code owner March 3, 2025 19:59
kushalkolar added 2 commits March 3, 2025 22:52
@kushalkolar
add unit circle example
21db049
@kushalkolar
raise original exception correctly, comments
c563a06
@kushalkolar

kushalkolar commented Mar 4, 2025

Copy link
Copy Markdown
Member Author

added a simple example with trivially "synced" selectors:

unit_circle-2025-03-03_22.50.14.mp4
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar

kushalkolar commented Mar 4, 2025

Copy link
Copy Markdown
Member Author

The decorator is working as expected and exceptions are also raised correctly, @clewis7 if you can test on your end too it should be gtg! This is probably my favorite PR, small few lines decorator that makes life so much easier 🥳

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar
cleanup, comments
31ebc34
This was referenced Mar 4, 2025
calcium imaging toy example #745
Closed
Auto truncate and create ellipses if subplot rect is not wide enough for subplot title #746
Open
clewis7
clewis7 reviewed Mar 5, 2025
View reviewed changes

@clewis7 clewis7 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

super cool! might need to run the docs to update API?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread examples/selection_tools/unit_circle.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread examples/selection_tools/unit_circle.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar

kushalkolar commented Mar 5, 2025

Copy link
Copy Markdown
Member Author

No API changes here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

clewis7
clewis7 approved these changes Mar 5, 2025
View reviewed changes
@clewis7
clewis7 merged commit 3362669 into main Mar 5, 2025
@clewis7
clewis7 deleted the gfeature-block-reentrant branch March 5, 2025 22:17
@kushalkolar kushalkolar mentioned this pull request Mar 14, 2025
Cursor tool #662
Closed
4 of 14 tasks
This was referenced May 19, 2025
Universal store model with bidirectional publisher-subscriber #741
Closed
ImageWidget.current_index setter is not non-reentrant #825
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@clewis7 clewis7 clewis7 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@kushalkolar @clewis7
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.