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
Pyglet fixes for 1.4 #16513
Pyglet fixes for 1.4 #16513
Conversation
These are mostly issues relating to Python 3 compatibility.
✅ Hi, I am the SymPy bot (v145). I'm here to help you write a release notes entry. Please read the guide on how to write release notes. Your release notes are in good order. Here is what the release notes will look like:
This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.4. Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
Codecov Report
@@ Coverage Diff @@
## 1.4 #16513 +/- ##
==============================================
- Coverage 73.584% 11.014% -62.571%
==============================================
Files 618 618
Lines 158493 158495 +2
Branches 37190 37191 +1
==============================================
- Hits 116626 17457 -99169
- Misses 36430 140347 +103917
+ Partials 5437 691 -4746 |
I was also a bit confused by that. I do not have any good explanation really... |
@@ -521,6 +521,9 @@ def _test(*paths, **kwargs): | |||
split = kwargs.get('split', None) | |||
time_balance = kwargs.get('time_balance', True) | |||
blacklist = kwargs.get('blacklist', ['sympy/integrals/rubi/rubi_tests/tests']) | |||
if ON_TRAVIS: | |||
# pyglet does not work on Travis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a shame.
I don't know what kind of testing you want to have here. I tried from sympy.plotting.pygletplot import PygletPlot
import sympy.plotting.pygletplot.plot_modes
from sympy.abc import x, y
PygletPlot(x*y) and it worked on my Mac. It doesn't work from the normal Python shell but it does work from One issue is that when I close the plot, all keyboard input to the terminal is broken. I have to exit isympy and type I ran |
This doesn't work for me on OSX. I installed pyglet using pip and In [1]: from sympy.plotting.pygletplot import PygletPlot
...: import sympy.plotting.pygletplot.plot_modes
...: from sympy.abc import x, y
...:
...: PygletPlot(x*y)
Out[1]: [0]: x*y, 'mode=cartesian'
In [2]: 2019-04-02 21:03:06.211 Python[3189:14612259] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'nextEventMatchingMask should only be called from the Main Thread!'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff3a03523b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fff612c5c76 objc_exception_throw + 48
2 AppKit 0x00007fff37ce0297 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 4167
3 _ctypes.cpython-37m-darwin.so 0x000000010fcbd3cf ffi_call_unix64 + 79
4 ??? 0x000070001079f760 0x0 + 123145578739552
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6 It seems to do something (the screen switches to the desktop) but it crashes and closes before I see anything. |
I do not know either. Something that pass I guess. :-) More seriously, if I remember correctly I could not figure out how to get it to work on Travis. I do not know how/if the other plotting code is tested, but if it is possible to at least run some commands to make sure that there are no uncaught exceptions etc that may be enough. I've got a new install on my office CentOS7 machine, so maybe the OpenGL stuff works better there now. No time to try it out yet though (although I've noticed that Matlab outputs a text claiming software OpenGL support, so I guess that drivers are lacking as the GTX1050 card I have should support it decently in hardware). |
If you are using the conda Python on OS X make sure to use |
I installed this on my office computer and it worked out of the box without any error messages etc. I would probably recommend putting this into 1.4 as it works on at least some machines (and the previous version didn't work at all). |
Actually I've just tried on Centos and it works for me as well. I do get an exception when trying to close the Window though:
In any case the changes here are a definite improvement. I agree that this should go into 1.4. |
I got that error on my earlier machine as well. It relates to the fact that the pyglet code assumes a three digit OpenGL version number, but your machine/driver only provides a two digit (so 4.5 instead of 4.5.6). A bit annoying, but nothing we can really do anything about except for catching the exception, but there's a risk that one catches other exceptions as well then...). |
I opened an issue at pyglet for this. |
Should this be merged? |
This is the last PR on the 1.4 milestone. As soon as it is merged, I will do another release candidate. Or if we decide to postpone it I can do an rc2 now. |
It should be merged |
I agree. Hence, I merge, |
References to other Issues or PRs
Closes #14748
Closes #15772
Brief description of what is fixed or changed
Fixed some issues with pygletplot so that it is back working (on most/some systems).
Other comments
A PR aimed for the 1.4 release (a version of #15772).
Release Notes