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

lt_xspec not working due to QApplication error #1774

Open
klaudhub opened this issue Feb 20, 2024 · 1 comment
Open

lt_xspec not working due to QApplication error #1774

klaudhub opened this issue Feb 20, 2024 · 1 comment

Comments

@klaudhub
Copy link

klaudhub commented Feb 20, 2024

Trying to open 1D spectra (pypeit version 1.15.0 installed via pip) with the lt_xspec command raises the following issue:

File "/home/user/anaconda3/envs/pypeit/bin/lt_xspec", line 8, in <module>
    sys.exit(main())
             ^^^^^^
File "/home/user/anaconda3/envs/pypeit/lib/python3.11/site-packages/linetools/scripts/lt_xspec.py", line 84, in main
    width = app.desktop().screenGeometry().width()
            ^^^^^^^^^^^
AttributeError: 'QApplication' object has no attribute 'desktop'

Since QApplication is drawn from qtpy.QtWidgets, the issue might be solved by rolling back from the qtpy version 2.4.1, but I am not entirely sure. Thanks!

@freddavies
Copy link
Collaborator

The solution to the lt_xspec issue seems to be replacing the offending line in linetools/scripts/lt_xspec.py with the new (QT6?) version from pypeit_show_1dspec,

old:
width = app.desktop().screenGeometry().width()
new:
width = app.screens()[0].geometry().width()

Perhaps a small linetools PR?

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

No branches or pull requests

2 participants