This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use-package zenburn-theme | |
:config | |
(setq org-fontify-whole-heading-line t | |
org-fontify-quote-and-verse-blocks t) | |
(load-theme 'zenburn t) | |
(zenburn-with-color-variables | |
(custom-theme-set-faces | |
'zenburn | |
`(org-level-1 ((t (:inherit ,z-variable-pitch | |
:foreground ,zenburn-orange |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl "https://api.github.com/repos/numpy/numpy/pulls?page=1&per_page=100" > prs0.json | |
curl "https://api.github.com/repos/numpy/numpy/pulls?page=2&per_page=100" > prs1.json | |
curl "https://api.github.com/repos/numpy/numpy/pulls?page=3&per_page=100" > prs2.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import subprocess | |
import sys | |
from skimage import io, filters | |
import numpy as np | |
filename = sys.argv[1] | |
base, ext = filename.rsplit('.', 1) | |
outfile = f'{base} cropped.{ext}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
xs = np.linspace(2, 5, 10000) # 10000 samples of x between 2 and 5 | |
ys = np.linspace(1, 2, 10000) # 10000 samples of y between 1 and 2 | |
ix = np.random.randint(0, 10000, size=(10000, 2)) # random index, 2 parameters | |
def my_model(x, y): | |
... # do some magic | |
return 42 # spit out your evaluation of the model for a given x, y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ PYTHONPATH=. pytest --doctest-modules networkx/generators/spectral_graph_forge.py | |
================================================================================ test session starts ================================================================================ | |
platform linux -- Python 3.7.4+, pytest-4.3.1, py-1.8.0, pluggy-0.12.0 | |
Using --randomly-seed=1570776077 | |
rootdir: /home/stefan/src/networkx, inifile: | |
plugins: randomly-2.1.1 | |
collected 1 item | |
networkx/generators/spectral_graph_forge.py s [100%] |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function workon { | |
ENVS=${HOME}/envs | |
TARGET=$ENVS/${1} | |
if [[ -z ${1} || ! -d $TARGET ]]; then | |
echo "Invalid environment. Choose from:" | |
ls $ENVS | |
else | |
unset PYTHONPATH | |
source $TARGET/bin/activate | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@article{Abernathey2017, | |
author = "Abernathey, Ryan and Paul, Kevin and Hamman, Joe and Rocklin, Matthew and Lepore, Chiara and Tippett, Michael and Henderson, Naomi and Seager, Richard and May, Ryan and Del Vento, Davide", | |
title = "{Pangeo NSF Earthcube Proposal}", | |
year = "2017", | |
month = "8", | |
url = "https://figshare.com/articles/Pangeo_NSF_Earthcube_Proposal/5361094", | |
doi = "10.6084/m9.figshare.5361094.v1" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
===================================================================================== FAILURES ====================================================================================== | |
______________________________________________________________________________ test_minor_axis_length _______________________________________________________________________________ | |
def test_minor_axis_length(): | |
length = regionprops(SAMPLE)[0].minor_axis_length | |
# MATLAB has different interpretation of ellipse than found in literature, | |
# here implemented as found in literature | |
> assert_almost_equal(length, 9.739302807263) | |
E AssertionError: | |
E Arrays are not almost equal to 7 decimals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_________________________________________________________________________________ test_convex_image _________________________________________________________________________________ | |
def test_convex_image(): | |
img = regionprops(SAMPLE)[0].convex_image | |
# determined with MATLAB | |
ref = np.array( | |
[[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0], | |
[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0], | |
[0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0], | |
[0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0], |