Skip to content

Instantly share code, notes, and snippets.

View andyfaff's full-sized avatar

Andrew Nelson andyfaff

  • Sydney, Australia
View GitHub Profile
=============================================================================== test session starts ===============================================================================
platform linux -- Python 3.6.2, pytest-3.2.2, py-1.4.34, pluggy-0.4.0
rootdir: /home/anz/software/scipy-master, inifile: pytest.ini
collected 268 items
scipy/io/arff/tests/test_arffread.py ..................
scipy/io/harwell_boeing/tests/test_fortran_format.py ...........
scipy/io/harwell_boeing/tests/test_hb.py ..
scipy/io/matlab/tests/test_byteordercodes.py ..
scipy/io/matlab/tests/test_mio.py .....................................................
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import matplotlib.animation as manimation
def video_generator(objective, chain, fps=5):
# set up the video
FFMpegWriter = manimation.writers['ffmpeg']
@andyfaff
andyfaff / shgo addition.ipynb
Created October 30, 2017 03:59
benchmarking parser
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andyfaff
andyfaff / diff
Created October 30, 2017 04:02
Modifications for benchmarking shgo
diff --git a/benchmarks/benchmarks/optimize.py b/benchmarks/benchmarks/optimize.py
index 6696f7d..3a9abf6 100644
--- a/benchmarks/benchmarks/optimize.py
+++ b/benchmarks/benchmarks/optimize.py
@@ -17,6 +17,8 @@ try:
except ImportError:
pass
+from shgo import shgo
+
@andyfaff
andyfaff / Untitled.md
Created February 6, 2018 22:54
quad + stats.norm

import numpy as np from scipy.stats import norm from scipy.integrate import quad xs = np.linspace(0, 40, 40) [quad(norm.pdf, -np.inf, x)[0] for x in xs] [0.4999999999999999, 0.8474695889892241, 0.9798802563169332, 0.9989542536697613, 0.9999795701700213,

"""
problem.py
"""
import numpy as np
import time
from scipy.interpolate import interp1d
from scipy.optimize import minimize, root
"""
Sample1D class
@andyfaff
andyfaff / PoolVsProcessPoolExecutor.ipynb
Last active September 5, 2018 03:55
PoolVsProcessPoolExecutor
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andyfaff
andyfaff / PoolVsProcessPoolExecutor.ipynb
Created September 5, 2018 05:36
PoolVsProcessPoolExecutor mark 2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andyfaff
andyfaff / pool_coroutine.py
Created September 7, 2018 00:34
Parallel processing pool co-routine
from joblib import Parallel, delayed
class PoolWrapper(object):
def __init__(self, pool=-1):
self.pool = None
self._mapfunc = map
self._own_pool = False
if hasattr(pool, 'map'):
self.pool = pool
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.