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 — add `References` object to `PlotArea`, other cleanup, better garbage collection by kushalkolar · Pull Request #467 · fastplotlib/fastplotlib

Conversation

@kushalkolar

@kushalkolar kushalkolar commented Mar 31, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

closes #463

Adds new References object for which there is a single global instance for one instance of Python.

This helps segregate Graphic, Selector, Legend and any other objects we might want to have in the future.

start using prefix _fpl_* for any attributes/methods that are for fpl internal use only, to distinguish them from actual private attributes

Moved selector _fpl_cleanup to Graphic._fpl_cleanup

Need to add tests for:

  • remove and adding things from PlotArea
  • garbage collection, maybe a starting point: https://github.com/fastplotlib/fastplotlib/blob/0cbe36802431c2928394fd33004804d50018a87d/examples/garbage_collection.ipynb

Sorry, something went wrong.

Uh oh!

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

All reactions
kushalkolar added 3 commits March 31, 2024 05:40
@kushalkolar
add References object to PlotArea, other cleanup
e56c962
@kushalkolar
more cleanup
7be7407
@kushalkolar
black
8b82e89
@kushalkolar
kushalkolar requested a review from clewis7 as a code owner March 31, 2024 10:36
@kushalkolar
add refcount utility to References, fix Graphic.name setter bug
b26a70c
@kushalkolar

kushalkolar commented Mar 31, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

Using the linear region selectors notebook to try adn understand what holds onto references since selectors have lots of events.

image

All reactions

Sorry, something went wrong.

Uh oh!

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

kushalkolar added 2 commits March 31, 2024 08:34
@kushalkolar
actually fix Graphic.name setter bug
ca435df
@kushalkolar
more generalized event handler cleanup in Graphic
6a02647
@kushalkolar

kushalkolar commented Mar 31, 2024

Copy link
Copy Markdown
Member Author

A base Graphic._fpl_cleanup() that removes all possible event handlers on the renderer and world objects seems to work, tested with LinearRegionSelector

image

All reactions

Sorry, something went wrong.

Uh oh!

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

@kushalkolar kushalkolar changed the title add References object to PlotArea, other cleanup add References object to PlotArea, other cleanup, better garbage collection Mar 31, 2024
kushalkolar added 2 commits March 31, 2024 22:44
@kushalkolar
all gc works now
aed5fb1
@kushalkolar
black
c7bab03
clewis7
clewis7 reviewed Apr 2, 2024
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.

LGTM, REFERENCES class very elegant

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread fastplotlib/graphics/_base.py Resolved

Uh oh!

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

Comment thread fastplotlib/graphics/_base.py Resolved

Uh oh!

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

Comment thread fastplotlib/graphics/_base.py Resolved

Uh oh!

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

Comment thread fastplotlib/graphics/selectors/_base_selector.py Resolved

Uh oh!

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

@kushalkolar
kushalkolar merged commit bc2de99 into main Apr 2, 2024
@kushalkolar kushalkolar mentioned this pull request Apr 2, 2024
use of weakref.proxy #472
Closed
@kushalkolar
kushalkolar deleted the plot-area-refactor branch April 11, 2024 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@clewis7 clewis7 clewis7 left review comments

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.

refactor graphic, selector and legend instances dicts in _plot_area

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.