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

Trying to update Star Grain Preview Widget causes a crash #210

Closed
AstroChuck opened this issue Feb 26, 2023 · 4 comments
Closed

Trying to update Star Grain Preview Widget causes a crash #210

AstroChuck opened this issue Feb 26, 2023 · 4 comments

Comments

@AstroChuck
Copy link
Contributor

Editing the geometry of a star grain causes a crash with the following error:
0.0000 [LOG] Application started at 2023-02-25T17:09:27.724259 0.3590 [LOG] Starting new motor file 0.3590 [LOG] Opening window QLayout: Attempting to add QLayout "" to MotorEditor "motorEditor", which already has a layout 0.4840 [LOG] Window opened 63.5630 [ERR] Traceback (most recent call last): 63.5630 [ERR] File "C:\Users\drago\Documents\GitHub\openMotor\uilib\widgets\grainPreviewWidget.py", line 50, in updateView 63.5630 [ERR] self.ui.tabRegression.cleanup() 63.5630 [ERR] File "C:\Users\drago\Documents\GitHub\openMotor\uilib\widgets\grainPreviewGraph.py", line 41, in cleanup 63.5630 [ERR] self.plot.lines.pop(0) 63.5630 [ERR] AttributeError: 'ArtistList' object has no attribute 'pop' 63.5630 [ERR] 63.5630 [LOG] Application closed due to exception.

Just prior to the crash the file looks like this:
image

Attempting to edit the "Point Width" to 1.1 results in the crash. The value does not matter, as if 1.1 is entered initially, changing it to 1.0 will cause a crash.
This issue occurs both on the fix_tests branch and Release 0.5.0 on Windows (same computer), but not on Release 0.5.0 on Mac

An example of a file that can cause a crash is attached below.

star_crash.ric.txt

@AstroChuck
Copy link
Contributor Author

I've done some more testing and this issue actually impacts all grain preview graphs any time the cleanup function is called (presumably when updating the preview widget).
This issue only occurs on my desktop computer, but crashes both OM 0.5.0 and my development environment. I suspect that my poor dependency hygiene is causing problems here and this is somehow tied to a new version of Matplotlib, although I can't confirm that yet.
Using the method suggested by Matplotlib documentation for interacting with the artist list fixes this problem. Old code included in comments.
for _ in range(0, self.numContours): self.plot.lines[0].remove() #Old Cleanup For Loop #for _ in range(0, self.numContours): #self.plot.lines.pop(0)

@Flavsditz
Copy link

I am not sure if this is still stopping you, but if it is the fix for me was:
On the gainPreviewGraph.py on the cleanup() method I simply substituted this line:

self.plot.lines.pop(0)

with this one:

self.plot.lines[0].remove()

That being said probably fixing the versions in the requirements.txt is a good idea to have more control over these breaking changes

@reilleya
Copy link
Owner

I have this fix and updated+fixed dependency versions on the pyqt6 branch. Want to try it out? I'll merge it if it installs/runs properly for someone else too.

@Flavsditz
Copy link

I have also pushed with my latest PR. Maybe if that one gets merged we are good on this front too.
But otherwise, do merge the pyqt6 branch and it is another step forward for the project 😃

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

3 participants