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 hashlib | |
import linecache | |
import time | |
import types | |
def code_name(code): | |
""" Compute a (probably) unique name for code for caching. | |
""" | |
hash_digest = hashlib.md5(code).hexdigest() | |
return '<code %s>' % hash_digest |
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
from IPython.frontend.qt.console.ipython_widget import IPythonWidget | |
from IPython.lib import guisupport | |
from qtkernelmanager import QtKernelManager | |
def main(): | |
app = guisupport.get_app_qt4() | |
km = QtKernelManager() |
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
#include "Python.h" | |
static PyObject * | |
keywdarg_parrot(PyObject *self, PyObject *args, PyObject *keywds) | |
{ | |
PyObject *foo, *bar, *baz; | |
int bat, blah; | |
foo = NULL; |
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
from collections import defaultdict | |
from enable.api import (AbstractOverlay, ColorTrait, | |
Component as EnableComponent, Container as EnableContainer, LineStyle, | |
transparent_color) | |
from kiva.constants import FILL, STROKE | |
from traits.api import (Any, Bool, Float, HasTraits, Instance, List, Property, | |
NO_COMPARE, on_trait_change) | |
from casuarius import medium |
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 | |
# -*- coding: UTF-8 -*- | |
import cPickle | |
import multiprocessing | |
import os | |
import signal | |
import sys | |
import time |
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
""" A plot made up of disconnected line segments. | |
""" | |
import warnings | |
import numpy as np | |
from enthought.chaco.base_xy_plot import BaseXYPlot | |
from enthought.enable.api import black_color_trait, ColorTrait, LineStyle | |
from enthought.traits.api import Float, List, Str, on_trait_change |
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 datetime | |
import numpy as np | |
import pandas | |
dtype = np.dtype([ | |
("Index", object), | |
("Symbol", object), | |
("Year", int), |
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
""" Mixin to make Component classes adhere to the EnamlFactory | |
interface. | |
""" | |
from enaml.core.toolkit import Toolkit | |
from enaml.core.base_component import BaseComponent | |
class NeighborLookupMixin(object): | |
""" Mixin to provide an EnamlFactory interface for BaseComponent |
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
""" | |
Demonstrates chaco performance with large datasets. | |
There are 10 plots with 100,000 points each. Right-click and drag to | |
create a range selection region. The region can be moved around and | |
resized (drag the edges). These interactions are very fast because | |
of the backbuffering built into chaco. | |
Zooming with the mousewheel and the zoombox (as described in simple_line.py) | |
is also available, but panning is not. |
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 | |
""" | |
Draws several overlapping line plots like simple_line.py, but uses a separate | |
Y range for each plot. Also has a second Y-axis on the right hand side. | |
Demonstrates use of the BroadcasterTool. | |
Left-drag pans the plot. | |
Right-click and dragging on the legend allows you to reposition the legend. |
OlderNewer