Skip to content

Instantly share code, notes, and snippets.

View mattip's full-sized avatar

Matti Picus mattip

  • Quansight Labs
View GitHub Profile
@mattip
mattip / test_memory.py
Created July 14, 2017 08:56
memory "leak" in cpyext
running with "pypy test_memory 10" -> 77 MB retained when using range()
running with "cpython test_memory 10" -> 0.6 MB retained when using range()
############ lambda: a: math.degrees #############
debug-capi:Python C/API function _test_ext_module_5403.t(fun,fun_extra_args=())
debug-capi:int a=:output,hidden,scalar
debug-capi:a=0
debug-capi:fun=>cb_fun_in_t__user__routines:input,required,callback
debug-capi:create_cb_arglist
debug-capi:create_cb_arglist:maxnofargs(-nofoptargs),tot,opt,ext,siz,nofargs=0(-0),1,0,1,1,0
debug-capi:create_cb_arglist-end
debug-capi:Assuming 0 arguments; at most 0(-0) is expected.
debug-capi:for fun=NULL
@mattip
mattip / gist:83304fc4977f8174c227ba9631ffd82a
Last active June 1, 2017 21:44
numpy test failures 26.5.17
$ ../pypy-latest/bin/pypy runtests.py
Building, see build.log...
Build OK
Running unit tests for numpy
NumPy version 1.14.0.dev0+f6822b4
NumPy relaxed strides checking option: True
NumPy is installed in /home/matti/pypy_stuff/numpy/build/testenv/site-packages/numpy
Python version 2.7.13 (5e7bef99e9f5, May 31 2017, 22:00:12)[PyPy 5.9.0-alpha0 with GCC 6.2.0 20160901]
nose version 1.3.7
@mattip
mattip / gist:9b39ded038d3c3f4a344bcb03d675b3b
Last active July 7, 2017 15:04
pandas tests failures 9.7.2017
With pandas HEAD, numpy refactor-updateifcopy, pypy cpyext-add_newdoc:
$(ulimit -v 5000000; p=../pypy-latest/bin/pypy; export PYTHONHASHSEED=$($p -c 'import random; print(random.randint(1, 4294967295))'); $p -mpytest pandas -n 4)
bottom line, four xdist tests in parallel
267 failed, 9087 passed, 1631 skipped, 6 xfailed in 1036.08 seconds
$ grep -a '\(^E *[A-Z][a-zA-Z]*Error:\)\|\(^AssertionError$\)\|\(^E *MemoryError\)' ../test_pandas.txt |cut -c 5- |cut -f1,2 -d: | sed -e's/ */ /' | sort |uniq -c |sort -n -r
58 TypeError: don't know how to convert scalar number to int
54 ValueError: setting an array element with a sequence.
@mattip
mattip / gist:d989b1e21a7432f97ec2011ab0074708
Last active May 12, 2017 06:24
compare test runs win32 to linux
Windows, test run requires __580__ seconds
> python pytest.py rpython\translator\c\test\test_typed.py --duration=10
[platform:msg] Set platform with 'host' cc=None, using cc='cl.exe', version=90
============================= test session starts =============================
platform win32 -- Python 2.7.13, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
pytest-2.9.2 from D:\pypy_stuff\pypy\pytest.pyc
rootdir: D:\pypy_stuff\pypy\rpython, inifile: pytest.ini
plugins: profiling-1.2.6
collected 71 items
@mattip
mattip / fix windows update failure in a VM
Created September 23, 2016 13:03
Need to set exceptions for netowrking in order to enable windows updates after switching a VM's network card
http://www.sevenforums.com/windows-updates-activation/159323-code-8024402f-windows-update.html
@mattip
mattip / gist:32fcd53ca8b44cefe25cb452a40f16d3
Last active July 24, 2017 17:31
run numpy with pyinteractive
UPDATE: this no longer works.
build, install numpy on pypy
copy pkg_resources, numpy-1.*, easy-install.pth from pypy/site-packages to /tmp/numpy
in pypy/module/cpyext/api.py change all 'cpyexttest' to 'PyPy'
then run
python pypy/bin/pyinteractive.py --withmod-struct --withmod-binascii --withmod-zipimport --withmod-_socket --withmod-cpyext --withmod-_cffi_backend --withmod-_rawffi --withmod-signal -c "import sys; sys.path.append('/tmp/numpy'); import numpy as np"
pypy startup is about 35 secs
@mattip
mattip / gist:f6d6c2f26f29f3ec67cb0686bc30a6d8
Last active September 5, 2016 15:09
numpy upstream 90668d0 with pypy 52eb4d9855de, FAILED (KNOWNFAIL=6, SKIP=33, errors=17, failures=14)
$ grep -a 'build/testenv/site-packages/numpy' ../test.out |grep 'test_[a-zA-Z_]*\.py' |cut -f10-12 -d'/' |cut -f1 -d '"' | sort | uniq -c | sort -n -r
7 core/tests/test_multiarray.py
4 core/tests/test_regression.py
3 core/tests/test_records.py
3 core/tests/test_nditer.py
3 core/tests/test_defchararray.py
2 core/tests/test_arrayprint.py
1 tests/test_scripts.py
1 tests/test_ctypeslib.py
1 matrixlib/tests/test_defmatrix.py
@mattip
mattip / gist:0fab727538cfa27f42c6220b84a886e0
Last active May 18, 2016 20:25
upstream numpy after 09e1cffcbf04: Ran 6177 tests FAILED (KNOWNFAIL=12, SKIP=25, errors=141, failures=91)
$ grep -a '\(^[A-Z][a-z][a-zA-Z]*:\)\|\(^AssertionError$\)' test.out |cut -f1,2 -d, | sort |uniq -c |sort -n -r
66 AssertionError:
34 AttributeError: 'module' object has no attribute 'getrefcount'
21 AttributeError: 'method' object has no attribute 'im_func'
17 TypeError: expected a readable buffer object
15 NotImplementedError: settting a slice of a PySequence_Fast is not supported
12 AssertionError
9 TypeError: sys.getsizeof() not implemented on PyPy
6 ValueError: EOF: reading array data, expected 32 bytes got 0
4 UnboundLocalError: local variable 'arr_reloaded' referenced before assignment
@mattip
mattip / gist:05130c84a0e8be73560a
Created March 28, 2016 04:52
setenv.bat for win32 and PyPy
set PATH=d:\pypy_stuff\cpython-release\Scripts;d:\pypy_stuff\local\bin;d:\pypy_stuff\local\tcltk\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;c:\Program Files\TortoiseHg;d:\pypy_stuff\pypy-4.0.1-win32
set INCLUDE=d:\pypy_stuff\local\include;d:\pypy_stuff\local\tcltk\include
set LIBPATH=d:\pypy_stuff\local\lib;d:\pypy_stuff\local\tcltk\lib
set LIB=d:\pypy_stuff\local\lib;d:\pypy_stuff\local\tcltk\lib
set MSRKINECTSDK=
set VS100COMNTOOLS=
set PATHEXT=.COM;.EXE;.BAT;.CMD;.MSC
set PSMODULEPATH=
rem prevent colorama from screwing up the colors
set PY_COLORS=0