Skip to content

Instantly share code, notes, and snippets.

View synapticarbors's full-sized avatar

Joshua Adelman synapticarbors

View GitHub Profile
@synapticarbors
synapticarbors / data_structures.pxd
Last active March 18, 2016 15:45
Minimal example demonstrating cython compilation failure
import numpy as np
cimport numpy as np
cdef packed struct xarr_type:
np.float64_t a
np.int64_t b
np.float64_t c
np.int64_t d
cdef packed struct yarr_type:
@synapticarbors
synapticarbors / numba_codegen_from_string.ipynb
Last active February 11, 2016 21:43
Example of numba codegen from string
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@synapticarbors
synapticarbors / numba_jitclass_timings.ipynb
Last active February 9, 2016 19:34
Numba jitclass timings
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@synapticarbors
synapticarbors / app.py
Last active January 5, 2016 16:59
Numba cache error
import numpy as np
import numba as nb
import lib1
@nb.jit(nopython=True)
def fcalc(x):
s = lib1.func(x)
return s * 0.5 - 1.0
@synapticarbors
synapticarbors / numba_pypy_timings.md
Last active June 29, 2023 01:10
Timing of production code using Numba and PyPy

Timing production code using Python, Numba, and PyPy

Software Versions

$ pypy --version
Python 2.7.10 (f3ad1e1e1d62, Aug 28 2015, 09:36:42)
[PyPy 2.6.1 with GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@synapticarbors
synapticarbors / ntrc_test.ipynb
Last active August 29, 2015 14:18
Quick check of contact distances for NtrC
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@synapticarbors
synapticarbors / README
Created April 2, 2015 15:49
Strange Cython error with char arrays of particular length
I ran into a strange cython issue where structs containing members of type char[], were failing when they
were a particular length.
This gist contains a simple example that reproduces the issue:
```
$ python gen_pyx.py
$ python setup.py build_ext --inplace
$ python runtest.py
```
@synapticarbors
synapticarbors / transition_counts_bench.ipynb
Created January 8, 2015 04:59
Benchmarking a revision of the MSMBuilder3 transitions_counts method
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@synapticarbors
synapticarbors / vander_bench.ipynb
Last active August 29, 2015 14:12
Benchmarking Julia implementations of generating Vandermonde matrices vs Numpy
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.