Sorry, something went wrong.
|
@clewis7 notebook tests are failing due to a new change in pygfx which we haven't caught up to yet, but I want to merge this anyways and deal with the pygfx changes later. |
Sorry, something went wrong.
There was a problem hiding this comment.
Had a couple of clarifying questions? Has been too long since I have looked at this. Otherwise, LGTM!
Sorry, something went wrong.
| def __init__(self, parent, value: bool): | ||
| super(Deleted, self).__init__(parent, value) | ||
|
|
||
| def _set(self, value: bool): |
There was a problem hiding this comment.
So, this will get triggered when __del__ is called and self.deleted = True is set?
Sorry, something went wrong.
There was a problem hiding this comment.
How are we preventing users from if a graphic has been deleted to still having reference to the graphic and trying to say something silly like graphic.deleted=False? Will this throw an error if the graphic has already been deleted? I would assume so because there will be no reference.
Sorry, something went wrong.
There was a problem hiding this comment.
So, this will get triggered when __del__ is called and self.deleted = True is set?
Yes, Graphic.__del__ sets self.deleted = True https://github.com/fastplotlib/fastplotlib/pull/404/files#diff-a57994ecff1cde4e05c8175265219f0b5200da144ce8733b9eb560c09bcea7ddR179
How are we preventing users from if a graphic has been deleted to still having reference to the graphic and trying to say something silly like graphic.deleted=False? Will this throw an error if the graphic has already been deleted? I would assume so because there will be no reference.
Since users are only given acccess to weakreferences, it will throw a reference error if they try to do anything with a deleted Graphic.
Sorry, something went wrong.
|
|
||
| pick_info = { | ||
| "index": None, | ||
| "collection-index": self._collection_index, |
There was a problem hiding this comment.
What is the difference here between index vs collection-index? Also, collection-index could be None if the graphic is not a CollectionGraphic, no?
Sorry, something went wrong.
There was a problem hiding this comment.
It seems like index will always be None?
Sorry, something went wrong.
There was a problem hiding this comment.
index is buffer index, used for things like data and colors features. Not used here since it's not relevant
Sorry, something went wrong.
This makes it possible to create callbacks to do things when a Graphic is deleted from a PlotArea.
garbage collection is actinng wonky again so I need to fix that too... nevermind, I think was accessing stuff users wouldn't normally access in jupyter so ipython was clinging onto it, as usual 😄
This also changes all feature_events class attributes to be a set.
Useage: