Hmm. when I try the no-notebook version I get the following.
aluminum:~ steve$ pypy3 foo.py
Traceback (most recent call last):
File "foo.py", line 1, in <module>
from vpython import *
File "/Users/steve/pypy3-v5.10.0-osx64-2/site-packages/vpython/__init__.py", line 37, in <module>
from .no_notebook import *
File "/Users/steve/pypy3-v5.10.0-osx64-2/site-packages/vpython/no_notebook.py", line 148, in <module>
__server = HTTPServer(('', __HTTP_PORT), serveHTTP)
File "/Users/steve/pypy3-v5.10.0-osx64-2/lib-python/3/socketserver.py", line 440, in __init__
self.server_bind()
File "/Users/steve/pypy3-v5.10.0-osx64-2/lib-python/3/http/server.py", line 138, in server_bind
socketserver.TCPServer.server_bind(self)
File "/Users/steve/pypy3-v5.10.0-osx64-2/lib-python/3/socketserver.py", line 454, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 48] Address already in use
I’m not running any other servers so this seems pypy3 specific. The same python file runs fine in no_notebook mode with cpython (3.6).
Also, the tests I’ve tried with pypy3 in jupyter notebook (with vpython) have worked OK.
I moved the code from Gas.py into a notebook and got:
0.5550979999999996 ms per loop
with the same source, using CPython I get:
5.573568999999999 ms per loop
So it appears to be a 10x improvement. Wow.
When I tried the numpy version I get:
(vsci3) aluminum:~ steve$ python ~/Downloads/GasNumpy.py
Traceback (most recent call last):
File "/Users/steve/Downloads/GasNumpy.py", line 127, in <module>
b = 2*dot(rrel,vrel)
TypeError: Argument 'A' has incorrect type (expected vpython.cyvector.vector, got numpy.ndarray)
Maybe my version of numpy?
>>> numpy.version.full_version
'1.13.3'
-steve