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 — hard to interpret error in `Frame.show` · Issue #392 · fastplotlib/fastplotlib

hard to interpret error in Frame.show #392

New issue
Copy link
New issue
Copy link
Closed
Closed
hard to interpret error in Frame.show#392
Copy link

Description

@tlambert03
tlambert03
opened on Dec 8, 2023
Issue body actions

Looks like Frame.show tries to infer the environment, but it looks like some of the assumptions/logic it's using is a bit faulty and can result in a NameError:

❯ python examples/desktop/line_collection/line_stack.py
/Users/talley/dev/forks/fastplotlib/fastplotlib/graphics/_features/_base.py:34: UserWarning: converting float64 array to float32
  warn(f"converting {array.dtype} array to float32")
Traceback (most recent call last):
  File "/Users/talley/dev/forks/fastplotlib/examples/desktop/line_collection/line_stack.py", line 27, in <module>
    plot.show(maintain_aspect=False)
  File "/Users/talley/dev/forks/fastplotlib/fastplotlib/layouts/_frame/_frame.py", line 170, in show
    self._output = QOutputContext(
                   ^^^^^^^^^^^^^^
NameError: name 'QOutputContext' is not defined
pip list
anyio                     4.1.0
appnope                   0.1.3
argon2-cffi               23.1.0
argon2-cffi-bindings      21.2.0
arrow                     1.3.0
asttokens                 2.4.1
async-lru                 2.0.4
attrs                     23.1.0
av                        11.0.0
Babel                     2.13.1
beautifulsoup4            4.12.2
black                     23.11.0
bleach                    6.1.0
build                     1.0.3
certifi                   2023.11.17
cffi                      1.16.0
cfgv                      3.4.0
charset-normalizer        3.3.2
check-manifest            0.49
click                     8.1.7
cmap                      0.1.3
comm                      0.2.0
contourpy                 1.2.0
cycler                    0.12.1
debugpy                   1.8.0
decorator                 5.1.1
defusedxml                0.7.1
distlib                   0.3.7
docutils                  0.20.1
executing                 2.0.1
fancycompleter            0.9.1
fastjsonschema            2.19.0
fastplotlib               0.1.0a16   /Users/talley/dev/forks/fastplotlib
filelock                  3.13.1
fonttools                 4.46.0
fqdn                      1.5.1
freetype-py               2.4.0
identify                  2.5.32
idna                      3.6
imageio                   2.33.0
importlib-metadata        6.10.0
iniconfig                 2.0.0
ipykernel                 6.27.1
ipython                   8.18.1
ipywidgets                8.1.1
isoduration               20.11.0
jaraco.classes            3.3.0
jedi                      0.19.1
Jinja2                    3.1.2
joblib                    1.3.2
json5                     0.9.14
jsonpointer               2.4
jsonschema                4.20.0
jsonschema-specifications 2023.11.2
jupyter_client            8.6.0
jupyter_core              5.5.0
jupyter-events            0.9.0
jupyter-lsp               2.2.1
jupyter-rfb               0.4.2
jupyter_server            2.11.1
jupyter_server_terminals  0.4.4
jupyterlab                4.0.9
jupyterlab_pygments       0.3.0
jupyterlab_server         2.25.2
jupyterlab-widgets        3.0.9
keyring                   24.3.0
kiwisolver                1.4.5
markdown-it-py            2.2.0
MarkupSafe                2.1.3
matplotlib                3.8.2
matplotlib-inline         0.1.6
mdurl                     0.1.2
mistune                   3.0.2
more-itertools            10.1.0
mypy                      1.7.1
mypy-extensions           1.0.0
nbclient                  0.6.8
nbconvert                 7.11.0
nbformat                  5.9.2
nbmake                    1.4.6
nest-asyncio              1.5.8
nh3                       0.2.14
nodeenv                   1.8.0
notebook_shim             0.2.3
numpy                     1.26.2
overrides                 7.4.0
packaging                 23.2
pandocfilters             1.5.0
parso                     0.8.3
pathspec                  0.11.2
pdbpp                     0.10.3
pexpect                   4.9.0
Pillow                    10.1.0
pip                       23.3.1
pkginfo                   1.9.6
platformdirs              4.0.0
pluggy                    1.3.0
pre-commit                3.5.0
prometheus-client         0.19.0
prompt-toolkit            3.0.41
psutil                    5.9.6
ptyprocess                0.7.0
pure-eval                 0.2.2
pycparser                 2.21
pygfx                     0.1.17
Pygments                  2.17.2
pylinalg                  0.4.1
pyparsing                 3.1.1
pyproject_hooks           1.0.0
pyrepl                    0.9.0
PySide6                   6.6.0
PySide6-Addons            6.6.0
PySide6-Essentials        6.6.0
pytest                    7.4.3
python-dateutil           2.8.2
python-json-logger        2.0.7
PyYAML                    6.0.1
pyzmq                     25.1.1
readme-renderer           42.0
referencing               0.31.1
requests                  2.31.0
requests-toolbelt         1.0.0
rfc3339-validator         0.1.4
rfc3986                   2.0.0
rfc3986-validator         0.1.1
rich                      13.3.1
rpds-py                   0.13.2
rubicon-objc              0.4.7
ruff                      0.1.6
scikit-learn              1.3.2
scipy                     1.11.4
Send2Trash                1.8.2
setuptools                68.2.2
shiboken6                 6.6.0
sidecar                   0.7.0
simplejpeg                1.7.2
six                       1.16.0
sniffio                   1.3.0
soupsieve                 2.5
stack-data                0.6.3
terminado                 0.18.0
threadpoolctl             3.2.0
tinycss2                  1.2.1
tornado                   6.4
tqdm                      4.66.1
traitlets                 5.14.0
twine                     4.0.2
types-python-dateutil     2.8.19.14
typing_extensions         4.8.0
uharfbuzz                 0.37.3
uri-template              1.3.0
urllib3                   2.1.0
virtualenv                20.25.0
wcwidth                   0.2.12
webcolors                 1.13
webencodings              0.5.1
websocket-client          1.7.0
wgpu                      0.13.0
wheel                     0.42.0
widgetsnbextension        4.0.9
wmctrl                    0.5
zipp                      3.17.0

I can probably figure out what is needed, but one way or another, the code probably shouldn't ever reach that NameError

Activity

  1. tlambert03 commented on Dec 8, 2023

    @tlambert03
    tlambert03
    on Dec 8, 2023
    ContributorAuthor
    More actions

    (using pyqt6 instead of pyside6 solved it... but the error is still confusing)

  2. kushalkolar commented on Dec 12, 2023

    @kushalkolar
    kushalkolar
    on Dec 12, 2023
    Member
    More actions

    Sorry for the late reply, busy time of year! I think the issue is that you tried to force the Qt canvas but pyqt6 was not installed. Right now the %gui qt hook specifically looks for pyqt6, we have plans for pyside etc. support on the roadmap #384

  3. tlambert03 commented on Dec 12, 2023

    @tlambert03
    tlambert03
    on Dec 12, 2023
    ContributorAuthor
    More actions

    What makes you say that? I use the %gui qt magic with pyside all the time.

    I also could get this error simply by running the script outside of ipython.

    But in any case, the issue here is not “add support for pyside”, it’s “ensure that a name error is never encountered, regardless of the user’s environment”

  4. kushalkolar commented on Dec 12, 2023

    @kushalkolar
    kushalkolar
    on Dec 12, 2023
    Member
    More actions

    Yup that hook works with pyside, but fastplotlib doesn't. This is one place where we need to add more than pyqt6: https://github.com/fastplotlib/fastplotlib/blob/main/fastplotlib%2Flayouts%2F_frame%2F_qt_output.py

  5. kushalkolar commented on Apr 1, 2024

    @kushalkolar
    kushalkolar
    on Apr 1, 2024
    Member
    More actions

    this was fixed in #431 , GUI selection mostly done by WGPU now

  6. kushalkolar
    closed this as completedon Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue 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.