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

[BUG] QTFont Error results in crashed SHARPpy GUI #240

Open
5 tasks done
iancornejo opened this issue Jun 2, 2022 · 4 comments
Open
5 tasks done

[BUG] QTFont Error results in crashed SHARPpy GUI #240

iancornejo opened this issue Jun 2, 2022 · 4 comments

Comments

@iancornejo
Copy link

Before submitting an issue to Github about SHARPpy, please follow the below checklist to ensure that your issue can be resolved quickly.

  • No other issues either open or closed describe what I'm reporting.
  • I have checked to see if my issue has been resolved in a new version of SHARPpy.
  • I have filled out the below information in as much detail as possible using dates, numbers, directions, pictures, etc.
  • I have checked the SHARPpy documentation to make sure I'm doing things correctly, and my problem doesn't exist between my monitor and chair.
  • I have attached the log and config files from the ~/.sharppy folder. If no log files exist, I have run the program in debug mode (e.g., sharppy --debug).

The management team for SHARPpy is a small team of volunteers. Being as thorough as possible with your issue submission will help us help you!

Describe the bug

I am encountering a problem when trying to load in sounding data into the GUI. I've tested this with custom data and with sounding data from http://weather.ou.edu/~dscg1/sounding/. The crash has something to do with qtpy or the configuration of my computer but not certain. I was able to run this approximately one month ago (April 2022) with no problems.

To Reproduce

  1. Open Anaconda Prompt
  2. "Conda Activate sharppy"
  3. "sharppy --debug"
  4. Decline downloading new version (1.4) of sharppy. I already have 1.4 running and am not sure why I'm still getting this error.
  5. See window with map of sounding sites in the US.
  6. Click File and Open.
  7. Select sounding file.
  8. Another blank window opens, then crashes.

Expected behavior
Expectation is to load in the sonde data and display the GUI

Screenshots
image
image

Versioning Information (please complete the following information):

  • Device: Acer Spin 3
  • OS: Windows 11 Home Insider Preview 25126.1000 Windows Feature Experience Pack 1000.25126.1000.0
  • SHARPpy Version: v1.4.0
  • Dependency Versions: See Screenshot
  • Screen dimensions [e.g. 4k, HD, 1920x800]: 1920x1080
  • SHARPpy distribution type [e.g., git, conda, binary]: conda

**

Additional context
I am running conda 4.8.5. I was also able to replicate this problem using miniconda on an Ubuntu 5.10.102.1-microsoft-standard-WSL2 on the same machine. The steps are the same with the exception of opening a Xlauncher to create a window.

@JeauxyPatton
Copy link

I am also experiencing this same issue with a fresh install in a new conda environment. Also running Windows 11, and I'm also getting the error message about updating the v1.4.0 although I have already installed that version. Can't open any soundings from any source and it immediately crashes the program. Thought I was going crazy!

@keltonhalbert
Copy link
Contributor

Hi Ian and Joey, sorry about the issues! Looks like you aren't the only ones, something in Qt isn't behaving nicely with bold fonts. The good news, is that it's an easy fix. The bad news, is that for right now, it requires a manual fix.

If you go to line 277 of sharppy/viz/winter.py, you should see this:

    def drawPrecipType(self, qp):
        big = QtGui.QFont('Helvetica', round(self.hgt * self.font_ratio) + 5, bold=True)

Remove the bold=True argument such that it looks like this:

    def drawPrecipType(self, qp):
        big = QtGui.QFont('Helvetica', round(self.hgt * self.font_ratio) + 5)

Not exactly elegant until we can push the fix to the master branch, but it should work. In your case Ian, the file is located at C:\Users\IanCornejo\anaconda3\envs\sharppy\viz\winter.py

@resmaili
Copy link
Collaborator

resmaili commented Jun 7, 2022

Yeah, agreed, this fixed the issue when I reproduced the error in a Windows 11 WM. I'm working on pushing the changes. In the meantime you can use Kelton's fix. You can also turn off the 'newer version of SHARPpy is available.' by commenting out ln 1208-1219 in python setup.py install in runsharp/full_gui.py.

@iancornejo
Copy link
Author

Thank you both. Adding onto Kelton's response and for future viewers of this thread, you also need to remove "bold = False" in line 288 of winter.py.

From:
small = QtGui.QFont('Helvetica', round(self.hgt * self.font_ratio) -1 , bold = False)

To:
small = QtGui.QFont('Helvetica', round(self.hgt * self.font_ratio) -1)

I'm not sure if this is a related bug or if I should open up a new thread, but when I open up a skew-T on the GUI via anaconda prompt, it's really low resolution making it hard to read some of the text. When I open it on my Ubuntu WSL, it's high resolution but the font is blown up. Not sure if it's due to the configuration of my computer for the anaconda prompt method, the configuration of my VcXsrv when I use my ubuntu WSL, or something within SHARPpy. Here are the same soundings but through different methods.

Anaconda Prompt Method
low_res

Ubuntu WSL method
test

Let me know if I should start a new thread for this issue. I appreciate all the help.

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

4 participants