This file contains hidden or 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 | |
import os | |
from yt.frontends.stream.api import load_uniform_grid | |
from yt.mods import ColorTransferFunction | |
from astropy.io import fits | |
from scipy.ndimage.measurements import label | |
from scipy.ndimage.morphology import binary_opening | |
def thresh(image, lo, hi): |
This file contains hidden or 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
""" | |
This test module exercises the IPython qt import logic using pytest | |
It should be run with PyQt4 and PySide installed, as | |
py.test test_ipython_qt.py --boxed | |
It requires pytest and pytest-xdist | |
""" | |
from subprocess import check_output |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
from subprocess import check_call | |
#remove build directory | |
check_call('rm -rf build'.split()) | |
#compile and capture stdout | |
with open('build.log', 'w') as log: | |
check_call('python setup.py install --user'.split(), stdout=log) | |
log = open('build.log').read().splitlines() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
from PyQt4.QtGui import QApplication, QMainWindow, QDockWidget | |
from PyQt4.QtCore import Qt | |
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg | |
from matplotlib.backends.backend_qt4 import NavigationToolbar2QT | |
from matplotlib.figure import Figure | |
a = QApplication(['']) | |
w = QMainWindow() |
This file contains hidden or 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
"""From the numba examples | |
(https://github.com/numba/numba/blob/master/examples/mandel.py), | |
but tweaked to recalculate on the fly as the viewport changes""" | |
from numba import autojit | |
import numpy as np | |
from pylab import imshow, jet, show, ion | |
import matplotlib.pyplot as plt | |
from matplotlib import rcParams | |
rcParams['image.origin'] = 'lower' |
This file contains hidden or 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
pro writecol, file, c1, c2 | |
openw, lun, file, /get | |
for i = 0, n_elements(c1) - 1, 1 do begin | |
printf, lun, c1[i], c2[i], format='(d, ", ", d)' | |
endfor | |
free_lun, lun | |
end | |
pro generate_j2000_points | |
seed = 42 |
This file contains hidden or 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
from matplotlib import cm | |
import numpy as np | |
from PyQt4.QtGui import QImage, QPixmap, QColor | |
def cmap2pixmap(cmap, steps=50): | |
"""Convert a maplotlib colormap into a QPixmap | |
:param cmap: The colormap to use | |
:type cmap: Matplotlib colormap instance (e.g. matplotlib.cm.gray) |