Skip to content
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

When presented with an empty layer, the viewer fails to show anything #338

Closed
cbmoore opened this issue Nov 17, 2021 · 4 comments · Fixed by #339
Closed

When presented with an empty layer, the viewer fails to show anything #338

cbmoore opened this issue Nov 17, 2021 · 4 comments · Fixed by #339

Comments

@cbmoore
Copy link

cbmoore commented Nov 17, 2021

If (for instance) a crop causes one of the layers to be empty, a subsequent show will result in the viewing failing (hangs with a black window).

@abey79
Copy link
Owner

abey79 commented Nov 17, 2021

Thanks for the feedback. Can you provide the traceback? Due to #320 I'm currently limited in my ability to run the viewer.

@cbmoore
Copy link
Author

cbmoore commented Nov 17, 2021

Traceback:

qt.qpa.window: <QNSWindow: 0x7f87f9d0dd70; contentView=<QNSView: 0x7f87f9d06470; QCocoaWindow(0x7f87f98a6c80, window=QWidgetWindow(0x7f87f9af50c0, name="QGLWidgetClassWindow"))>> has active key-value observers (KVO)! These will stop working now that the window is recreated, and will result in exceptions when the observers are removed. Break in QCocoaWindow::recreateWindowIfNeeded to debug.
qt.qpa.window: <QNSWindow: 0x7f87f9d38720; contentView=<QNSView: 0x7f87f9d06470; QCocoaWindow(0x7f87f98a6c80, window=QWidgetWindow(0x7f87f9af50c0, name="QGLWidgetClassWindow"))>> has active key-value observers (KVO)! These will stop working now that the window is recreated, and will result in exceptions when the observers are removed. Break in QCocoaWindow::recreateWindowIfNeeded to debug.
qt.qpa.window: <QNSWindow: 0x7f87f9c7a310; contentView=<QNSView: 0x7f87f9c79cf0; QCocoaWindow(0x7f87f9c79c40, window=QWidgetWindow(0x7f87f9c763c0, name="QWidgetClassWindow"))>> has active key-value observers (KVO)! These will stop working now that the window is recreated, and will result in exceptions when the observers are removed. Break in QCocoaWindow::recreateWindowIfNeeded to debug.
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/vpype_viewer/qtviewer/viewer.py", line 135, in paintGL
    self.engine.render()
  File "/usr/local/lib/python3.9/site-packages/vpype_viewer/engine.py", line 387, in render
    self._rebuild()
  File "/usr/local/lib/python3.9/site-packages/vpype_viewer/engine.py", line 444, in _rebuild
    LineCollectionPreviewPainter(
  File "/usr/local/lib/python3.9/site-packages/vpype_viewer/_painters.py", line 289, in __init__
    vertices, indices = self._build_buffers(lc)
  File "/usr/local/lib/python3.9/site-packages/vpype_viewer/_painters.py", line 338, in _build_buffers
    np.vstack([vp.as_vector(line).astype("f4") for line in lc]),
  File "<__array_function__ internals>", line 5, in vstack
  File "/usr/local/lib/python3.9/site-packages/numpy/core/shape_base.py", line 283, in vstack
    return _nx.concatenate(arrs, 0)
  File "<__array_function__ internals>", line 5, in concatenate
ValueError: need at least one array to concatenate
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/vpype_viewer/qtviewer/viewer.py", line 135, in paintGL
    self.engine.render()
  File "/usr/local/lib/python3.9/site-packages/vpype_viewer/engine.py", line 387, in render
    self._rebuild()
  File "/usr/local/lib/python3.9/site-packages/vpype_viewer/engine.py", line 444, in _rebuild
    LineCollectionPreviewPainter(
  File "/usr/local/lib/python3.9/site-packages/vpype_viewer/_painters.py", line 289, in __init__
    vertices, indices = self._build_buffers(lc)
  File "/usr/local/lib/python3.9/site-packages/vpype_viewer/_painters.py", line 338, in _build_buffers
    np.vstack([vp.as_vector(line).astype("f4") for line in lc]),
  File "<__array_function__ internals>", line 5, in vstack
  File "/usr/local/lib/python3.9/site-packages/numpy/core/shape_base.py", line 283, in vstack
    return _nx.concatenate(arrs, 0)
  File "<__array_function__ internals>", line 5, in concatenate
ValueError: need at least one array to concatenate
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/vpype_viewer/qtviewer/viewer.py", line 135, in paintGL
    self.engine.render()
  File "/usr/local/lib/python3.9/site-packages/vpype_viewer/engine.py", line 387, in render
    self._rebuild()
  File "/usr/local/lib/python3.9/site-packages/vpype_viewer/engine.py", line 444, in _rebuild
    LineCollectionPreviewPainter(
  File "/usr/local/lib/python3.9/site-packages/vpype_viewer/_painters.py", line 289, in __init__
    vertices, indices = self._build_buffers(lc)
  File "/usr/local/lib/python3.9/site-packages/vpype_viewer/_painters.py", line 338, in _build_buffers
    np.vstack([vp.as_vector(line).astype("f4") for line in lc]),
  File "<__array_function__ internals>", line 5, in vstack
  File "/usr/local/lib/python3.9/site-packages/numpy/core/shape_base.py", line 283, in vstack
    return _nx.concatenate(arrs, 0)
  File "<__array_function__ internals>", line 5, in concatenate
ValueError: need at least one array to concatenate
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/vpype_viewer/qtviewer/viewer.py", line 135, in paintGL
    self.engine.render()
  File "/usr/local/lib/python3.9/site-packages/vpype_viewer/engine.py", line 387, in render
    self._rebuild()
  File "/usr/local/lib/python3.9/site-packages/vpype_viewer/engine.py", line 444, in _rebuild
    LineCollectionPreviewPainter(
  File "/usr/local/lib/python3.9/site-packages/vpype_viewer/_painters.py", line 289, in __init__
    vertices, indices = self._build_buffers(lc)
  File "/usr/local/lib/python3.9/site-packages/vpype_viewer/_painters.py", line 338, in _build_buffers
    np.vstack([vp.as_vector(line).astype("f4") for line in lc]),
  File "<__array_function__ internals>", line 5, in vstack
  File "/usr/local/lib/python3.9/site-packages/numpy/core/shape_base.py", line 283, in vstack
    return _nx.concatenate(arrs, 0)
  File "<__array_function__ internals>", line 5, in concatenate
ValueError: need at least one array to concatenate```

@cbmoore cbmoore changed the title When presented with and empty layer, the viewer fails to show anything When presented with an empty layer, the viewer fails to show anything Nov 17, 2021
@abey79
Copy link
Owner

abey79 commented Nov 17, 2021

If I may, for readability, please use triple back-quote instead of single-quote so that line breaks aren't lost.

@cbmoore
Copy link
Author

cbmoore commented Nov 17, 2021

Ah--much better. thanks!

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 a pull request may close this issue.

2 participants