GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — GraphicCollection.__del__ method can cause confusing tracebacks · Issue #393 · fastplotlib/fastplotlib Closed DescriptionIf something fails during init of a GraphicCollection, an exception will be raised, but that exception will often be hidden higher up in the stack due to a failure during cleanup in the Traceback (most recent call last): File "/Users/talley/dev/forks/fastplotlib/examples/desktop/line_collection/line_stack.py", line 27, in <module> plot.add_line_stack(data, cmap=["jet"]) File "/Users/talley/dev/forks/fastplotlib/fastplotlib/layouts/graphic_methods_mixin.py", line 314, in add_line_stack return self._create_graphic(LineStack, data, z_position, thickness, colors, cmap, separation, separation_axis, name, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/talley/dev/forks/fastplotlib/fastplotlib/layouts/graphic_methods_mixin.py", line 25, in _create_graphic graphic = graphic_class(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/talley/dev/forks/fastplotlib/fastplotlib/graphics/line_collection.py", line 547, in __init__ super(LineStack, self).__init__( File "/Users/talley/dev/forks/fastplotlib/fastplotlib/graphics/line_collection.py", line 125, in __init__ raise ValueError( ValueError: cmap argument must be a single cmap or a list of cmaps with the same length as the data Exception ignored in: <function GraphicCollection.__del__ at 0x1212071a0> Traceback (most recent call last): File "/Users/talley/dev/forks/fastplotlib/fastplotlib/graphics/_base.py", line 477, in __del__ super().__del__() File "/Users/talley/dev/forks/fastplotlib/fastplotlib/graphics/_base.py", line 171, in __del__ del WORLD_OBJECTS[self.loc] ~~~~~~~~~~~~~^^^^^^^^^^ KeyError: '0x16a217250' It would be nice to either ignore errors in the def __del__(self): with contextlib.suppress(Exception): self.world_object.clear() for loc in self._graphics: del COLLECTION_GRAPHICS[loc] super().__del__() and then you'd see: Traceback (most recent call last): File "/Users/talley/dev/forks/fastplotlib/examples/desktop/line_collection/line_stack.py", line 27, in <module> plot.add_line_stack(data, cmap=["jet"]) File "/Users/talley/dev/forks/fastplotlib/fastplotlib/layouts/graphic_methods_mixin.py", line 314, in add_line_stack return self._create_graphic(LineStack, data, z_position, thickness, colors, cmap, separation, separation_axis, name, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/talley/dev/forks/fastplotlib/fastplotlib/layouts/graphic_methods_mixin.py", line 25, in _create_graphic graphic = graphic_class(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/talley/dev/forks/fastplotlib/fastplotlib/graphics/line_collection.py", line 547, in __init__ super(LineStack, self).__init__( File "/Users/talley/dev/forks/fastplotlib/fastplotlib/graphics/line_collection.py", line 125, in __init__ raise ValueError( ValueError: cmap argument must be a single cmap or a list of cmaps with the same length as the data Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| 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. |