You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(115) |
Aug
(120) |
Sep
(137) |
Oct
(170) |
Nov
(461) |
Dec
(263) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(120) |
Feb
(74) |
Mar
(35) |
Apr
(74) |
May
(245) |
Jun
(356) |
Jul
(240) |
Aug
(115) |
Sep
(78) |
Oct
(225) |
Nov
(98) |
Dec
(271) |
| 2009 |
Jan
(132) |
Feb
(84) |
Mar
(74) |
Apr
(56) |
May
(90) |
Jun
(79) |
Jul
(83) |
Aug
(296) |
Sep
(214) |
Oct
(76) |
Nov
(82) |
Dec
(66) |
| 2010 |
Jan
(46) |
Feb
(58) |
Mar
(51) |
Apr
(77) |
May
(58) |
Jun
(126) |
Jul
(128) |
Aug
(64) |
Sep
(50) |
Oct
(44) |
Nov
(48) |
Dec
(54) |
| 2011 |
Jan
(68) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <jd...@us...> - 2008-10-27 18:05:01
|
Revision: 6337
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6337&view=rev
Author: jdh2358
Date: 2008-10-27 18:04:58 +0000 (Mon, 27 Oct 2008)
Log Message:
-----------
fixed navigation table
Modified Paths:
--------------
trunk/matplotlib/doc/_templates/gallery.html
trunk/matplotlib/doc/api/pyplot_api.rst
trunk/matplotlib/doc/users/navigation_toolbar.rst
Modified: trunk/matplotlib/doc/_templates/gallery.html
===================================================================
--- trunk/matplotlib/doc/_templates/gallery.html 2008-10-26 14:33:36 UTC (rev 6336)
+++ trunk/matplotlib/doc/_templates/gallery.html 2008-10-27 18:04:58 UTC (rev 6337)
@@ -267,6 +267,8 @@
<a href="examples/pylab_examples/hline_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/hline_demo.png" border="0" alt="hline_demo"/></a>
+<a href="examples/pylab_examples/image_clip_path.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_clip_path.png" border="0" alt="image_clip_path"/></a>
+
<a href="examples/pylab_examples/image_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_demo.png" border="0" alt="image_demo"/></a>
<a href="examples/pylab_examples/image_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_demo2.png" border="0" alt="image_demo2"/></a>
Modified: trunk/matplotlib/doc/api/pyplot_api.rst
===================================================================
--- trunk/matplotlib/doc/api/pyplot_api.rst 2008-10-26 14:33:36 UTC (rev 6336)
+++ trunk/matplotlib/doc/api/pyplot_api.rst 2008-10-27 18:04:58 UTC (rev 6337)
@@ -1,8 +1,8 @@
*****************
matplotlib pyplot
*****************
+
-
:mod:`matplotlib.pyplot`
========================
Modified: trunk/matplotlib/doc/users/navigation_toolbar.rst
===================================================================
--- trunk/matplotlib/doc/users/navigation_toolbar.rst 2008-10-26 14:33:36 UTC (rev 6336)
+++ trunk/matplotlib/doc/users/navigation_toolbar.rst 2008-10-27 18:04:58 UTC (rev 6337)
@@ -79,9 +79,9 @@
Navigation Keyboard Shortcuts
-----------------------------
-================================== =====================
+================================== ==============================================
Command Keyboard Shortcut(s)
-================================== =====================
+================================== ==============================================
Home/Reset **h** or **r** or **home**
Back **c** or **left arrow** or **backspace**
Forward **v** or **right arrow**
@@ -89,16 +89,12 @@
Zoom-to-rect **o**
Save **s**
Toggle fullscreen **f**
----------------------------------- ---------------------
-**Pan/Zoom mode only**
-- constrain pan/zoom to x axis hold **x**
-- constrain pan/zoom to y axis hold **y**
-- preserve aspect ratio hold **CONTROL**
----------------------------------- ---------------------
-**In axes only**
-- Toggle grid **g**
-- Toggle y axis scale (log/linear) **l**
-================================== =====================
+Constrain pan/zoom to x axis hold **x**
+Constrain pan/zoom to y axis hold **y**
+Preserve aspect ratio hold **CONTROL**
+Toggle grid **g**
+Toggle y axis scale (log/linear) **l**
+================================== ==============================================
If you are using :mod:`matplotlib.pyplot` the toolbar will be created
automatically for every figure. If you are writing your own user
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-10-26 14:33:46
|
Revision: 6336
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6336&view=rev
Author: jdh2358
Date: 2008-10-26 14:33:36 +0000 (Sun, 26 Oct 2008)
Log Message:
-----------
added glass dots skel
Modified Paths:
--------------
trunk/py4science/examples/glass_dots1.py
trunk/py4science/examples/glass_dots2.py
Added Paths:
-----------
trunk/py4science/examples/glass_dots1_skel.py
Modified: trunk/py4science/examples/glass_dots1.py
===================================================================
--- trunk/py4science/examples/glass_dots1.py 2008-10-25 07:06:53 UTC (rev 6335)
+++ trunk/py4science/examples/glass_dots1.py 2008-10-26 14:33:36 UTC (rev 6336)
@@ -6,10 +6,9 @@
See L. Glass. 'Moire effect from random dots' Nature 223, 578580 (1969).
"""
import cmath
-from numpy import cos, sin, pi, matrix
-import numpy as npy
+import numpy as np
import numpy.linalg as linalg
-from pylab import figure, show
+import matplotlib.pyplot as plt
def myeig(M):
@@ -18,10 +17,16 @@
Solve quadratic:
- lamba^2 - tau*lambda + Delta = 0
+ lamba^2 - tau*lambda +/- Delta = 0
where tau = trace(M) and Delta = Determinant(M)
-
+
+ if M = | a b |
+ | c d |
+
+ the trace is a+d and the determinant is a*d-b*c
+
+ Return value is lambda1, lambda2
"""
a,b = M[0,0], M[0,1]
@@ -32,31 +37,29 @@
lambda1 = (tau + cmath.sqrt(tau**2 - 4*delta))/2.
lambda2 = (tau - cmath.sqrt(tau**2 - 4*delta))/2.
return lambda1, lambda2
-
+
# 2000 random x,y points in the interval[-0.5 ... 0.5]
-X1 = matrix(npy.random.rand(2,2000)
- )-0.5
+X1 = np.random.rand(2,2000)-0.5
-name = 'saddle'
-sx, sy, angle = 1.05, 0.95, 0.
+#name = 'saddle'
+#sx, sy, angle = 1.05, 0.95, 0.
-#name = 'center'
-#sx, sy, angle = 1., 1., 2.5
+name = 'center'
+sx, sy, angle = 1., 1., 2.5
#name= 'stable focus' # spiral
#sx, sy, angle = 0.95, 0.95, 2.5
-theta = angle * pi/180.
+theta = angle * cmath.pi/180.
+S = np.array([[sx, 0],
+ [0, sy]])
-S = matrix([[sx, 0],
- [0, sy]])
+R = np.array([[np.cos(theta), -np.sin(theta)],
+ [np.sin(theta), np.cos(theta)],])
-R = matrix([[cos(theta), -sin(theta)],
- [sin(theta), cos(theta)],])
+M = np.dot(S, R) # rotate then stretch
-M = S*R # rotate then stretch
-
# compute the eigenvalues using numpy linear algebra
vals, vecs = linalg.eig(M)
print 'numpy eigenvalues', vals
@@ -66,17 +69,17 @@
print 'analytic eigenvalues', avals
# transform X1 by the matrix
-X2 = M*X1
+X2 = np.dot(M, X1)
# plot the original x,y as green dots and the transformed x, y as red
# dots
-fig = figure()
+fig = plt.figure()
ax = fig.add_subplot(111)
-x1 = X1[0].flat
-y1 = X1[1].flat
-x2 = X2[0].flat
-y2 = X2[1].flat
+x1 = X1[0]
+y1 = X1[1]
+x2 = X2[0]
+y2 = X2[1]
ax = fig.add_subplot(111)
line1, line2 = ax.plot(x1, y1, 'go', x2, y2, 'ro', markersize=2)
@@ -85,4 +88,4 @@
fig.savefig('glass_dots1.png', dpi=100)
fig.savefig('glass_dots1.eps', dpi=100)
-show()
+plt.show()
Added: trunk/py4science/examples/glass_dots1_skel.py
===================================================================
--- trunk/py4science/examples/glass_dots1_skel.py (rev 0)
+++ trunk/py4science/examples/glass_dots1_skel.py 2008-10-26 14:33:36 UTC (rev 6336)
@@ -0,0 +1,80 @@
+"""
+Moire patterns from random dot fields
+
+http://en.wikipedia.org/wiki/Moir%C3%A9_pattern
+
+See L. Glass. 'Moire effect from random dots' Nature 223, 578580 (1969).
+"""
+import cmath
+import numpy as np
+import numpy.linalg as linalg
+import matplotlib.pyplot as plt
+
+# search for TODO to find the places you need to fix
+TODO = None
+
+def myeig(M):
+ """
+ compute eigen values and eigenvectors analytically
+
+ Solve quadratic:
+
+ lamba^2 - tau*lambda +/- Delta = 0
+
+ where tau = trace(M) and Delta = Determinant(M)
+
+ if M = | a b |
+ | c d |
+
+ the trace is a+d and the determinant is a*d-b*c
+
+ Return value is lambda1, lambda2
+
+ Return value is lambda1, lambda2
+ """
+ # TODO : compute the real values here. 0, 1 is just a place holder
+ return 0, 1
+
+# Generate and shape (2000,2) random x,y points in the
+# interval [-0.5 ... 0.5]
+X1 = TODO
+
+# these are the scaling factor sx, the scaling factor sy, and the
+# rotation angle 0
+name = 'saddle'
+sx, sy, angle = 1.05, 0.95, 0.
+
+# OPTIONAL: try and find other sx, sy, theta for other kinds of nodes:
+# stable node, unstable node, center, spiral, saddle
+
+# convert theta to radians: theta = angle * pi/180
+theta = TODO
+
+# Create a 2D scaling array
+# S = | sx 0 |
+# | 0 sy |
+S = TODO
+
+# create a 2D rotation array
+# R = | cos(theta) -sin(theta) |
+# | sin(theta) cos(theta) |
+R = TODO
+
+# do a matrix multiply M = S x R where x is *matrix* multiplication
+M = TODO
+
+# compute the eigenvalues using numpy linear algebra
+vals, vecs = linalg.eig(M)
+print 'numpy eigenvalues', vals
+
+# compare with the analytic values from myeig
+avals = myeig(M)
+print 'analytic eigenvalues', avals
+
+# transform X1 by the matrix
+# X2 = M x X1 where x is *matrix* multiplication
+X2 = np.dot(M, X1)
+
+# plot the original x,y as green dots and the transformed x, y as red
+# dots
+TODO
Modified: trunk/py4science/examples/glass_dots2.py
===================================================================
--- trunk/py4science/examples/glass_dots2.py 2008-10-25 07:06:53 UTC (rev 6335)
+++ trunk/py4science/examples/glass_dots2.py 2008-10-26 14:33:36 UTC (rev 6336)
@@ -1,4 +1,4 @@
-import numpy as npy
+import numpy as np
import numpy.linalg as linalg
from pylab import figure, show
@@ -12,15 +12,15 @@
self.axes = axes
self.canvas = axes.figure.canvas
self.canvas.mpl_connect('button_press_event', self.press)
- self.canvas.mpl_connect('button_release_event', self.release)
- self.canvas.mpl_connect('motion_notify_event', self.move)
+ self.canvas.mpl_connect('button_release_event', self.release)
+ self.canvas.mpl_connect('motion_notify_event', self.move)
- X1 = self.X1 = npy.matrix(npy.random.rand(2,2000))-0.5
+ X1 = self.X1 = np.random.rand(2,2000)-0.5
- x1 = X1[0].flat
- y1 = X1[1].flat
- x2 = X1[0].flat # no transformation yet
- y2 = X1[1].flat
+ x1 = X1[0]
+ y1 = X1[1]
+ x2 = X1[0] # no transformation yet
+ y2 = X1[1]
self.line1, self.line2 = ax.plot(x1, y1,'go', x2, y2, 'ro', markersize=2)
self.xlast = None
self.ylast = None
@@ -37,37 +37,37 @@
self.xlast = None
self.ylast = None
self.draw()
-
+
def draw(self):
sx, sy, theta = self.sx, self.sy, self.theta
- a = sx*npy.cos(theta)
- b = -sx*npy.sin(theta)
- c = sy*npy.sin(theta)
- d = sy*npy.cos(theta)
- M = npy.matrix([[a,b],[c,d]])
+ a = sx*np.cos(theta)
+ b = -sx*np.sin(theta)
+ c = sy*np.sin(theta)
+ d = sy*np.cos(theta)
+ M = np.array([[a,b],[c,d]])
- X2 = M*self.X1
- x2 = X2[0].flat
- y2 = X2[1].flat
+ X2 = np.dot(M, self.X1)
+ x2 = X2[0]
+ y2 = X2[1]
self.line2.set_data(x2,y2)
self.canvas.draw()
-
+
def move(self, event):
if not event.inaxes: return # not over axes
if self.xlast is None: return # no initial data
if not event.button: return # no button press
-
+
dx = event.xdata - self.xlast
- dy = event.ydata - self.ylast
+ dy = event.ydata - self.ylast
if event.button==1:
self.theta += dx
elif event.button==3:
self.sx += dx
self.sy += dy
-
+
self.title.set_text('sx=%1.2f, sy=%1.2f, theta=%1.2f'%(self.sx, self.sy, self.theta))
self.draw()
self.xlast = event.xdata
@@ -75,9 +75,9 @@
-
-from pylab import subplot, show
-fig = figure()
+
+import matplotlib.pyplot as plt
+fig = plt.figure()
ax = fig.add_subplot(111)
t = Transformer(ax)
-show()
+plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fer...@us...> - 2008-10-25 07:06:55
|
Revision: 6335
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6335&view=rev
Author: fer_perez
Date: 2008-10-25 07:06:53 +0000 (Sat, 25 Oct 2008)
Log Message:
-----------
Updated numpy intro slides
Modified Paths:
--------------
trunk/py4science/talks/numpy_intro.lyx
Modified: trunk/py4science/talks/numpy_intro.lyx
===================================================================
--- trunk/py4science/talks/numpy_intro.lyx 2008-10-25 04:49:37 UTC (rev 6334)
+++ trunk/py4science/talks/numpy_intro.lyx 2008-10-25 07:06:53 UTC (rev 6335)
@@ -618,7 +618,7 @@
\end_deeper
\end_deeper
\begin_layout BeginPlainFrame
-Numerics
+Is it good enough for scientific computing?
\end_layout
\begin_layout AlertBlock
@@ -829,6 +829,52 @@
NumPy: flexible arrays
\end_layout
+\begin_layout Itemize
+Array is a container of objects
+\begin_inset Quotes eld
+\end_inset
+
+of the same kind
+\begin_inset Quotes erd
+\end_inset
+
+:
+\series bold
+\color blue
+homogeneous
+\series default
+\color inherit
+.
+\end_layout
+
+\begin_layout Itemize
+Concept of
+\begin_inset Quotes eld
+\end_inset
+
+kind
+\begin_inset Quotes erd
+\end_inset
+
+ embodied in the data type, or
+\series bold
+\color blue
+dtype
+\series default
+\color inherit
+.
+\end_layout
+
+\begin_layout Itemize
+Dtypes
+\series bold
+\color blue
+can be user-defined
+\series default
+\color inherit
+ to be arbitrarily complex.
+\end_layout
+
\begin_layout Standard
\align center
\begin_inset Graphics
@@ -842,7 +888,8 @@
\end_layout
\begin_layout Standard
-Foo
+Image credit: T.
+ Oliphant, Enthought Inc.
\end_layout
\begin_layout BeginPlainFrame
@@ -860,59 +907,214 @@
filename fig/numpy_indexing.pdf
lyxscale 50
height 85pheight%
- BoundingBox 0bp 300bp 900bp 768bp
+ BoundingBox 0bp 300bp 1000bp 768bp
\end_inset
\end_layout
-\begin_layout Standard
-Foo
-\end_layout
-
\begin_layout BeginPlainFrame
NumPy: fancy indexing
\end_layout
\begin_layout Standard
+Image credit: E.
+ Jones, Enthought Inc.
+\end_layout
+
+\begin_layout Standard
\align center
\begin_inset Graphics
filename fig/numpy_fancy_indexing.pdf
lyxscale 50
height 85pheight%
- BoundingBox -4bp -4bp 518bp 588bp
+ BoundingBox 0bp 300bp 1024bp 768bp
\end_inset
\end_layout
-\begin_layout Standard
-f
-\end_layout
-
\begin_layout BeginPlainFrame
NumPy: broadcasting
\end_layout
\begin_layout Standard
+Image credit: E.
+ Jones, Enthought Inc.
+\end_layout
+
+\begin_layout Standard
\align center
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+vspace*{-5mm}
+\end_layout
+
+\end_inset
+
+
\begin_inset Graphics
filename fig/numpy_broadcasting.pdf
lyxscale 50
height 85pheight%
- BoundingBox -4bp -4bp 518bp 588bp
+ BoundingBox 0bp 140bp 1024bp 768bp
\end_inset
\end_layout
-\begin_layout Standard
-b
+\begin_layout BeginPlainFrame
+SciPy: numerical algorithms galore
\end_layout
+\begin_layout Itemize
+
+\series bold
+\color blue
+linalg
+\series default
+\color inherit
+ : Linear algebra routines (including BLAS/LAPACK)
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\color blue
+sparse
+\series default
+\color inherit
+ : Sparse Matrices (including UMFPACK, ARPACK,...)
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\color blue
+fftpack
+\series default
+\color inherit
+ : Discrete Fourier Transform algorithms
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\color blue
+cluster
+\series default
+\color inherit
+ : Vector Quantization / Kmeans
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\color blue
+odr
+\series default
+\color inherit
+ : Orthogonal Distance Regression
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\color blue
+special
+\series default
+\color inherit
+ : Special Functions (Airy, Bessel, etc).
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\color blue
+stats
+\series default
+\color inherit
+ : Statistical Functions
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\color blue
+optimize
+\series default
+\color inherit
+ : Optimization Tools
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\color blue
+maxentropy
+\series default
+\color inherit
+ : Routines for fitting maximum entropy models
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\color blue
+integrate
+\series default
+\color inherit
+ : Numerical Integration routines
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\color blue
+ndimage
+\series default
+\color inherit
+ : n-dimensional image package
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\color blue
+interpolate
+\series default
+\color inherit
+ : Interpolation Tools
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\color blue
+signal
+\series default
+\color inherit
+ : Signal Processing Tools
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\color blue
+io
+\series default
+\color inherit
+ : Data input and output
+\end_layout
+
\begin_layout EndFrame
\end_layout
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fer...@us...> - 2008-10-25 04:49:40
|
Revision: 6334
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6334&view=rev
Author: fer_perez
Date: 2008-10-25 04:49:37 +0000 (Sat, 25 Oct 2008)
Log Message:
-----------
Updates to intro talk
Modified Paths:
--------------
trunk/py4science/talks/0810_claremont.lyx
trunk/py4science/talks/fig/hello_world.png
Modified: trunk/py4science/talks/0810_claremont.lyx
===================================================================
--- trunk/py4science/talks/0810_claremont.lyx 2008-10-25 04:29:53 UTC (rev 6333)
+++ trunk/py4science/talks/0810_claremont.lyx 2008-10-25 04:49:37 UTC (rev 6334)
@@ -65,6 +65,8 @@
% call, which confuses xcolor. I'm defining 'none' to be black here.
\definecolor{none}{cmyk}{0,0,0,1}
%%%%% /HACK %%%%%
+
+\usepackage{url}
\end_preamble
\options compress
\language english
@@ -591,6 +593,32 @@
, not replace them!
\end_layout
+\begin_layout BeginPlainFrame
+Hello World
+\end_layout
+
+\begin_layout Standard
+Ref:
+\begin_inset LatexCommand htmlurl
+target "http://www.roesler-ac.de/wolfram/hello.htm"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/hello_world.png
+ lyxscale 50
+ width 95text%
+
+\end_inset
+
+
+\end_layout
+
\begin_layout BeginFrame
Complementary high level tools
\end_layout
Modified: trunk/py4science/talks/fig/hello_world.png
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fer...@us...> - 2008-10-25 04:29:59
|
Revision: 6333
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6333&view=rev
Author: fer_perez
Date: 2008-10-25 04:29:53 +0000 (Sat, 25 Oct 2008)
Log Message:
-----------
retyring basemap commit
Added Paths:
-----------
trunk/py4science/talks/0810_claremont.lyx
trunk/py4science/talks/basemap_tutorial.ppt
trunk/py4science/talks/fig/basemap/
trunk/py4science/talks/fig/basemap/01.png
trunk/py4science/talks/fig/basemap/02.png
trunk/py4science/talks/fig/basemap/03.png
trunk/py4science/talks/fig/basemap/04.png
trunk/py4science/talks/fig/basemap/05.png
trunk/py4science/talks/fig/basemap/06.png
trunk/py4science/talks/fig/basemap/07.png
trunk/py4science/talks/fig/basemap/08.png
trunk/py4science/talks/fig/basemap/09.png
trunk/py4science/talks/fig/basemap/10.png
trunk/py4science/talks/fig/basemap/11.png
trunk/py4science/talks/fig/basemap/12.png
trunk/py4science/talks/fig/basemap/13.png
trunk/py4science/talks/fig/basemap/14.png
trunk/py4science/talks/fig/basemap/15.png
trunk/py4science/talks/fig/basemap/16.png
trunk/py4science/talks/fig/basemap/17.png
trunk/py4science/talks/fig/basemap/18.png
trunk/py4science/talks/fig/basemap/19.png
trunk/py4science/talks/fig/basemap/nplea_tissot.tiff
trunk/py4science/talks/fig/basemap/ortho.png
trunk/py4science/talks/fig/basemap/stere_tissot.tiff
trunk/py4science/talks/fig/dtype.png
trunk/py4science/talks/fig/numpy_broadcasting.pdf
trunk/py4science/talks/fig/numpy_broadcasting.svg
trunk/py4science/talks/fig/numpy_fancy_indexing.pdf
trunk/py4science/talks/fig/numpy_fancy_indexing.svg
trunk/py4science/talks/fig/numpy_indexing.pdf
trunk/py4science/talks/fig/numpy_indexing.svg
trunk/py4science/talks/numpy_intro.lyx
Added: trunk/py4science/talks/0810_claremont.lyx
===================================================================
--- trunk/py4science/talks/0810_claremont.lyx (rev 0)
+++ trunk/py4science/talks/0810_claremont.lyx 2008-10-25 04:29:53 UTC (rev 6333)
@@ -0,0 +1,2147 @@
+#LyX 1.5.5 created this file. For more info see http://www.lyx.org/
+\lyxformat 276
+\begin_document
+\begin_header
+\textclass beamer
+\begin_preamble
+% Include only certain frames - this speeds up compilation
+% The frames to be included need to be labeled, by using ERT
+% as [label=LABELNAME] (no backslashes or {})
+%\includeonlyframes{currentt}
+
+% To make a printable handout (one page per frame), pass
+% the handout option to the doc class (Layout menu)
+
+% For good fonts in PDFs, use pslatex fonts (Layout menu)
+
+% Colors and symbols
+\usepackage{latexsym}
+\usepackage{color}
+
+% Display covered items in transparent form (as opposed
+% to not showing them at all)
+\newcommand{\coveredinvisible}{
+ \setbeamercovered{invisible}
+}
+\newcommand{\coveredvisible}{
+ \setbeamercovered{highly dynamic}
+}
+
+% Choose default setting here:
+\coveredvisible
+
+\newcommand{\ps}{\vspace{-4mm} }
+
+% Theme configuration. I've basically built a custom theme out of
+% Warsaw, adding infoline and changing the nav. symbol bar
+
+% Warning: the commands below are order-sensitive!
+
+% load the infolines theme, b/c I want the headline Warsaw
+% uses (split), but the footline from infolines.
+% In the document body, these will be deactivated for the title and
+% turned on later
+\useoutertheme{infolines}
+% Main theme
+\usetheme{Warsaw}
+% Adjust the color for the center (title) box to be that of
+% infolines, which Warsaw changes
+\setbeamercolor*{title in head/foot}{parent=palette secondary}
+
+% Define a minimal set of navigation symbols
+\defbeamertemplate*{navigation symbols}{minmal}
+{%
+ \hbox{%
+ \hbox{\insertframenavigationsymbol}
+ \hbox{\insertdocnavigationsymbol}
+ \hbox{\insertbackfindforwardnavigationsymbol}%
+ }%
+}
+% activate the minimal navbar
+\setbeamertemplate{navigation symbols}[minimal]
+
+%%%%% HACK %%%%%
+% I started getting errors because LyX is emmitting a color 'none'
+% call, which confuses xcolor. I'm defining 'none' to be black here.
+\definecolor{none}{cmyk}{0,0,0,1}
+%%%%% /HACK %%%%%
+\end_preamble
+\options compress
+\language english
+\inputencoding auto
+\font_roman times
+\font_sans helvet
+\font_typewriter courier
+\font_default_family default
+\font_sc false
+\font_osf false
+\font_sf_scale 100
+\font_tt_scale 100
+\graphics default
+\paperfontsize default
+\spacing single
+\papersize default
+\use_geometry false
+\use_amsmath 2
+\use_esint 0
+\cite_engine basic
+\use_bibtopic false
+\paperorientation landscape
+\secnumdepth 2
+\tocdepth 2
+\paragraph_separation indent
+\defskip medskip
+\quotes_language english
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tracking_changes false
+\output_changes false
+\author ""
+\author ""
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Standard
+Some things to fix in a future version:
+\end_layout
+
+\begin_layout Standard
+- trim a bit of time
+\end_layout
+
+\begin_layout Standard
+- add more about ipython and my own python work, reduce that of others
+\end_layout
+
+\begin_layout Standard
+- add a final python pros/cons, esp.
+ the cons part.
+ It will make things more balanced.
+\end_layout
+
+\begin_layout Standard
+- the PDE part repeats a bit the 'python benefits' which were already pounded
+ on.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+% disable the bottom bar for the title and outline pages
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+
+\backslash
+setbeamertemplate{footline}{}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+vspace*{-5mm}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Title
+Python in Scientific Computing
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+Python & Scientific Computing
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subtitle
+An Introduction
+\end_layout
+
+\begin_layout Author
+Fernando\InsetSpace ~
+Pérez
+\newline
+
+\family typewriter
+\size scriptsize
+<Fer...@be...>
+\family default
+\size default
+
+\newline
+John Hunter
+\newline
+
+\family typewriter
+\size scriptsize
+<jd...@gm...>
+\family default
+\size default
+
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+FP/JDH
+\begin_inset Note Note
+status collapsed
+
+\begin_layout Standard
+This is used by the 'split' footline theme on the left side of the page
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+vspace{5mm}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Institute
+Neuroscience, UC Berkeley
+\newline
+Tradelink
+\begin_inset Note Note
+status open
+
+\begin_layout Standard
+- Use the
+\backslash
+inst command only if there are several affiliations.
+\end_layout
+
+\begin_layout Standard
+- Keep it simple, no one is interested in your street address.
+\end_layout
+
+\end_inset
+
+
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+UC Berkeley/Tradelink
+\begin_inset Note Note
+status open
+
+\begin_layout Standard
+optional, but mostly needed
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+vspace{5mm}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Date
+Joint Sciences Division, Claremont, CA
+\newline
+Oct 25, 2008
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+Claremont, 10/25/08
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Standard
+If you have a file called "institution-logo-filename.xxx", where xxx is a
+ graphic format that can be processed by latex or pdflatex, resp., then you
+ can add a logo by uncommenting the following:
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+%
+\backslash
+pgfdeclareimage[height=0.5cm]{institution-logo}{institution-logo-filename}
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+%
+\backslash
+logo{
+\backslash
+pgfuseimage{institution-logo}}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Standard
+The following causes the table of contents to be shown at the beginning
+ of every Section.
+ Delete this, if you do not want it.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+AtBeginSection[]{
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+
+\backslash
+frame<beamer>{
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+
+\backslash
+frametitle{Outline}
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+
+\backslash
+tableofcontents[currentsection]
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+}
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Standard
+If you wish to uncover everything in a step-wise fashion, uncomment the
+ following command:
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+%
+\backslash
+beamerdefaultoverlayspecification{<+->}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+% reactivate the footline
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+
+\backslash
+setbeamertemplate{footline}[infolines theme]
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginFrame
+Outline
+\end_layout
+
+\begin_layout Standard
+\begin_inset LatexCommand tableofcontents
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Scientific Computing
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+SciComp
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Existing tools
+\end_layout
+
+\begin_layout BeginFrame
+Pure Fortran, C and C++
+\end_layout
+
+\begin_layout Itemize
+Tools optimized for the CPU, not the developer.
+\end_layout
+
+\begin_layout Itemize
+Low-level (data types and libraries).
+\end_layout
+
+\begin_layout Itemize
+Difficult access to visualization, quick profiling, text processing,
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+ldots
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+No interactive facilities.
+\end_layout
+
+\begin_layout Standard
+
+\series bold
+\color blue
+However!
+\end_layout
+
+\begin_layout Itemize
+They deliver excellent performance.
+\end_layout
+
+\begin_layout Itemize
+Millions of LOC in proven scientific codes.
+
+\end_layout
+
+\begin_layout Itemize
+We need to
+\emph on
+\color blue
+work with these tools
+\emph default
+\color inherit
+, not replace them!
+\end_layout
+
+\begin_layout BeginFrame
+Complementary high level tools
+\end_layout
+
+\begin_layout Itemize
+Mathematica, Maple, Matlab, IDL: extremely popular, for good reasons.
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+Interactivity, visualization, extensive libraries.
+\end_layout
+
+\begin_layout Itemize
+Unpleasant for large-scale programs and non-mathematical tasks.
+\end_layout
+
+\begin_layout Itemize
+Expensive, proprietary: lock-in.
+\end_layout
+
+\end_deeper
+\begin_layout Itemize
+Another common approach: the `command pipeline'
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+FORTRAN, C, C++ programs ...
+\end_layout
+
+\begin_layout Itemize
+driven by Bash/awk/sed/Perl scripts ...
+\end_layout
+
+\begin_layout Itemize
+which feed them input and send the output ...
+\end_layout
+
+\begin_layout Itemize
+to visualization/analysis programs.
+\end_layout
+
+\end_deeper
+\begin_layout Subsection
+Python?
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+Python
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginFrame
+Python in this context
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+Free
+\color none
+ (BSD license), highly portable (Linux, OSX, Windows, lots...).
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+Interactive
+\color none
+ interpreter provided.
+\end_layout
+
+\begin_layout Itemize
+Extremely readable syntax (
+\color blue
+
+\begin_inset Quotes eld
+\end_inset
+
+executable pseudo-code
+\begin_inset Quotes erd
+\end_inset
+
+
+\color none
+).
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+Simple
+\color none
+: non-professional programmers can use it effectively.
+\end_layout
+
+\begin_layout Itemize
+Clean object oriented model, but
+\color none
+
+\color blue
+not mandatory
+\color none
+.
+\end_layout
+
+\begin_layout Itemize
+Rich built-in types: lists, sets, dictionaries (hash tables), strings, ...
+\end_layout
+
+\begin_layout Itemize
+Very comprehensive standard library (
+\color blue
+batteries included
+\color none
+)
+\end_layout
+
+\begin_layout Itemize
+Standard libraries for IDL/Matlab-like arrays (NumPy)
+\end_layout
+
+\begin_layout Itemize
+Easy to wrap existing C, C++ and FORTRAN codes.
+\end_layout
+
+\begin_layout Section
+Interlude: Python in the real world
+\begin_inset OptArg
+status collapsed
+
+\begin_layout Standard
+Examples
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+EEG analysis for epilepsy
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+EEG
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+Data analysis for epilepsy surgery
+\end_layout
+
+\begin_layout FrameSubtitle
+Isolating the origin of drug-resistant epileptic seizures which require
+ surgery.
+\end_layout
+
+\begin_layout Standard
+John Hunter, Department of Pediatric Neurology, University of Chicago.
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/mpl_brain1.png
+ lyxscale 50
+ width 80text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+Electrode location in 3D, combined with MRI data
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/mpl_brain3.png
+ lyxscale 50
+ width 90text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+Correlation analysis of seizure data
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/mpl_brain4.png
+ lyxscale 50
+ width 90text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+Final location of epileptic foci for surgery
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/mpl_brain5.png
+ lyxscale 50
+ width 90text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Multiwavelets for PDEs
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+PDEs
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginFrame
+Adaptive, multiwavelet algorithms for integral operators
+\end_layout
+
+\begin_layout Standard
+Gregory Beylkin, Vani Cheruvu, Fernando Perez.
+ Applied Math, U.
+ of Colorado at Boulder.
+\end_layout
+
+\begin_layout Itemize
+Fast application of integral kernels.
+ (Partial Differential Equations)
+\end_layout
+
+\begin_layout Itemize
+Implementation went from 1 to 3 dimensions directly (
+\emph on
+extremely
+\emph default
+ unusual).
+\end_layout
+
+\begin_layout Itemize
+Very complex algorithm that goes beyond pure numerics.
+\end_layout
+
+\begin_layout Itemize
+Very good performance, thanks to NumPy, F2PY and weave.
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/rho_2d_surf.png
+ lyxscale 80
+ width 35text%
+
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+hspace{1cm}
+\end_layout
+
+\end_inset
+
+
+\begin_inset Graphics
+ filename fig/rho_2d_skel.eps
+ lyxscale 80
+ width 25text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+JPL: Mars mission data visualization
+\begin_inset OptArg
+status collapsed
+
+\begin_layout Standard
+JPL - Mars
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+JPL: Mars mission trajectory design and nav data
+\end_layout
+
+\begin_layout FrameSubtitle
+Ted Drain and Lynn Craig, Jet Propulsion Laboratory (NASA/Caltech)
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size footnotesize
+From: Name Elided <nam...@jp...>
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size footnotesize
+Date: Oct 2, 2007 7:15 PM
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size footnotesize
+Subject: Fwd: matplotlib bug numbers
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size footnotesize
+To: John Hunter <jd...@gm...>
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+vspace{5mm}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size tiny
+One of my lead developers mentioned that they had sent a bug to you about
+ the annotations feature of MatPlotLib.
+ Would you be able to let me know what the timeline is to resolve that bug?
+ The reason is that
+\series bold
+\color red
+the feature is needed for the Phoenix project and their arrival at Mars
+ will be in March sometime
+\series default
+\color inherit
+, but they are doing their testing in the coming few months.
+ This annotation feature is used on reports that present the analysis of
+ the trajectory to the navigation team and it shows up on our schedule.
+
+\series bold
+\color red
+It would really help me to know approximately when it could be resolved.
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size tiny
+B-plane plots are used to show the trajectory of a spacecraft with respect
+ to the target body (specifically perpendicular to the incoming asymptote
+ of the spacecraft trajectory) and we plot them with the y-axis inverted.
+ The plot is used heavily in flight operations so it is important to our
+ customers.
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size tiny
+In addition, we have what is called a thundering heard plot where many different
+ trajectory solutions (determined from different measurement sources) are
+ plotted together.
+ The annotations are import there so we can see which plot corresponds to
+ each source of data.
+ I hope it helps to know how your code will be used in spacecraft navigation.
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size tiny
+Thanks for all your efforts.
+\end_layout
+
+\begin_layout BeginPlainFrame
+JPL: Mars mission data visualization
+\end_layout
+
+\begin_layout Standard
+Expected communication power levels between an orbiting spacecraft and a
+ lander as it goes through the atmosphere:
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/jpl_lander_comm_power.png
+ lyxscale 25
+ width 90text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+JPL: Mars mission data visualization (2)
+\end_layout
+
+\begin_layout Standard
+Summary of the current navigation team activities and modelling (data used,
+ event times etc):
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+vspace{-3mm}
+\end_layout
+
+\end_inset
+
+
+\begin_inset Graphics
+ filename fig/jpl_nav_summary.png
+ lyxscale 50
+ width 90text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+PMV: structural bioinformatics
+\begin_inset OptArg
+status collapsed
+
+\begin_layout Standard
+PMV
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+PMV: the Python Molecule Viewer
+\end_layout
+
+\begin_layout FrameSubtitle
+Michel F.
+ Sanner, Molecular Biology Department, The Scripps Research Institute.
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/pmv.png
+ lyxscale 50
+ width 100text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+MayaVi: customizable data visualization
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+MayaVi
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginFrame
+MayaVi: sophisticated data visualization
+\end_layout
+
+\begin_layout Itemize
+Free, easy to use scientific data visualizer.
+\end_layout
+
+\begin_layout Itemize
+Heavy lifting of OpenGL-based rendering: VTK (a C++ library).
+\end_layout
+
+\begin_layout Itemize
+A very good example of how to properly use Python:
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+MayaVi is a standalone GUI program...
+\end_layout
+
+\begin_layout Itemize
+but also a Python library callable by any other Python program.
+\end_layout
+
+\begin_layout Itemize
+Python: very easy to modify, even by adding at runtime user-defined modules
+ which populate the GUI automatically.
+\end_layout
+
+\begin_layout Itemize
+C++: excellent rendering performance, fully hardware-accelerated OpenGL.
+\end_layout
+
+\end_deeper
+\begin_layout Standard
+
+\series bold
+\color blue
+The punchline:
+\series default
+\color none
+ fully programmable visualization, with builtin access to all kinds of numerical
+ (and other) libraries from within the viz tool.
+\end_layout
+
+\begin_layout BeginPlainFrame
+FluidLab: a MayaVi based CFD visualization tool
+\end_layout
+
+\begin_layout Standard
+K.
+ Julien, P.
+ Schmitt (now NCAR), B.
+ Barrow, F.
+ Pérez (App.
+ Math, CU).
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/Fluidlab5.png
+ lyxscale 50
+ width 90text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+Volumetric rendering with FluidLab
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/Fluidlab6.png
+ lyxscale 50
+ width 90text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+SAGE: System for Algebra and Geometry Experimentation
+\begin_inset OptArg
+status collapsed
+
+\begin_layout Standard
+SAGE
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+SAGE: open source mathematics
+\end_layout
+
+\begin_layout FrameSubtitle
+Winner of the 2007 Trophés du Libre, scientific software category
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/sage_notebook-medium.jpg
+ lyxscale 50
+ width 90text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+IPython
+\end_layout
+
+\begin_layout BeginFrame
+IPython
+\end_layout
+
+\begin_layout FrameSubtitle
+Extensible interactive environment with parallel computing support
+\end_layout
+
+\begin_layout Enumerate
+
+\color blue
+A better Python shell
+\color none
+: object introspection, system access, 'magic' command system for adding
+ functionality when working interactively,
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+ldots
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+
+\color blue
+An embeddable interpreter
+\color none
+: useful for debugging and for mixing batch-processing with interactive
+ work.
+\end_layout
+
+\begin_layout Enumerate
+
+\color blue
+A flexible component
+\color none
+: you can use it as the base environment for other systems with Python as
+ the underlying language.
+ It is very configurable in this direction.
+\end_layout
+
+\begin_layout Enumerate
+
+\color blue
+A system for interactive control of distributed/parallel computing systems.
+
+\color none
+
+\end_layout
+
+\begin_layout Enumerate
+
+\color blue
+An interactive component
+\color none
+ we can plug into GUIs, browser-based shells, etc.
+\end_layout
+
+\begin_layout BeginPlainFrame
+IPython: Matlab/IDL-like interactive use
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/pylab-screen.png
+ lyxscale 30
+ width 90text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+IPython: interactive control of VTK visualizations
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/mlab-screen-black.png
+ lyxscale 50
+ width 90text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginFrame
+Distributed/parallel computing
+\end_layout
+
+\begin_layout Standard
+Work with Brian Granger (Cal State San Luis Obispo) and Min Ragan-Kelley
+ (U.
+ C.
+ Berkeley).
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/ipython_parallel.png
+ lyxscale 50
+ width 80text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+High-level graphical control of parallel codes
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/vision_beam_pattern.png
+ lyxscale 50
+ width 80text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Others
+\end_layout
+
+\begin_layout BeginFrame
+Who else?
+\end_layout
+
+\begin_layout Standard
+
+\series bold
+Academia
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+PyRAF:
+\color none
+ Astronomical data analysis (Hubble Space Telescope).
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+PyTrilinos:
+\color none
+ Parallel solvers (Sandia National Lab's ).
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+DANSE:
+\color none
+ Spallation Neutron Source (ORNL/Caltech).
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+CDAT
+\color none
+: Climate Data Analysis Tools (Lawrence Livermore).
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+OOF2
+\color none
+: Finite Element Analysis of Microstructures (NIST).
+\end_layout
+
+\begin_layout Standard
+
+\series bold
+Industry
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+InteractiveSupercomputing.com:
+\color none
+ Python interface to their proprietary backend.
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+Numenta:
+\color none
+ pattern recognition algorithms (Jeff Hawkins-Palm)
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+Google/YouTube:
+\color none
+ Internally, new AppEngine web service platform.
+\end_layout
+
+\begin_layout Standard
+
+\series bold
+\color blue
+Lots
+\series default
+\color inherit
+ more
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+\begin_inset LatexCommand htmlurl
+target "http://www.scipy.org/Topical_Software"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Development in Python
+\begin_inset OptArg
+status collapsed
+
+\begin_layout Standard
+Development\InsetSpace ~
+Model
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+Python is a general programming language
+\end_layout
+
+\begin_layout ExampleBlock
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+{
+\end_layout
+
+\end_inset
+
+
+\series bold
+It's not a bug, it's a feature
+\series default
+!
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+Get others to develop the non-scientific tools you may need.
+\end_layout
+
+\begin_layout Itemize
+Networking, text processing, XML parsing, databases, etc
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+ldots
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+Integrated support for automated testing.
+\end_layout
+
+\begin_layout Itemize
+Excellent documentation tools
+\end_layout
+
+\begin_layout Itemize
+Supports all major GUI toolkits.
+\end_layout
+
+\end_deeper
+\begin_layout Separator
+
+\end_layout
+
+\begin_layout AlertBlock
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+{There are still rough edges - but we're working on these}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+Installation, deployment: harder than needed.
+\end_layout
+
+\begin_layout Itemize
+No good, single-point of entry environment (but see Sage)
+\end_layout
+
+\begin_layout Itemize
+Documentation too scattered.
+\end_layout
+
+\begin_layout Itemize
+Your favorite/critical tool may well not exist
+\series bold
+yet
+\series default
+.
+\end_layout
+
+\begin_layout Itemize
+Funding agency support for infrastructure work is difficult to get.
+\end_layout
+
+\end_deeper
+\begin_layout BeginFrame
+Using your codes from today with Python
+\end_layout
+
+\begin_layout Itemize
+Code too monolithic but with good core pieces?
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+Break into a
+\color blue
+library core
+\color inherit
+ and control layers.
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+Wrap
+\color inherit
+ the libraries and expose them to Python.
+\end_layout
+
+\begin_layout Itemize
+Use Python for control or use
+\color blue
+interactively
+\color inherit
+.
+\end_layout
+
+\end_deeper
+\begin_layout Itemize
+For existing libraries in C/C++/Fortran
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+Provide Python
+\color blue
+bindings
+\color inherit
+ for them.
+\end_layout
+
+\begin_layout Itemize
+It will make it much easier for others to test/use them.
+\end_layout
+
+\begin_layout Itemize
+The network economy benefits all.
+ In this case,
+\color blue
+
+\begin_inset Formula $O(n^{2})$
+\end_inset
+
+ is good!
+\end_layout
+
+\end_deeper
+\begin_layout BeginFrame
+Writing a new code?
+\end_layout
+
+\begin_layout Itemize
+Avoid whole programs in C/Fortran:
+\color none
+
+\color red
+you are optimizing globally!
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+Prototype the problem in Python (get the algorithm right first)
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+using fast libraries.
+\end_layout
+
+\end_deeper
+\begin_layout Itemize
+
+\color blue
+Profile
+\color none
+the hotspots.
+\end_layout
+
+\begin_layout Itemize
+Optimize
+\color none
+
+\color blue
+only those
+\color inherit
+, if needed.
+\end_layout
+
+\end_deeper
+\begin_layout Itemize
+The result may be production-ready:
+\color none
+
+\color blue
+less throw-away prototypes.
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+Make your code available as a library for
+\color none
+
+\color blue
+interactive use
+\color none
+.
+\end_layout
+
+\begin_layout Itemize
+Integrate plotting, visualization, logging, ..., into your objects.
+\end_layout
+
+\end_deeper
+\begin_layout Section*
+Wrapup
+\end_layout
+
+\begin_layout BeginFrame
+Wrapup
+\end_layout
+
+\begin_layout Standard
+
+\series bold
+\color blue
+Python
+\end_layout
+
+\begin_layout Itemize
+Rapidly growing in scientific computing.
+\end_layout
+
+\begin_layout Itemize
+Collaborative effort:
+\color blue
+by scientists, for scientists.
+\end_layout
+
+\begin_layout Itemize
+An open stack supports truly
+\color blue
+reproducible computational research
+\color inherit
+.
+\end_layout
+
+\begin_layout Standard
+
+\series bold
+\color blue
+What's in it for you?
+\end_layout
+
+\begin_layout Itemize
+Hopefully a very useful tool.
+\end_layout
+
+\begin_layout Itemize
+Provide Python bindings to your own research codes.
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+...
+ and we all benefit from the resulting network effect.
+\end_layout
+
+\end_deeper
+\begin_layout Standard
+\align center
+
+\series bold
+\size large
+Join in,
+\color blue
+there's plenty to do!
+\end_layout
+
+\begin_layout BeginPlainFrame
+Thank you! Questions?
+\end_layout
+
+\begin_layout FrameSubtitle
+Credit: http://xkcd.com/353
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+vspace{-5mm}
+\end_layout
+
+\end_inset
+
+
+\begin_inset Graphics
+ filename fig/xkcd_python.png
+ lyxscale 50
+ height 85pheight%
+ BoundingBox -4bp -4bp 518bp 588bp
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+
+\end_layout
+
+\begin_layout Standard
+\align center
+
+\series bold
+\size largest
+\color blue
+Let's start working!
+\end_layout
+
+\begin_layout EndFrame
+
+\end_layout
+
+\begin_layout Section*
+\start_of_appendix
+\begin_inset Note Note
+status collapsed
+
+\begin_layout Standard
+All of the following is optional and typically not needed.
+\end_layout
+
+\end_inset
+
+Appendix
+\end_layout
+
+\begin_layout Subsection*
+URLs
+\end_layout
+
+\begin_layout BeginFrame
+Some useful URLs
+\end_layout
+
+\begin_layout Itemize
+A collection of links on Python and Scientific Computing:
+\color blue
+
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://amath.colorado.edu/faculty/fperez/python/scicomp"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+SciPy:
+\color none
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://www.scipy.org"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+IPython, an improved interactive shell
+\color blue
+:
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://ipython.scipy.org"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+Matplotlib, 2d plotting with Matlab syntax
+\color blue
+:
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://matplotlib.sourceforge.net"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+MayaVi, 3d data visualization:
+\color blue
+
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://mayavi.sourceforge.net"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+PyX, programmatic PostScript generation (with
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+LaTeX
+\end_layout
+
+\end_inset
+
+ support)
+\color blue
+:
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://pyx.sourceforge.net"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+F2Py (FORTRAN):
+\color none
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://cens.ioc.ee/projects/f2py2e"
+
+\end_inset
+
+
+\color none
+
+\end_layout
+
+\begin_layout Itemize
+SWIG (C/C++ for Python):
+\color none
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://swig.org"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginFrame
+URLs for projects mentioned earlier
+\end_layout
+
+\begin_layout Itemize
+VPython, real-time 3D:
+\color none
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://vpython.org"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+UCSF Chimera - interactive molecular graphics
+\color blue
+:
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://www.cgl.ucsf.edu/chimera"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+PyRAF - Hubble Space Telescope interface to IRAF
+\color blue
+:
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://www.stsci.edu/resources/software_hardware/pyraf"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+BioPython -
+\color none
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://biopython.org"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+VisionEgg - vision research experiments (OpenGL):
+\color blue
+
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://www.visionegg.org"
+
+\end_inset
+
+
+\color none
+
+\end_layout
+
+\begin_layout Itemize
+Natural Language Toolkit:
+\newline
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://nltk.sourceforge.net"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+Neural Integrator - visual programming for neural networks:
+\newline
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://starship.python.net/crew/seehof/NeuralPython.html"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+Orange - component-based data mining:
+\newline
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://www.ailab.si/orange"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout EndFrame
+
+\end_layout
+
+\end_body
+\end_document
Added: trunk/py4science/talks/basemap_tutorial.ppt
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/basemap_tutorial.ppt
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/basemap/01.png
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/basemap/01.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/basemap/02.png
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/basemap/02.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/basemap/03.png
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/basemap/03.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/basemap/04.png
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/basemap/04.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/basemap/05.png
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/basemap/05.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/basemap/06.png
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/basemap/06.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/basemap/07.png
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/basemap/07.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/basemap/08.png
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/basemap/08.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/basemap/09.png
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/basemap/09.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/basemap/10.png
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/basemap/10.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/basemap/11.png
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/basemap/11.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/basemap/12.png
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/basemap/12.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/basemap/13.png
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/basemap/13.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/basemap/14.png
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/basemap/14.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/basemap/15.png
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/basemap/15.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/basemap/16.png
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/basemap/16.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/basemap/17.png
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/basemap/17.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/basemap/18.png
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/basemap/18.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/basemap/19.png
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/basemap/19.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/basemap/nplea_tissot.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/basemap/nplea_tissot.tiff
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/basemap/ortho.png
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/basemap/ortho.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/basemap/stere_tissot.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/basemap/stere_tissot.tiff
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/dtype.png
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/dtype.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/numpy_broadcasting.pdf
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/numpy_broadcasting.pdf
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/py4science/talks/fig/numpy_broadcasting.svg
===================================================================
--- trunk/py4science/talks/fig/numpy_broadcasting.svg (rev 0)
+++ trunk/py4science/talks/fig/numpy_broadcasting.svg 2008-10-25 04:29:53 UTC (rev 6333)
@@ -0,0 +1,4131 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ id="svg6427"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ width="1129.2002"
+ height="693.16803"
+ xml:space="preserve"
+ sodipodi:docname="numpy_broadcasting.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"
+ version="1.0"><metadata
+ id="metadata6432"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
+ id="defs6430"><inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective6434" /><clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath6444"><path
+ d="M 0,0 L 1024,0 L 1024,768 L 0,768 L 0,0 z"
+ id="path6446" /></clipPath><clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath6456"><path
+ d="M 12.25,436.5003 L 12.25,731.738 L 465.25,731.738 L 918.25,731.738 L 918.25,436.5003 L 918.25,141.2626 L 465.25,141.2626 L 12.25,141.2626 L 12.25,436.5003 M 171.1879,431.8608 C 171.468,432.5567 171.4529,433.733 171.1543,434.4747 C 170.6875,435.6345 170.3126,435.5489 168.4759,433.8636 C 167.3013,432.7857 166.5311,431.6095 166.7643,431.2497 C 167.5041,430.1086 170.658,430.5443 171.1879,431.8608"
+ id="path6458" /></clipPath><clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath6462"><path
+ d="M 12.25,141.8124 L 918.25,141.8124 L 918.25,731.7379 L 12.25,731.7379 L 12.25,141.8124 z"
+ id="path6464" /></clipPath><clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath9304"><path
+ d="M 0,0 L 1024,0 L 1024,768 L 0,768 L 0,0 z"
+ id="path9306" /></clipPath></defs><sodipodi:namedview
+ inkscape:window-height="977"
+ inkscape:window-width="1165"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ showgrid="false"
+ inkscape:zoom="0.4234375"
+ inkscape:cx="640"
+ inkscape:cy="480"
+ inkscape:window-x="2324"
+ inkscape:window-y="0"
+ inkscape:current-layer="g6436" /><g
+ id="g6436"
+ inkscape:groupmode="layer"
+ inkscape:label="pg_0003"
+ transform="matrix(1.25,0,0,-1.25,-15.3125,905.74503)"><g
+ id="g6438" /><g
+ id="g6440"><g
+ id="g6442"
+ clip-path="url(#clipPath6444)"><path
+ d="M 0,0 L 1024,0 L 1024,768 L 0,768 L 0,0 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ id="path6448" /><path
+ d="M 0,0 L 1024,0 L 1024,768 L 0,768 L 0,0 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ id="path6450" /></g></g><g
+ id="g6452"><g
+ id="g6454"
+ clip-path="url(#clipPath6456)"><g
+ id="g6460"
+ clip-path="url(#clipPath6462)"><path
+ d="M 791.9841,355.5665 L 791.9841,355.5665 L 827.0683,355.5665 L 827.0683,389.1947 L 791.9841,389.1947 L 791.9841,355.5665 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
+ id="path6466" /><g
+ id="g6468"
+ transform="matrix(0.1876165,0,0,-0.1788737,12.25,731.738)"><path
+ d="M 4156,2103 L 4156,2103 L 4343,2103 L 4343,1915 L 4156,1915 L 4156,2103 z"
+ style="fill:none;stroke:#000000;stroke-width:6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
+ id="path6470" /></g><path
+ d="M 799.6313,370.412 L 802.123,370.7001 C 802.2025,370.0946 802.4162,369.6317 802.7643,369.3114 C 803.1124,368.9912 803.5339,368.8311 804.0286,368.8311 C 804.5599,368.8311 805.0073,369.0233 805.3706,369.4075 C 805.7341,369.7918 805.9158,370.3101 805.9158,370.9622 C 805.9158,371.5794 805.7416,372.0685 805.3935,372.4295 C 805.0453,372.7905 804.621,372.971 804.1202,372.971 C 803.7903,372.971 803.3964,372.9098 802.9384,372.7876 L 803.2223,374.7877 C 803.9186,374.7703 804.45,374.9143 804.8164,375.22 C 805.1829,375.5257 805.3661,375.9319 805.3661,376.4384 C 805.3661,376.8693 805.2316,377.2129 804.9629,377.4691 C 804.6943,377.7253 804.337,377.8534 803.8911,377.8534 C 803.4514,377.8534 803.0758,377.7078 802.7643,377.4167 C 802.4529,377.1255 802.2635,376.7004 802.1964,376.1415 L 799.8237,376.5258 C 799.9886,377.3002 800.2375,377.9189 800.5703,378.3818 C 800.9031,378.8447 801.3673,379.2086 801.9628,379.4736 C 802.5582,379.7384 803.2254,379.871 803.9644,379.871 C 805.2286,379.871 806.2425,379.4866 807.0059,378.718 C 807.6349,378.0891 807.9494,377.3788 807.9494,376.5869 C 807.9494,375.4631 807.3052,374.5664 806.0165,373.8969 C 806.7859,373.7396 807.4013,373.3874 807.8624,372.84 C 808.3234,372.2927 808.5541,371.6318 808.5541,370.8573 C 808.5541,369.7336 808.1235,368.7758 807.2624,367.9838 C 806.4012,367.1919 805.3293,366.7961 804.0468,366.7961 C 802.8315,366.7961 801.8238,367.1293 801.0237,367.7961 C 800.2238,368.4628 799.7596,369.3347 799.6313,370.412 z M 814.5808,379.871 C 815.8818,379.871 816.8986,379.4283 817.6315,378.5434 C 818.5048,377.4953 818.9415,375.7572 818.9415,373.3292 C 818.9415,370.9069 818.5018,369.1659 817.6223,368.1061 C 816.8956,367.2328 815.8818,366.7961 814.5808,366.7961 C 813.2739,366.7961 812.2203,367.2749 811.4203,368.2328 C 810.6204,369.1906 810.2202,370.8981 810.2202,373.3553 C 810.2202,375.7659 810.66,377.5011 811.5394,378.5609 C 812.2662,379.4343 813.28,379.871 814.5808,379.871 z M 814.5808,377.8359 C 814.2694,377.8359 813.9916,377.7413 813.7472,377.5521 C 813.5029,377.3628 813.3136,377.0236 813.1793,376.5345 C 813.0021,375.8998 812.9136,374.8314 812.9136,373.3292 C 812.9136,371.8268 812.993,370.7948 813.1518,370.2329 C 813.3105,369.671 813.5106,369.2969 813.7518,369.1105 C 813.993,368.9242 814.2694,368.8311 814.5808,368.8311 C 814.8924,368.8311 815.1702,368.9256 815.4145,369.115 C 815.6588,369.3041 815.8481,369.6433 815.9825,370.1324 C 816.1596,370.7613 816.2482,371.8268 816.2482,373.3292 C 816.2482,374.8314 816.1687,375.8635 816.0101,376.4254 C 815.8512,376.9872 815.6512,377.3628 815.4099,377.5521 C 815.1688,377.7413 814.8924,377.8359 814.5808,377.8359 z"
+ style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ id="path6472" /><path
+ d="M 791.9841,389.1947 L 791.9841,389.1947 L 809.6199,406.0089 L 844.7043,406.0089 L 827.0683,389.1947 L 791.9841,389.1947 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
+ id="path6474" /><g
+ id="g6476"
+ transform="matrix(0.1876165,0,0,-0.1788737,12.25,731.738)"><path
+ d="M 4156,1915 L 4156,1915 L 4250,1821 L 4437,1821 L 4343,1915 L 4156,1915 z"
+ style="fill:none;stroke:#000000;stroke-width:6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
+ id="path6478" /></g><path
+ d="M 827.0683,355.5665 L 827.0683,355.5665 L 827.0683,389.1947 L 844.7043,406.0089 L 844.7043,372.3806 L 827.0683,355.5665 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
+ id="path6480" /><g
+ id="g6482"
+ transform="matrix(0.1876165,0,0,-0.1788737,12.25,731.738)"><path
+ d="M 4343,2103 L 4343,2103 L 4343,1915 L 4437,1821 L 4437,2009 L 4343,2103 z"
+ style="fill:none;stroke:#000000;stroke-width:6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
+ id="path6484" /></g><path
+ d="M 827.0683,355.5665 L 827.0683,355.5665 L 862.3402,355.5665 L 862.3402,389.1947 L 827.0683,389.1947 L 827.0683,355.5665 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
+ id="path6486" /><g
+ id="g6488"
+ transform="matrix(0.1876165,0,0,-0.1788737,12.25,731.738)"><path
+ d="M 4343,2103 L 4343,2103 L 4531,2103 L 4531,1915 L 4343,1915 L 4343,2103 z"
+ style="fill:none;stroke:#000000;stroke-width:6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
+ id="path6490" /></g><path
+ d="M 834.9032,370.412 L 837.395,370.7001 C 837.4745,370.0946 837.6881,369.6317 838.0363,369.3114 C 838.3843,368.9912 838.8057,368.8311 839.3004,368.8311 C 839.8318,368.8311 840.2792,369.0233 840.6425,369.4075 C 841.006,369.7918 841.1876,370.3101 841.1876,370.9622 C 841.1876,371.5794 841.0135,372.0685 840.6654,372.4295 C 840.3173,372.7905 839.8928,372.971 839.3921,372.971 C 839.0623,372.971 838.6683,372.9098 838.2103,372.7876 L 838.4943,374.7877 C 839.1905,374.7703 839.7218,374.9143 840.0883,375.22 C 840.4547,375.5257 840.6379,375.9319 840.6379,376.4384 C 840.6379,376.8693 840.5035,377.2129 840.2349,377.4691 C 839.9662,377.7253 839.6089,377.8534 839.163,377.8534 C 838.7233,377.8534 838.3477,377.7078 838.0363,377.4167 C 837.7247,377.1255 837.5354,376.7004 837.4683,376.1415 L 835.0955,376.5258 C 835.2604,377.3002 835.5094,377.9189 835.8422,378.3818 C 836.175,378.8447 836.6391,379.2086 837.2347,379.4736 C 837.8301,379.7384 838.4973,379.871 839.2363,379.871 C 840.5005,379.871 841.5143,379.4866 842.2777,378.718 C 842.9068,378.0891 843.2214,377.3788 843.2214,376.5869 C 843.2214,375.4631 842.577,374.5664 841.2883,373.8969 C 842.0579,373.7396 842.6732,373.3874 843.1343,372.84 C 843.5954,372.2927 843.8259,371.6318 843.8259,370.8573 C 843.8259,369.7336 843.3953,368.7758 842.5343,367.9838 C 841.6732,367.1919 840.6013,366.7961 839.3188,366.7961 C 838.1034,366.7961 837.0956,367.1293 836.2957,367.7961 C 835.4956,368.4628 835.0314,369.3347 834.9032,370.412 z M 852.088,367.0144 L 849.5139,367.0144 L 849.5139,376.2637 C 848.5732,375.4253 847.4648,374.8052 846.1884,374.4034 L 846.1884,376.6306 C 846.8601,376.8402 847.59,377.2376 848.3778,377.8228 C 849.1658,378.408 849.7062,379.0907 849.9993,379.871 L 852.088,379.871 L 852.088,367.0144 z"
+ style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ id="path6492" /><path
+ d="M 827.0683,389.1947 L 827.0683,389.1947 L 844.7043,406.0089 L 879.9761,406.0089 L 862.3402,389.1947 L 827.0683,389.1947 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
+ id="path6494" /><g
+ id="g6496"
+ transform="matrix(0.1876165,0,0,-0.1788737,12.25,731.738)"><path
+ d="M 4343,1915 L 4343,1915 L 4437,1821 L 4625,1821 L 4531,1915 L 4343,1915 z"
+ style="fill:none;stroke:#000000;stroke-width:6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
+ id="path6498" /></g><path
+ d="M 862.3402,355.5665 L 862.3402,355.5665 L 862.3402,389.1947 L 879.9761,406.0089 L 879.9761,372.3806 L 862.3402,355.5665 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
+ id="path6500" /><g
+ id="g6502"
+ transform="matrix(0.1876165,0,0,-0.1788737,12.25,731.738)"><path
+ d="M 4531,2103 L 4531,2103 L 4531,1915 L 4625,1821 L 4625,2009 L 4531,2103 z"
+ style="fill:none;stroke:#000000;stroke-width:6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
+ id="path6504" /></g><path
+ d="M 862.3402,355.5665 L 862.3402,355.5665 L 897.4244,355.5665 L 897.4244,389.1947 L 862.3402,389.1947 L 862.3402,355.5665 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
+ id="path6506" /><g
+ id="g6508"
+ transform="matrix(0.1876165,0,0,-0.1788737,12.25,731.738)"><path
+ d="M 4531,2103 L 4531,2103 L 4718,2103 L 4718,1915 L 4531,1915 L 4531,2103 z"
+ style="fill:none;stroke:#000000;stroke-width:6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
+ id="path6510" /></g><path
+ d="M 869.9875,370.412 L 872.4792,370.7001 C 872.5587,370.0946 872.7725,369.6317 873.1205,369.3114 C 873.4686,368.9912 873.8901,368.8311 874.3847,368.8311 C 874.9161,368.8311 875.3633,369.0233 875.7268,369.4075 C 876.0902,369.7918 876.2719,370.3101 876.2719,370.9622 C 876.2719,371.5794 876.0978,372.0685 875.7497,372.4295 C 875.4016,372.7905 874.9772,372.971 874.4763,372.971 C 874.1465,372.971 873.7526,372.9098 873.2946,372.7876 L 873.5785,374.7877 C 874.2748,374.7703 874.8062,374.9143 875.1726,375.22 C 875.539,375.5257 875.7222,375.9319 875.7222,376.4384 C 875.7222,376.8693 875.5878,377.2129 875.3191,377.4691 C 875.0505,377.7253 874.6932,377.8534 874.2473,377.8534 C 873.8076,377.8534 873.432,377.7078 873.1205,377.4167 C 872.809,377.1255 872.6197,376.7004 872.5526,376.1415 L 870.1799,376.5258 C 870.3448,377.3002 870.5937,377.9189 870.9265,378.3818 C 871.2593,378.8447 871.7235,379.2086 872.3188,379.4736 C 872.9144,379.7384 873.5816,379.871 874.3206,379.871 C 875.5849,379.871 876.5987,379.4866 877.3621,378.718 C 877.9911,378.0891 878.3055,377.3788 878.3055,376.5869 C 878.3055,375.4631 877.6613,374.5664 876.3727,373.8969 C 877.1422,373.7396 877.7576,373.3874 878.2186,372.84 C 878.6796,372.2927 878.9103,371.6318 878.9103,370.8573 C 878.9103,369.7336 878.4797,368.7758 877.6185,367.9838 C 876.7574,367.1919 875.6855,366.7961 874.403,366.7961 C 873.1876,366.7961 872.18,367.1293 871.3799,367.7961 C 870.5798,368.4628 870.1157,369.3347 869.9875,370.412 z M 889.2794,369.294 L 889.2794,367.0144 L 880.2559,367.0144 C 880.3535,367.8761 880.6467,368.6927 881.1352,369.4644 C 881.6238,370.2358 882.5887,371.2591 884.0301,372.5343 C 885.1906,373.5649 885.902,374.2636 886.1646,374.6305 C 886.5189,375.137 886.696,375.6378 886.696,376.1328 C 886.696,376.6801 886.5418,377.1008 886.2333,377.3948 C 885.9249,377.6889 885.4989,377.8359 884.9554,377.8359 C 884.4178,377.8359 883.9904,377.6815 883.6728,377.373 C 883.3552,377.0643 883.1721,376.552 883.1232,375.8358 L 880.5582,376.0804 C 880.7109,377.4312 881.1902,378.4007 881.9964,378.9888 C 882.8026,379.5769 883.8103,379.871 885.0195,379.871 C 886.3448,379.871 887.386,379.5303 888.1434,378.849 C 888.9007,378.1678 889.2794,377.3206 889.2794,376.3074 C 889.2794,375.731 889.171,375.1823 888.9541,374.661 C 888.7373,374.1399 888.3937,373.594 887.9236,373.0235 C 887.6121,372.645 887.0502,372.1006 886.2379,371.3901 C 885.4256,370.6798 884.9112,370.2082 884.6943,369.9753 C 884.4775,369.7423 884.3019,369.5153 884.1675,369.294 L 889.2794,369.294 z"
+ style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ id="path6512" /><path
+ d="M 862.3402,389.1947 L 862.3402,389.1947 L 879.9761,406.0089 L 915.0604,406.0089 L 897.4244,389.1947 L 862.3402,...
[truncated message content] |
|
From: <jd...@us...> - 2008-10-25 04:21:55
|
Revision: 6332
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6332&view=rev
Author: jdh2358
Date: 2008-10-25 04:21:52 +0000 (Sat, 25 Oct 2008)
Log Message:
-----------
added hello world
Added Paths:
-----------
trunk/py4science/talks/fig/hello_world.png
Added: trunk/py4science/talks/fig/hello_world.png
===================================================================
(Binary files differ)
Property changes on: trunk/py4science/talks/fig/hello_world.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fer...@us...> - 2008-10-25 03:44:47
|
Revision: 6331
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6331&view=rev
Author: fer_perez
Date: 2008-10-25 03:44:44 +0000 (Sat, 25 Oct 2008)
Log Message:
-----------
Updated skeletons and mkprob to report number of lines missing.
Modified Paths:
--------------
trunk/py4science/examples/mkprob.py
trunk/py4science/examples/skel/fft_imdenoise_skel.py
trunk/py4science/examples/skel/qsort_skel.py
trunk/py4science/examples/skel/quad_newton_skel.py
trunk/py4science/examples/skel/trapezoid_skel.py
Modified: trunk/py4science/examples/mkprob.py
===================================================================
--- trunk/py4science/examples/mkprob.py 2008-10-25 03:37:12 UTC (rev 6330)
+++ trunk/py4science/examples/mkprob.py 2008-10-25 03:44:44 UTC (rev 6331)
@@ -91,9 +91,9 @@
# Add the summary of 'raise' lines
# flush counter of code (disabled, we report static summary)
- #msg = '1 line' if del_lines==1 else ('%s lines' % del_lines)
- #exc = exc_tpl % msg
- exc = exc_tpl
+ msg = '1 line' if del_lines==1 else ('%s lines' % del_lines)
+ exc = exc_tpl % msg
+ #exc = exc_tpl
# Use the last value of 'space'
line = '%s%s' % (spaces[0],exc)
@@ -104,8 +104,8 @@
return del_lines
# used to report actual # of lines removed - disabled
- #exc_tpl = "raise NotImplementedError('%s missing')\n"
- exc_tpl = "raise NotImplementedError('insert missing code here')\n"
+ exc_tpl = "raise NotImplementedError('Original solution has %s')\n"
+ #exc_tpl = "raise NotImplementedError('insert missing code here')\n"
# states for state machine and other initialization
normal,delete = 0,1
@@ -241,7 +241,7 @@
clean = """
first line
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 1 line')
second line
"""
@@ -279,12 +279,12 @@
first line
# Hint: remember that
# idea we discussed before...
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 3 lines')
second line:
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 2 lines')
third line
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 2 lines')
"""
cleaned = src2skel(srclines)
yield str_match,cleaned,clean
Modified: trunk/py4science/examples/skel/fft_imdenoise_skel.py
===================================================================
--- trunk/py4science/examples/skel/fft_imdenoise_skel.py 2008-10-25 03:37:12 UTC (rev 6330)
+++ trunk/py4science/examples/skel/fft_imdenoise_skel.py 2008-10-25 03:44:44 UTC (rev 6331)
@@ -17,12 +17,12 @@
# Compute the magnitude of the input F (call it mag). Then, rescale mag by
# amplify/maximum_of_mag. Numpy arrays can be scaled in-place with ARR *=
# number. For the max of an array, look for its max method.
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 2 lines')
# Next, clip all values larger than one to one. You can set all elements
# of an array which satisfy a given condition with array indexing syntax:
# ARR[ARR<VALUE] = NEWVALUE, for example.
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 1 line')
# Display: this one already works, if you did everything right with mag
plt.imshow(mag, plt.cm.Blues)
@@ -39,7 +39,7 @@
# - extract all rows, all columns, 0-th plane to get the first
# channel
# - the resulting array should have 2 dimensions only
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 1 line')
print "Image shape:",im.shape
except:
print "Could not open image."
@@ -48,7 +48,7 @@
# Compute the 2d FFT of the input image
# Hint: Look for a 2-d FFT in np.fft.
# Note: call this variable 'F', which is the name we'll be using below.
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 1 line')
# In the lines following, we'll make a copy of the original spectrum and
# truncate coefficients. NO immediate code is to be written right here.
@@ -58,25 +58,25 @@
# Call ff a copy of the original transform. Numpy arrays have a copy
# method for this purpose.
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 1 line')
# Set r and c to be the number of rows and columns of the array.
# Hint: use the array's shape attribute.
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 1 line')
# Set to zero all rows with indices between r*keep_fraction and
# r*(1-keep_fraction):
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 1 line')
# Similarly with the columns:
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 1 line')
# Reconstruct the denoised image from the filtered spectrum, keep only the
# real part for display.
# Hint: There's an inverse 2d fft in the np.fft module as well (don't
# forget that you only want the real part).
# Call the result im_new,
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 1 line')
# Show the results
# The code below already works, if you did everything above right.
Modified: trunk/py4science/examples/skel/qsort_skel.py
===================================================================
--- trunk/py4science/examples/skel/qsort_skel.py 2008-10-25 03:37:12 UTC (rev 6330)
+++ trunk/py4science/examples/skel/qsort_skel.py 2008-10-25 03:44:44 UTC (rev 6331)
@@ -37,13 +37,13 @@
"""
# Hint: remember that all recursive functions need an exit condition
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 2 lines')
# Select pivot and apply recursively
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 3 lines')
# Upon return, make sure to properly concatenate the output lists
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 1 line')
#-----------------------------------------------------------------------------
Modified: trunk/py4science/examples/skel/quad_newton_skel.py
===================================================================
--- trunk/py4science/examples/skel/quad_newton_skel.py 2008-10-25 03:37:12 UTC (rev 6330)
+++ trunk/py4science/examples/skel/quad_newton_skel.py 2008-10-25 03:44:44 UTC (rev 6331)
@@ -10,7 +10,7 @@
# test input function
def f(t):
# f(t): t * sin^2(t)
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 1 line')
def g(t):
"Exact form for g by integrating f(t)"
@@ -21,18 +21,18 @@
"g(t) obtained by numerical integration"
u = 0.25
# Hint: use quad, see its return value carefully.
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 1 line')
# main
tguess = 10.0
print '"Exact" solution (knowing the analytical form of the integral)'
-raise NotImplementedError('insert missing code here')
+raise NotImplementedError('Original solution has 1 line')
print "t0, g(t0) =",t0,g(t0)
print
print "Solution using the numerical integration technique"
-raise NotImplementedError('insert missing code here')
+raise NotImplementedError('Original solution has 1 line')
print "t1, g(t1) =",t1,g(t1)
print
Modified: trunk/py4science/examples/skel/trapezoid_skel.py
===================================================================
--- trunk/py4science/examples/skel/trapezoid_skel.py 2008-10-25 03:37:12 UTC (rev 6330)
+++ trunk/py4science/examples/skel/trapezoid_skel.py 2008-10-25 03:44:44 UTC (rev 6331)
@@ -20,13 +20,13 @@
#
# Hint: if the two inputs have mismatched lengths or less than 2
# elements, we raise ValueError with an explanatory message.
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 4 lines')
# Efficient application of trapezoid rule via numpy
#
# Hint: think of using numpy slicing to compute the moving difference in
# the basic trapezoid formula.
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 1 line')
def trapzf(f,a,b,npts=100):
"""Simple trapezoid-based integrator.
@@ -48,20 +48,20 @@
# what differences in timings result for long vectors x?
# Generate an equally spaced grid to sample the function.
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 1 line')
# For an equispaced grid, the x spacing can just be read off from the first
# two points and factored out of the summation.
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 1 line')
# Sample the input function at all values of x
#
# Hint: you need to make an array out of the evaluations, and the python
# builtin 'map' function can come in handy.
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 1 line')
# Compute the trapezoid rule sum for the final result
- raise NotImplementedError('insert missing code here')
+ raise NotImplementedError('Original solution has 1 line')
#-----------------------------------------------------------------------------
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-10-25 03:37:18
|
Revision: 6330
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6330&view=rev
Author: jdh2358
Date: 2008-10-25 03:37:12 +0000 (Sat, 25 Oct 2008)
Log Message:
-----------
reorg talk dir
Modified Paths:
--------------
trunk/py4science/examples/convolution_demo.py
trunk/py4science/examples/lotka_volterra.py
trunk/py4science/examples/mkprob.py
trunk/py4science/examples/skel/lotka_volterra_skel.py
trunk/py4science/workbook/README
trunk/py4science/workbook/add_problem
Added Paths:
-----------
trunk/py4science/talks/
trunk/py4science/talks/0712_ncar_intro.lyx
trunk/py4science/talks/0810_berkeley_intro.lyx
trunk/py4science/talks/fig/
trunk/py4science/talks/fig/Fluidlab5.png
trunk/py4science/talks/fig/Fluidlab6.png
trunk/py4science/talks/fig/ipython_parallel.eps
trunk/py4science/talks/fig/ipython_parallel.png
trunk/py4science/talks/fig/jpl_lander_comm_power.png
trunk/py4science/talks/fig/jpl_nav_summary.png
trunk/py4science/talks/fig/kernel2p.eps
trunk/py4science/talks/fig/kernel2p.png
trunk/py4science/talks/fig/mayavi_comb_vol.png
trunk/py4science/talks/fig/mlab-screen-black.png
trunk/py4science/talks/fig/mpl_brain1.png
trunk/py4science/talks/fig/mpl_brain2.png
trunk/py4science/talks/fig/mpl_brain3.png
trunk/py4science/talks/fig/mpl_brain4.png
trunk/py4science/talks/fig/mpl_brain5.png
trunk/py4science/talks/fig/ncar-world-seam.3.png
trunk/py4science/talks/fig/pmv.png
trunk/py4science/talks/fig/pylab-screen.png
trunk/py4science/talks/fig/rho_2d_skel.eps
trunk/py4science/talks/fig/rho_2d_surf.png
trunk/py4science/talks/fig/sage_notebook-medium.jpg
trunk/py4science/talks/fig/vision_beam_pattern.png
trunk/py4science/talks/fig/xkcd_python.png
trunk/py4science/talks/intro_python_scicomp.lyx
trunk/py4science/talks/matplotlib_intro.ppt
trunk/py4science/talks/pydap/
trunk/py4science/talks/pydap/pydap.lyx
trunk/py4science/talks/pydap/pydap.pdf
trunk/py4science/talks/pydap/pydap_arch.png
trunk/py4science/workbook/problems_skel/detect_action_potentials.py
trunk/py4science/workbook/problems_soln/detect_action_potentials.py
Removed Paths:
-------------
trunk/py4science/intro_talk/
trunk/py4science/slides/
trunk/py4science/talks/fig/Fluidlab5.png
trunk/py4science/talks/fig/Fluidlab6.png
trunk/py4science/talks/fig/ipython_parallel.eps
trunk/py4science/talks/fig/ipython_parallel.png
trunk/py4science/talks/fig/jpl_lander_comm_power.png
trunk/py4science/talks/fig/jpl_nav_summary.png
trunk/py4science/talks/fig/kernel2p.eps
trunk/py4science/talks/fig/kernel2p.png
trunk/py4science/talks/fig/mayavi_comb_vol.png
trunk/py4science/talks/fig/mlab-screen-black.png
trunk/py4science/talks/fig/mpl_brain1.png
trunk/py4science/talks/fig/mpl_brain2.png
trunk/py4science/talks/fig/mpl_brain3.png
trunk/py4science/talks/fig/mpl_brain4.png
trunk/py4science/talks/fig/mpl_brain5.png
trunk/py4science/talks/fig/ncar-world-seam.3.png
trunk/py4science/talks/fig/pmv.png
trunk/py4science/talks/fig/pylab-screen.png
trunk/py4science/talks/fig/rho_2d_skel.eps
trunk/py4science/talks/fig/rho_2d_surf.png
trunk/py4science/talks/fig/sage_notebook-medium.jpg
trunk/py4science/talks/fig/vision_beam_pattern.png
trunk/py4science/talks/fig/xkcd_python.png
trunk/py4science/talks/pydap/pydap.lyx
trunk/py4science/talks/pydap/pydap.pdf
trunk/py4science/talks/pydap/pydap_arch.png
Modified: trunk/py4science/examples/convolution_demo.py
===================================================================
--- trunk/py4science/examples/convolution_demo.py 2008-10-24 22:35:25 UTC (rev 6329)
+++ trunk/py4science/examples/convolution_demo.py 2008-10-25 03:37:12 UTC (rev 6330)
@@ -13,7 +13,7 @@
In this exercise, we will compute investigate the convolution of a
white noise process with a double exponential impulse response
-function, and compute the results
+function, and compute the results
* using numpy.convolve
@@ -21,40 +21,40 @@
temporal domain is a multiplication in the fourier domain
"""
-import numpy as npy
+import numpy as np
import matplotlib.mlab as mlab
-from pylab import figure, show
+import matplotlib.pyplot as plt
# build the time, input, output and response arrays
dt = 0.01
-t = npy.arange(0.0, 20.0, dt) # the time vector from 0..20
+t = np.arange(0.0, 20.0, dt) # the time vector from 0..20
Nt = len(t)
def impulse_response(t):
'double exponential response function'
- return (npy.exp(-t) - npy.exp(-5*t))*dt
+ return (np.exp(-t) - np.exp(-5*t))*dt
-x = npy.random.randn(Nt) # gaussian white noise
+x = np.random.randn(Nt) # gaussian white noise
# evaluate the impulse response function, and numerically convolve it
# with the input x
r = impulse_response(t) # evaluate the impulse function
-y = npy.convolve(x, r, mode='full') # convultion of x with r
+y = np.convolve(x, r, mode='full') # convultion of x with r
y = y[:Nt]
# compute y by applying F^-1[F(x) * F(r)]. The fft assumes the signal
# is periodic, so to avoid edge artificats, pad the fft with zeros up
# to the length of r + x do avoid circular convolution artifacts
-R = npy.fft.fft(r, len(r)+len(x)-1)
-X = npy.fft.fft(x, len(r)+len(x)-1)
+R = np.fft.fft(r, len(r)+len(x)-1)
+X = np.fft.fft(x, len(r)+len(x)-1)
Y = R*X
# now inverse fft and extract just the part up to len(x)
-yi = npy.fft.ifft(Y)[:len(x)].real
+yi = np.fft.ifft(Y)[:len(x)].real
# plot t vs x, t vs y and yi, and t vs r in three subplots
-fig = figure()
+fig = plt.figure()
ax1 = fig.add_subplot(311)
ax1.plot(t, x)
ax1.set_ylabel('input x')
@@ -73,4 +73,4 @@
fig.savefig('convolution_demo.png', dpi=150)
fig.savefig('convolution_demo.eps')
-show()
+plt.show()
Modified: trunk/py4science/examples/lotka_volterra.py
===================================================================
--- trunk/py4science/examples/lotka_volterra.py 2008-10-24 22:35:25 UTC (rev 6329)
+++ trunk/py4science/examples/lotka_volterra.py 2008-10-25 03:37:12 UTC (rev 6330)
@@ -1,24 +1,40 @@
-import numpy as n
-import pylab as p
+import numpy as np
+import matplotlib.pyplot as plt
import scipy.integrate as integrate
def dr(r, f):
- return alpha*r - beta*r*f
-
+ """
+ return the derivative of *r* (the rabbit population) evaulated as a
+ function of *r* and *f*. The function should work whether *r* and *f*
+ are scalars, 1D arrays or 2D arrays. The return value should have
+ the same dimensionality (shape) as the inputs *r* and *f*.
+ """
+ return alpha*r - beta*r*f #@
+
def df(r, f):
- return gamma*r*f - delta*f
+ """
+ return the derivative of *f* (the fox population) evaulated as a
+ function of *r* and *f*. The function should work whether *r* and *f*
+ are scalars, 1D arrays or 2D arrays. The return value should have
+ the same dimensionality (shape) as the inputs *r* and *f*.
+ """
+ return gamma*r*f - delta*f #@
def derivs(state, t):
"""
- Map the state variable [rabbits, foxes] to the derivitives
- [deltar, deltaf] at time t
+ Return the derivatives of r and f, stored in the *state* vector::
+
+ state = [r, f]
+
+ The return data should be [dr, df] which are the derivatives of r
+ and f at position state and time *t*
"""
- #print t, state
- r, f = state # rabbits and foxes
- deltar = dr(r, f) # change in rabbits
- deltaf = df(r, f) # change in foxes
- return deltar, deltaf
+ r, f = state # and foxes #@
+ deltar = dr(r, f) # in rabbits #@
+ deltaf = df(r, f) # in foxes #@
+ return deltar, deltaf #@
+# the parameters for rabbit and fox growth and interactions
alpha, delta = 1, .25
beta, gamma = .2, .05
@@ -26,53 +42,71 @@
r0 = 20
f0 = 10
-t = n.arange(0.0, 100, 0.1)
+# create a time array from 0..100 sampled at 0.1 second steps
+t = np.arange(0.0, 100, 0.1) #@
+
y0 = [r0, f0] # the initial [rabbits, foxes] state vector
-y = integrate.odeint(derivs, y0, t)
-r = y[:,0] # extract the rabbits vector
-f = y[:,1] # extract the foxes vector
-p.figure()
-p.plot(t, r, label='rabbits')
-p.plot(t, f, label='foxes')
-p.xlabel('time (years)')
-p.ylabel('population')
-p.title('population trajectories')
-p.grid()
-p.legend()
-p.savefig('lotka_volterra.png', dpi=150)
-p.savefig('lotka_volterra.eps')
+# integrate your ODE using scipy.integrate. Read the help to see what
+# is available
+#@ HINT: see scipy.integrate.odeint
+y = integrate.odeint(derivs, y0, t) #@
+# the return value from the integration is a Nx2 array. Extract it
+# into two 1D arrays caled r and f using numpy slice indexing
+r = y[:,0] # extract the rabbits vector #@
+f = y[:,1] # extract the foxes vector #@
-p.figure()
-p.plot(r, f, color='red')
-p.xlabel('rabbits')
-p.ylabel('foxes')
-p.title('phase plane')
+# time series plot: plot the population of rabbits and foxes as a
+# funciton of time
+plt.figure()
+plt.plot(t, r, label='rabbits')
+plt.plot(t, f, label='foxes')
+plt.xlabel('time (years)')
+plt.ylabel('population')
+plt.title('population trajectories')
+plt.grid()
+plt.legend()
+plt.savefig('lotka_volterra.png', dpi=150)
+plt.savefig('lotka_volterra.eps')
+# phase-plane plot: plot the population of foxes versus rabbits
+# make sure you include and xlabel, ylabel and title
+plt.figure() #@
+plt.plot(r, f, color='red') #@
+plt.xlabel('rabbits') #@
+plt.ylabel('foxes') #@
+plt.title('phase plane') #@
-# make a direction field plot with quiver
-rmax = 1.1 * r.max()
-fmax = 1.1 * f.max()
-R, F = n.meshgrid(n.arange(-1, rmax), n.arange(-1, fmax))
-dR = dr(R, F)
-dF = df(R, F)
-p.quiver(R, F, dR, dF)
+# Create 2D arrays for R and F to represent the entire phase plane --
+# the point (R[i,j], F[i,j]) is a single (rabbit, fox) combinations.
+# pass these arrays to the functions dr and df above to get 2D arrays
+# of dR and dF evaluated at every point in the phase plance.
+rmax = 1.1 * r.max() #@
+fmax = 1.1 * f.max() #@
+R, F = np.meshgrid(np.arange(-1, rmax), np.arange(-1, fmax)) #@
+dR = dr(R, F) #@
+dF = df(R, F) #@
+plt.quiver(R, F, dR, dF) #@
-R, F = n.meshgrid(n.arange(-1, rmax, .1), n.arange(-1, fmax, .1))
-dR = dr(R, F)
-dF = df(R, F)
-p.contour(R, F, dR, levels=[0], linewidths=3, colors='blue')
-p.contour(R, F, dF, levels=[0], linewidths=3, colors='green')
-p.ylabel('foxes')
-p.title('trajectory, direction field and null clines')
+# Now find the nul-clines, for dR and dF respectively. These are the
+# points where dR=0 and dF=0 in the (R, F) phase plane. You can use
+# matplotlib's countour routine to find the zero level. See the
+# levels keyword to contour. You will need a fine mesh of R and F,
+# reevaluate dr and df on the finer grid, and use contour to find the
+# level curves
+R, F = np.meshgrid(np.arange(-1, rmax, 0.1), np.arange(-1, fmax, 0.1)) #@
+dR = dr(R, F) #@
+dF = df(R, F) #@
+plt.contour(R, F, dR, levels=[0], linewidths=3, colors='blue') #@
+plt.contour(R, F, dF, levels=[0], linewidths=3, colors='green') #@
+plt.ylabel('foxes') #@
+plt.title('trajectory, direction field and null clines') #@
-p.savefig('lotka_volterra_pplane.png', dpi=150)
-p.savefig('lotka_volterra_pplane.eps')
+plt.savefig('lotka_volterra_pplane.png', dpi=150)
+plt.savefig('lotka_volterra_pplane.eps')
+plt.show()
-
-p.show()
-
Modified: trunk/py4science/examples/mkprob.py
===================================================================
--- trunk/py4science/examples/mkprob.py 2008-10-24 22:35:25 UTC (rev 6329)
+++ trunk/py4science/examples/mkprob.py 2008-10-25 03:37:12 UTC (rev 6330)
@@ -35,14 +35,14 @@
import sys
# Third-party imports
-import nose
+#import nose
# Constants
MARKER = '#@'
DEL_RE = re.compile(r'''^((\s*)(.*?))\s*%s\s*$''' % MARKER)
HINT_RE = re.compile(r'''^(?P<space>\s*)%s\s+(?P<hint>.*)$''' % MARKER)
-
+
#-----------------------------------------------------------------------------
# Main code begins
@@ -52,7 +52,7 @@
Inputs:
src : sequence of lines (file-like objects work out of the box)
"""
-
+
out = []
addline = out.append
for line in src:
@@ -66,7 +66,7 @@
# if marker is matched in code, strip it and leave the code
line = mdel.group(1)+'\n'
addline(line)
-
+
return ''.join(out)
@@ -94,19 +94,19 @@
#msg = '1 line' if del_lines==1 else ('%s lines' % del_lines)
#exc = exc_tpl % msg
exc = exc_tpl
-
+
# Use the last value of 'space'
line = '%s%s' % (spaces[0],exc)
out.append(line)
del_lines = 0
spaces[:] = []
-
+
return del_lines
-
+
# used to report actual # of lines removed - disabled
- #exc_tpl = "raise NotImplementedError('%s missing')\n"
+ #exc_tpl = "raise NotImplementedError('%s missing')\n"
exc_tpl = "raise NotImplementedError('insert missing code here')\n"
-
+
# states for state machine and other initialization
normal,delete = 0,1
state_cur = normal
@@ -114,7 +114,7 @@
spaces = []
normal_lines = []
out = []
-
+
# To remove multiple consecutive lines of input marked for deletion, we
# need a small state machine.
for line in src:
@@ -134,7 +134,7 @@
state_new = delete
del_lines += 1
spaces.append(mdel.group(2))
-
+
# Flush output only when there's a change of state
if state_new != state_cur:
del_lines = flush_buffers(normal_lines,del_lines)
@@ -144,7 +144,7 @@
# Final buffer flush is unconditional
flush_buffers(normal_lines)
-
+
return ''.join(out)
@@ -155,14 +155,14 @@
# get the mode of the input so that we can create the output files with the
# same mode
fmode = os.stat(fpath).st_mode
-
+
with open(fpath) as infile:
# Generate the skeleton
skel = src2skel(infile)
with open(fname_skel,'w') as fskel:
fskel.write(skel)
os.chmod(fname_skel,fmode)
-
+
# Reset the input file pointer and generate the solution
infile.seek(0)
soln = src2soln(infile)
@@ -193,7 +193,7 @@
def main(argv=None):
"""Main entry point as a command line script for normal execution"""
-
+
if argv is None:
argv = sys.argv
@@ -229,8 +229,8 @@
"""Check that two strings are equal ignoring trailing whitespace."""
#print '***S1\n',s1,'\n***S2\n',s2 # dbg
nose.tools.assert_equal(s1.rstrip(),s2.rstrip())
-
+
def test_simple():
src = """
first line
@@ -238,13 +238,13 @@
second line
"""
srclines = src.splitlines(True)
-
+
clean = """
first line
raise NotImplementedError('insert missing code here')
second line
"""
-
+
cleaned = src2skel(srclines)
yield str_match,cleaned,clean
@@ -255,8 +255,8 @@
"""
cleaned = src2soln(src.splitlines(True))
yield str_match,cleaned,clean
-
+
def test_multi():
src = """
first line
@@ -306,7 +306,7 @@
yield str_match,cleaned,clean
-@nose.tools.nottest
+#@nose.tools.nottest
def test():
"""Simple self-contained test runner."""
nose.runmodule(__name__,exit=False,
Modified: trunk/py4science/examples/skel/lotka_volterra_skel.py
===================================================================
--- trunk/py4science/examples/skel/lotka_volterra_skel.py 2008-10-24 22:35:25 UTC (rev 6329)
+++ trunk/py4science/examples/skel/lotka_volterra_skel.py 2008-10-25 03:37:12 UTC (rev 6330)
@@ -1,24 +1,37 @@
-import numpy as n
-import pylab as p
+import numpy as np
+import matplotlib.pyplot as plt
import scipy.integrate as integrate
def dr(r, f):
- return alpha*r - beta*r*f
-
+ """
+ return the derivative of *r* (the rabbit population) evaulated as a
+ function of *r* and *f*. The function should work whether *r* and *f*
+ are scalars, 1D arrays or 2D arrays. The return value should have
+ the same dimensionality (shape) as the inputs *r* and *f*.
+ """
+ raise NotImplementedError('insert missing code here')
+
def df(r, f):
- return gamma*r*f - delta*f
+ """
+ return the derivative of *f* (the fox population) evaulated as a
+ function of *r* and *f*. The function should work whether *r* and *f*
+ are scalars, 1D arrays or 2D arrays. The return value should have
+ the same dimensionality (shape) as the inputs *r* and *f*.
+ """
+ raise NotImplementedError('insert missing code here')
def derivs(state, t):
"""
- Map the state variable [rabbits, foxes] to the derivitives
- [deltar, deltaf] at time t
+ Return the derivatives of r and f, stored in the *state* vector::
+
+ state = [r, f]
+
+ The return data should be [dr, df] which are the derivatives of r
+ and f at position state and time *t*
"""
- #print t, state
- r, f = state # rabbits and foxes
- deltar = dr(r, f) # change in rabbits
- deltaf = df(r, f) # change in foxes
- return deltar, deltaf
+ raise NotImplementedError('insert missing code here')
+
alpha, delta = 1, .25
beta, gamma = .2, .05
@@ -26,53 +39,53 @@
r0 = 20
f0 = 10
-t = n.arange(0.0, 100, 0.1)
+t = np.arange(0.0, 100, 0.1)
y0 = [r0, f0] # the initial [rabbits, foxes] state vector
y = integrate.odeint(derivs, y0, t)
r = y[:,0] # extract the rabbits vector
f = y[:,1] # extract the foxes vector
-p.figure()
-p.plot(t, r, label='rabbits')
-p.plot(t, f, label='foxes')
-p.xlabel('time (years)')
-p.ylabel('population')
-p.title('population trajectories')
-p.grid()
-p.legend()
-p.savefig('lotka_volterra.png', dpi=150)
-p.savefig('lotka_volterra.eps')
+plt.figure()
+plt.plot(t, r, label='rabbits')
+plt.plot(t, f, label='foxes')
+plt.xlabel('time (years)')
+plt.ylabel('population')
+plt.title('population trajectories')
+plt.grid()
+plt.legend()
+plt.savefig('lotka_volterra.png', dpi=150)
+plt.savefig('lotka_volterra.eps')
-p.figure()
-p.plot(r, f, color='red')
-p.xlabel('rabbits')
-p.ylabel('foxes')
-p.title('phase plane')
+plt.figure()
+plt.plot(r, f, color='red')
+plt.xlabel('rabbits')
+plt.ylabel('foxes')
+plt.title('phase plane')
# make a direction field plot with quiver
rmax = 1.1 * r.max()
fmax = 1.1 * f.max()
-R, F = n.meshgrid(n.arange(-1, rmax), n.arange(-1, fmax))
+R, F = np.meshgrid(np.arange(-1, rmax), np.arange(-1, fmax))
dR = dr(R, F)
dF = df(R, F)
-p.quiver(R, F, dR, dF)
+plt.quiver(R, F, dR, dF)
-R, F = n.meshgrid(n.arange(-1, rmax, .1), n.arange(-1, fmax, .1))
+R, F = np.meshgrid(np.arange(-1, rmax, .1), np.arange(-1, fmax, .1))
dR = dr(R, F)
dF = df(R, F)
-p.contour(R, F, dR, levels=[0], linewidths=3, colors='blue')
-p.contour(R, F, dF, levels=[0], linewidths=3, colors='green')
-p.ylabel('foxes')
-p.title('trajectory, direction field and null clines')
+plt.contour(R, F, dR, levels=[0], linewidths=3, colors='blue')
+plt.contour(R, F, dF, levels=[0], linewidths=3, colors='green')
+plt.ylabel('foxes')
+plt.title('trajectory, direction field and null clines')
-p.savefig('lotka_volterra_pplane.png', dpi=150)
-p.savefig('lotka_volterra_pplane.eps')
+plt.savefig('lotka_volterra_pplane.png', dpi=150)
+plt.savefig('lotka_volterra_pplane.eps')
-p.show()
+plt.show()
Copied: trunk/py4science/talks/0712_ncar_intro.lyx (from rev 6308, trunk/py4science/intro_talk/0712_ncar_intro.lyx)
===================================================================
--- trunk/py4science/talks/0712_ncar_intro.lyx (rev 0)
+++ trunk/py4science/talks/0712_ncar_intro.lyx 2008-10-25 03:37:12 UTC (rev 6330)
@@ -0,0 +1,2400 @@
+#LyX 1.5.1 created this file. For more info see http://www.lyx.org/
+\lyxformat 276
+\begin_document
+\begin_header
+\textclass beamer
+\begin_preamble
+% Include only certain frames - this speeds up compilation
+% The frames to be included need to be labeled, by using ERT
+% as [label=LABELNAME] (no backslashes or {})
+%\includeonlyframes{currentt}
+
+% To make a printable handout (one page per frame), pass
+% the handout option to the doc class (Layout menu)
+
+% For good fonts in PDFs, use pslatex fonts (Layout menu)
+
+% Colors and symbols
+\usepackage{latexsym}
+\usepackage{color}
+
+% Display covered items in transparent form (as opposed
+% to not showing them at all)
+\newcommand{\coveredinvisible}{
+ \setbeamercovered{invisible}
+}
+\newcommand{\coveredvisible}{
+ \setbeamercovered{highly dynamic}
+}
+
+% Choose default setting here:
+\coveredvisible
+
+\newcommand{\ps}{\vspace{-4mm} }
+
+% Theme configuration. I've basically built a custom theme out of
+% Warsaw, adding infoline and changing the nav. symbol bar
+
+% Warning: the commands below are order-sensitive!
+
+% load the infolines theme, b/c I want the headline Warsaw
+% uses (split), but the footline from infolines.
+% In the document body, these will be deactivated for the title and
+% turned on later
+\useoutertheme{infolines}
+% Main theme
+\usetheme{Warsaw}
+% Adjust the color for the center (title) box to be that of
+% infolines, which Warsaw changes
+\setbeamercolor*{title in head/foot}{parent=palette secondary}
+
+% Define a minimal set of navigation symbols
+\defbeamertemplate*{navigation symbols}{minmal}
+{%
+ \hbox{%
+ \hbox{\insertframenavigationsymbol}
+ \hbox{\insertdocnavigationsymbol}
+ \hbox{\insertbackfindforwardnavigationsymbol}%
+ }%
+}
+% activate the minimal navbar
+\setbeamertemplate{navigation symbols}[minimal]
+
+%%%%% HACK %%%%%
+% I started getting errors because LyX is emmitting a color 'none'
+% call, which confuses xcolor. I'm defining 'none' to be black here.
+\definecolor{none}{cmyk}{0,0,0,1}
+%%%%% /HACK %%%%%
+\end_preamble
+\options compress
+\language english
+\inputencoding auto
+\font_roman times
+\font_sans helvet
+\font_typewriter courier
+\font_default_family default
+\font_sc false
+\font_osf false
+\font_sf_scale 100
+\font_tt_scale 100
+\graphics default
+\paperfontsize default
+\spacing single
+\papersize default
+\use_geometry false
+\use_amsmath 2
+\use_esint 0
+\cite_engine basic
+\use_bibtopic false
+\paperorientation landscape
+\secnumdepth 2
+\tocdepth 2
+\paragraph_separation indent
+\defskip medskip
+\quotes_language english
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tracking_changes false
+\output_changes false
+\author ""
+\author ""
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Standard
+Some things to fix in a future version:
+\end_layout
+
+\begin_layout Standard
+- trim a bit of time
+\end_layout
+
+\begin_layout Standard
+- add more about ipython and my own python work, reduce that of others
+\end_layout
+
+\begin_layout Standard
+- add a final python pros/cons, esp.
+ the cons part.
+ It will make things more balanced.
+\end_layout
+
+\begin_layout Standard
+- the PDE part repeats a bit the 'python benefits' which were already pounded
+ on.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+% disable the bottom bar for the title and outline pages
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+
+\backslash
+setbeamertemplate{footline}{}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+vspace*{-5mm}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Title
+Python in Scientific Computing
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+Python & Scientific Computing
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subtitle
+An Introduction
+\end_layout
+
+\begin_layout Author
+Fernando\InsetSpace ~
+Pérez
+\newline
+
+\family typewriter
+\size scriptsize
+<Fer...@co...>
+\family default
+\size default
+
+\newline
+John Hunter
+\newline
+
+\family typewriter
+\size scriptsize
+<jd...@gm...>
+\family default
+\size default
+
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+FP/JDH
+\begin_inset Note Note
+status collapsed
+
+\begin_layout Standard
+This is used by the 'split' footline theme on the left side of the page
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+vspace{5mm}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Institute
+Applied Mathematics, U.
+ of Colorado at Boulder
+\newline
+Tradelink
+\begin_inset Note Note
+status open
+
+\begin_layout Standard
+- Use the
+\backslash
+inst command only if there are several affiliations.
+\end_layout
+
+\begin_layout Standard
+- Keep it simple, no one is interested in your street address.
+\end_layout
+
+\end_inset
+
+
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+CU\InsetSpace ~
+Boulder/Tradelink
+\begin_inset Note Note
+status open
+
+\begin_layout Standard
+optional, but mostly needed
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+vspace{5mm}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Date
+NCAR, Boulder
+\newline
+Dec 7, 2007
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+NCAR, 12/7/07
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Standard
+If you have a file called "institution-logo-filename.xxx", where xxx is a
+ graphic format that can be processed by latex or pdflatex, resp., then you
+ can add a logo by uncommenting the following:
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+%
+\backslash
+pgfdeclareimage[height=0.5cm]{institution-logo}{institution-logo-filename}
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+%
+\backslash
+logo{
+\backslash
+pgfuseimage{institution-logo}}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Standard
+The following causes the table of contents to be shown at the beginning
+ of every Section.
+ Delete this, if you do not want it.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+AtBeginSection[]{
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+
+\backslash
+frame<beamer>{
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+
+\backslash
+frametitle{Outline}
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+
+\backslash
+tableofcontents[currentsection]
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+}
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Standard
+If you wish to uncover everything in a step-wise fashion, uncomment the
+ following command:
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+%
+\backslash
+beamerdefaultoverlayspecification{<+->}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+% reactivate the footline
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+
+\backslash
+setbeamertemplate{footline}[infolines theme]
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginFrame
+Outline
+\end_layout
+
+\begin_layout Standard
+\begin_inset LatexCommand tableofcontents
+
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+[pausesections]
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Scientific Computing
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+SciComp
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Traditional approaches
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+Status quo
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginFrame
+FORTRAN, C and C++
+\end_layout
+
+\begin_layout Itemize
+Tools optimized for CPUs, not humans.
+\end_layout
+
+\begin_layout Itemize
+Low-level:
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+Primitive data types (no good strings, sets, hash tables,
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+ldots
+\end_layout
+
+\end_inset
+
+).
+\end_layout
+
+\begin_layout Itemize
+Manual memory management: bugs, bugs, bugs.
+ Hard ones.
+\end_layout
+
+\begin_layout Itemize
+Slow edit/compile/test cycle.
+\end_layout
+
+\end_deeper
+\begin_layout Itemize
+Clumsy access to visualization, quick profiling, text processing,
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+ldots
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+No interactive facilities - scientific work is inherently exploratory.
+\end_layout
+
+\begin_layout Pause
+
+\end_layout
+
+\begin_layout Standard
+
+\series bold
+\color blue
+However!
+\end_layout
+
+\begin_layout Itemize
+They deliver excellent performance.
+\end_layout
+
+\begin_layout Itemize
+Millions of LOC in proven scientific codes.
+
+\end_layout
+
+\begin_layout Itemize
+We need to
+\emph on
+\color blue
+work with these tools
+\emph default
+\color inherit
+, not replace them!
+\end_layout
+
+\begin_layout BeginFrame
+Higher level tools in the last decade
+\end_layout
+
+\begin_layout Itemize
+Mathematica and Maple: a unique niche we won't address today.
+\end_layout
+
+\begin_layout Itemize
+IDL and Matlab: extremely popular, for good reasons.
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+Great interactivity, visualization, and extensive libraries.
+\end_layout
+
+\begin_layout Itemize
+Unpleasant languages for large-scale programs and non-numerical tasks.
+\end_layout
+
+\begin_layout Itemize
+Expensive/proprietary: lock-in.
+\end_layout
+
+\begin_layout Itemize
+Often considered `prototyping' tools: this leads to a lot of code rewriting.
+\end_layout
+
+\end_deeper
+\begin_layout Itemize
+A common approach (I've been there): mix and match multiple tools:
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+FORTRAN, C, C++ programs ...
+\end_layout
+
+\begin_layout Itemize
+driven by Bash/awk/sed/Perl scripts ...
+\end_layout
+
+\begin_layout Itemize
+which feed them input and take their outputs ...
+\end_layout
+
+\begin_layout Itemize
+and pass them to Gnuplot, Grace, OpenDX, etc.
+\end_layout
+
+\end_deeper
+\begin_layout Itemize
+Many different syntaxes:
+\color none
+
+\color red
+huge context switching overhead!
+\end_layout
+
+\begin_layout Subsection
+Python?
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+Python
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginFrame
+Python in this context
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+Free
+\color none
+ (BSD license), highly portable (Linux, OSX, Solaris, Windows, ...).
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+Interactive
+\color none
+ interpreter provided.
+\end_layout
+
+\begin_layout Itemize
+Extremely readable syntax (
+\color blue
+
+\begin_inset Quotes eld
+\end_inset
+
+executable pseudo-code
+\begin_inset Quotes erd
+\end_inset
+
+
+\color none
+).
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+Simple
+\color none
+: non-professional programmers can become (and remain) proficient with a
+ very small effort (c.f.
+ C++).
+\end_layout
+
+\begin_layout Itemize
+Clean object oriented model, but
+\color none
+
+\color blue
+not mandatory
+\color none
+.
+\end_layout
+
+\begin_layout Itemize
+Rich built-in types: lists, sets, dictionaries (hash tables), strings, ...
+\end_layout
+
+\begin_layout Itemize
+Very comprehensive standard library (
+\color blue
+batteries included
+\color none
+)
+\end_layout
+
+\begin_layout Itemize
+Standard libraries for IDL/Matlab-like arrays (NumPy)
+\end_layout
+
+\begin_layout Itemize
+Easy to wrap existing C, C++ and FORTRAN codes.
+\end_layout
+
+\begin_layout Section
+Interlude: Python in the real world
+\begin_inset OptArg
+status collapsed
+
+\begin_layout Standard
+Examples
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+EEG analysis for epilepsy
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+EEG
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+Data analysis for epilepsy surgery
+\end_layout
+
+\begin_layout FrameSubtitle
+Isolating the origin of drug-resistant epileptic seizures which require
+ surgery.
+\end_layout
+
+\begin_layout Standard
+John Hunter, Department of Pediatric Neurology, University of Chicago.
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/mpl_brain1.png
+ lyxscale 50
+ width 80text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+Electrode location in 3D, combined with MRI data
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/mpl_brain3.png
+ lyxscale 50
+ width 90text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+Correlation analysis of seizure data
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/mpl_brain4.png
+ lyxscale 50
+ width 90text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+Final location of epileptic foci for surgery
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/mpl_brain5.png
+ lyxscale 50
+ width 90text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Multiwavelets for PDEs
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+PDEs
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginFrame
+Adaptive, multiwavelet algorithms for integral operators
+\end_layout
+
+\begin_layout Standard
+Gregory Beylkin, Vani Cheruvu, Fernando Perez.
+ Applied Math, U.
+ of Colorado at Boulder.
+\end_layout
+
+\begin_layout Itemize
+Fast application of integral kernels.
+ (Partial Differential Equations)
+\end_layout
+
+\begin_layout Itemize
+Implementation went from 1 to 3 dimensions directly (
+\emph on
+extremely
+\emph default
+ unusual).
+\end_layout
+
+\begin_layout Itemize
+Very complex algorithm that goes beyond pure numerics.
+\end_layout
+
+\begin_layout Itemize
+Very good performance, thanks to NumPy, F2PY and weave.
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/rho_2d_surf.png
+ lyxscale 80
+ width 35text%
+
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+hspace{1cm}
+\end_layout
+
+\end_inset
+
+
+\begin_inset Graphics
+ filename fig/rho_2d_skel.eps
+ lyxscale 80
+ width 25text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+JPL: Mars mission data visualization
+\begin_inset OptArg
+status collapsed
+
+\begin_layout Standard
+JPL - Mars
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+JPL: Mars mission trajectory design and nav data
+\end_layout
+
+\begin_layout FrameSubtitle
+Ted Drain and Lynn Craig, Jet Propulsion Laboratory (NASA/Caltech)
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size footnotesize
+From: Name Elided <nam...@jp...>
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size footnotesize
+Date: Oct 2, 2007 7:15 PM
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size footnotesize
+Subject: Fwd: matplotlib bug numbers
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size footnotesize
+To: John Hunter <jd...@gm...>
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+vspace{5mm}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size tiny
+One of my lead developers mentioned that they had sent a bug to you about
+ the annotations feature of MatPlotLib.
+ Would you be able to let me know what the timeline is to resolve that bug?
+ The reason is that the feature is needed for the Phoenix project and their
+ arrival at Mars will be in March sometime, but they are doing their testing
+ in the coming few months.
+ This annotation feature is used on reports that present the analysis of
+ the trajectory to the navigation team and it shows up on our schedule.
+ It would really help me to know approximately when it could be resolved.
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size tiny
+B-plane plots are used to show the trajectory of a spacecraft with respect
+ to the target body (specifically perpendicular to the incoming asymptote
+ of the spacecraft trajectory) and we plot them with the y-axis inverted.
+ The plot is used heavily in flight operations so it is important to our
+ customers.
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size tiny
+In addition, we have what is called a thundering heard plot where many different
+ trajectory solutions (determined from different measurement sources) are
+ plotted together.
+ The annotations are import there so we can see which plot corresponds to
+ each source of data.
+ I hope it helps to know how your code will be used in spacecraft navigation.
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size tiny
+Thanks for all your efforts.
+\end_layout
+
+\begin_layout BeginPlainFrame
+JPL: Mars mission data visualization
+\end_layout
+
+\begin_layout Standard
+Expected communication power levels between an orbiting spacecraft and a
+ lander as it goes through the atmosphere:
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/jpl_lander_comm_power.png
+ lyxscale 25
+ width 90text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+JPL: Mars mission data visualization (2)
+\end_layout
+
+\begin_layout Standard
+Summary of the current navigation team activities and modelling (data used,
+ event times etc):
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+vspace{-3mm}
+\end_layout
+
+\end_inset
+
+
+\begin_inset Graphics
+ filename fig/jpl_nav_summary.png
+ lyxscale 50
+ width 90text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+PMV: structural bioinformatics
+\begin_inset OptArg
+status collapsed
+
+\begin_layout Standard
+PMV
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+PMV: the Python Molecule Viewer
+\end_layout
+
+\begin_layout FrameSubtitle
+Michel F.
+ Sanner, Molecular Biology Department, The Scripps Research Institute.
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/pmv.png
+ lyxscale 50
+ width 100text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+MayaVi: customizable data visualization
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+MayaVi
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginFrame
+MayaVi: sophisticated data visualization
+\end_layout
+
+\begin_layout Itemize
+Free, easy to use scientific data visualizer.
+\end_layout
+
+\begin_layout Itemize
+Heavy lifting of OpenGL-based rendering: VTK (a C++ library).
+\end_layout
+
+\begin_layout Itemize
+A very good example of how to properly use Python:
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+MayaVi is a standalone GUI program...
+\end_layout
+
+\begin_layout Itemize
+but also a Python library callable by any other Python program.
+\end_layout
+
+\begin_layout Itemize
+Python: very easy to modify, even by adding at runtime user-defined modules
+ which populate the GUI automatically.
+\end_layout
+
+\begin_layout Itemize
+C++: excellent rendering performance, fully hardware-accelerated OpenGL.
+\end_layout
+
+\end_deeper
+\begin_layout Pause
+
+\end_layout
+
+\begin_layout Standard
+
+\series bold
+\color blue
+The punchline:
+\series default
+\color none
+ fully programmable visualization, with builtin access to all kinds of numerical
+ (and other) libraries from within the viz tool.
+\end_layout
+
+\begin_layout BeginPlainFrame
+FluidLab: a MayaVi based CFD visualization tool
+\end_layout
+
+\begin_layout Standard
+K.
+ Julien, P.
+ Schmitt (now NCAR), B.
+ Barrow, F.
+ Pérez (App.
+ Math, CU).
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/Fluidlab5.png
+ lyxscale 50
+ width 90text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+Volumetric rendering with FluidLab
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/Fluidlab6.png
+ lyxscale 50
+ width 90text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+SAGE: System for Algebra and Geometry Experimentation
+\begin_inset OptArg
+status collapsed
+
+\begin_layout Standard
+SAGE
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+SAGE: open source mathematics
+\end_layout
+
+\begin_layout FrameSubtitle
+Winner of the 2007 Trophés du Libre, scientific software category
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/sage_notebook-medium.jpg
+ lyxscale 50
+ width 90text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+IPython
+\end_layout
+
+\begin_layout BeginFrame
+IPython
+\end_layout
+
+\begin_layout FrameSubtitle
+Extensible interactive environment with parallel computing support
+\end_layout
+
+\begin_layout Enumerate
+
+\color blue
+A better Python shell
+\color none
+: object introspection, system access, 'magic' command system for adding
+ functionality when working interactively,
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+ldots
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+
+\color blue
+An embeddable interpreter
+\color none
+: useful for debugging and for mixing batch-processing with interactive
+ work.
+\end_layout
+
+\begin_layout Enumerate
+
+\color blue
+A flexible component
+\color none
+: you can use it as the base environment for other systems with Python as
+ the underlying language.
+ It is very configurable in this direction.
+\end_layout
+
+\begin_layout Enumerate
+
+\color blue
+A system for interactive control of distributed/parallel computing systems.
+
+\color none
+
+\end_layout
+
+\begin_layout Enumerate
+
+\color blue
+An interactive component
+\color none
+ we can plug into GUIs, browser-based shells, etc.
+\end_layout
+
+\begin_layout BeginPlainFrame
+IPython: IDL-like interactive use
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/pylab-screen.png
+ lyxscale 30
+ width 90text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+IPython: interactive control of VTK visualizations
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/mlab-screen-black.png
+ lyxscale 50
+ width 90text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginFrame
+IPython's future
+\end_layout
+
+\begin_layout FrameSubtitle
+A 2-process kernel on the network
+\end_layout
+
+\begin_layout Standard
+Work with Brian Granger (Tech-X, Boulder) and Benjamin Ragan-Kelley (U.
+ C.
+ Berkeley physics).
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/kernel2p.png
+ lyxscale 50
+ width 80text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginFrame
+Distributed/parallel computing
+\end_layout
+
+\begin_layout Itemize
+Think of Python as 'the CPU'
+\end_layout
+
+\begin_layout Itemize
+But these souped-up kernels let you talk to it conveniently.
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/ipython_parallel.png
+ lyxscale 50
+ width 80text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+PyNGL
+\end_layout
+
+\begin_layout BeginPlainFrame
+PyNGL - Python interface to NCAR's NCL
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+import
+\family default
+\color none
+
+\family typewriter
+\color blue
+numpy
+\color none
+, Ngl, Nio
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+dirc = Ngl.pynglpath("data")
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+cfile = Nio.open_file(dirc + "/cdf/seam.nc")
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+lon =
+\family default
+\color none
+
+\family typewriter
+\color blue
+numpy
+\color none
+.ravel(cfile.variables["lon2d"][:,:])
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+lat =
+\family default
+\color none
+
+\family typewriter
+\color blue
+numpy
+\color none
+.ravel(cfile.variables["lat2d"][:,:])
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+ps =
+\family default
+\color none
+
+\family typewriter
+\color blue
+numpy
+\color none
+.ravel(cfile.variables["ps"][0,:,:])/100.
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+rlist = Ngl.Resources()
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+rlist.wkColorMap = "BlAqGrYeOrReVi200"
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+wks_type = "ps"
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+wks = Ngl.open_wks(wks_type,"seam",rlist)
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+resources = Ngl.Resources()
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+resources.sfXArray = lon
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+resources.sfYArray = lat
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+map = Ngl.contour_map(wks,ps,resources)
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+Ngl.end()
+\end_layout
+
+\begin_layout BeginFrame
+PyNGL
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/ncar-world-seam.3.png
+ lyxscale 50
+ width 90text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection*
+Others
+\end_layout
+
+\begin_layout BeginFrame
+A few other projects
+\end_layout
+
+\begin_layout FrameSubtitle
+Python is becoming very popular in many different scientific areas
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+PyDAP:
+\color none
+ Python implementation of the OpenDAP protocols (client
+\series bold
+and
+\series default
+ server).
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+PyTables:
+\color none
+ HDF-5 read-write support with excellent performance.
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+PyTrilinos:
+\color none
+ Python interface to Sandia's Trilinos parallel solvers.
+ Coupled with IPython, they can be used interactively.
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+PyRAF:
+\color none
+ Hubble Space Telescope interface to IRAF, a standard in astronomical image
+ processing.
+
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+VPython:
+\color none
+ easy, real-time 3D programming (Carnegie Mellon, used for an introductory
+ mechanics course).
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+Galaxy:
+\color none
+ integrated access to multiple tools in genomics research.
+
+\color blue
+Very impressive
+\color none
+.
+\end_layout
+
+\begin_layout Section
+Development in Python
+\begin_inset OptArg
+status collapsed
+
+\begin_layout Standard
+Development\InsetSpace ~
+Model
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+Python compared to IDL, Matlab, etc.
+\end_layout
+
+\begin_layout ExampleBlock
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+<+->{Pros}
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout ExampleBlock
+A general programming language:
+\series bold
+this is a feature
+\series default
+!
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+Free, open source, extremely portable: from the OLPC or a cellphone (Nokia)
+ to a supercomputer.
+\end_layout
+
+\begin_layout Itemize
+Networking, text processing, XML parsing, databases, etc
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+ldots
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+Integrated support for testing (
+\family typewriter
+unittest
+\family default
+,
+\family typewriter
+doctest
+\family default
+)
+\end_layout
+
+\begin_layout Itemize
+Automatic API documentation tools (
+\family typewriter
+epydoc, doxygen
+\family default
+).
+\end_layout
+
+\begin_layout Itemize
+Supports all major GUI toolkits.
+\end_layout
+
+\begin_layout Itemize
+Extremely expressive for complex algorithms.
+\end_layout
+
+\end_deeper
+\begin_layout Separator
+
+\end_layout
+
+\begin_layout AlertBlock
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+<+->{There are still rough edges!}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+Installation, deployment: harder than needed (but improving).
+\end_layout
+
+\begin_layout Itemize
+No good, single-point of entry integrated help system.
+\end_layout
+
+\begin_layout Itemize
+Lots of good documentation, but scattered all over.
+\end_layout
+
+\begin_layout Itemize
+Funding agency support for infrastructure work is difficult to get.
+\end_layout
+
+\end_deeper
+\begin_layout BeginFrame
+A different model of development
+\end_layout
+
+\begin_layout FrameSubtitle
+
+\emph on
+\color red
+Global optimization is the root of all evil
+\end_layout
+
+\begin_layout Itemize
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+<+->
+\end_layout
+
+\end_inset
+
+Never write `
+\family typewriter
+main()
+\family default
+' in C anymore:
+\color none
+
+\color red
+you are optimizing globally!
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+Prototype the code in Python.
+\end_layout
+
+\begin_layout Itemize
+Wrap existing libraries for Python access and reuse them (Numeric, LAPACK,
+ VTK, ...)
+\end_layout
+
+\begin_layout Itemize
+Identify remaining hot spots via
+\color none
+
+\color blue
+profiling
+\color none
+.
+\end_layout
+
+\begin_layout Itemize
+Rewrite
+\color none
+
+\color blue
+only
+\color none
+ the code for those hot spots in C/C++/FORTRAN.
+\end_layout
+
+\end_deeper
+\begin_layout Itemize
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+<+->
+\end_layout
+
+\end_inset
+
+The resulting code will be production-ready:
+\color none
+
+\color blue
+no throw-away codes
+\color none
+.
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+Make your code available as a library for
+\color none
+
+\color blue
+interactive use
+\color none
+.
+\end_layout
+
+\begin_layout Itemize
+Integrate plotting, visualization, logging, ..., into your objects.
+\end_layout
+
+\end_deeper
+\begin_layout Itemize
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+<+->
+\end_layout
+
+\end_inset
+
+
+\color blue
+Apply this to existing codes
+\color none
+
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+Break them into a library core and control layers.
+\end_layout
+
+\begin_layout Itemize
+Wrap the libraries and expose them to Python.
+\end_layout
+
+\begin_layout Itemize
+Write all new control as quick, light Python scripts.
+\end_layout
+
+\end_deeper
+\begin_layout Section*
+Wrapup
+\end_layout
+
+\begin_layout BeginFrame
+Summary
+\end_layout
+
+\begin_layout Itemize
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+<+->
+\end_layout
+
+\end_inset
+
+
+\color blue
+Python
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+An excellent language for scientific computing development.
+\end_layout
+
+\begin_layout Itemize
+Scales from interactive exploration to full-blown production codes.
+\end_layout
+
+\begin_layout Itemize
+Accessible to scientists who are not professional programmers.
+\end_layout
+
+\end_deeper
+\begin_layout Standard
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+vskip0pt plus.5fill
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+<+->
+\end_layout
+
+\end_inset
+
+
+\color red
+Outlook
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+NumPy, SciPy, matplotlib, IPython, MayaVi, Sage, etc
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+ldots
+\end_layout
+
+\end_inset
+
+:
+\series bold
+all
+\series default
+are moving forward and improving.
+\end_layout
+
+\begin_layout Itemize
+Major DOE, NSF, NiH projects are adopting it as a core technology.
+\end_layout
+
+\begin_layout Itemize
+Yearly conference at Caltech (August) growing.
+\end_layout
+
+\begin_layout Itemize
+These projects are all Open Source: if you find a flaw, a bug, or a missing
+ feature,
+\color none
+
+\emph on
+\color blue
+jump on board!
+\end_layout
+
+\begin_layout Itemize
+There are still many rough edges to which various projects can contribute.
+\end_layout
+
+\end_deeper
+\begin_layout BeginPlainFrame
+Thank you! Questions?
+\end_layout
+
+\begin_layout FrameSubtitle
+Credit: http://xkcd.com/353
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+vspace{-5mm}
+\end_layout
+
+\end_inset
+
+
+\begin_inset Graphics
+ filename fig/xkcd_python.png
+ lyxscale 50
+ height 85pheight%
+ BoundingBox -4bp -4bp 518bp 588bp
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+
+\end_layout
+
+\begin_layout Standard
+\align center
+
+\series bold
+\size largest
+\color blue
+We're done here!
+\end_layout
+
+\begin_layout EndFrame
+
+\end_layout
+
+\begin_layout Section*
+\start_of_appendix
+\begin_inset Note Note
+status collapsed
+
+\begin_layout Standard
+All of the following is optional and typically not needed.
+\end_layout
+
+\end_inset
+
+Appendix
+\end_layout
+
+\begin_layout Subsection*
+URLs
+\end_layout
+
+\begin_layout BeginFrame
+Some useful URLs
+\end_layout
+
+\begin_layout Itemize
+A collection of links on Python and Scientific Computing:
+\color blue
+
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://amath.colorado.edu/faculty/fperez/python/scicomp"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+SciPy:
+\color none
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://www.scipy.org"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+IPython, an improved interactive shell
+\color blue
+:
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://ipython.scipy.org"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+Matplotlib, 2d plotting with Matlab syntax
+\color blue
+:
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://matplotlib.sourceforge.net"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+MayaVi, 3d data visualization:
+\color blue
+
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://mayavi.sourceforge.net"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+PyX, programmatic PostScript generation (with
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+LaTeX
+\end_layout
+
+\end_inset
+
+ support)
+\color blue
+:
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://pyx.sourceforge.net"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+F2Py (FORTRAN):
+\color none
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://cens.ioc.ee/projects/f2py2e"
+
+\end_inset
+
+
+\color none
+
+\end_layout
+
+\begin_layout Itemize
+SWIG (C/C++ for Python):
+\color none
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://swig.org"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginFrame
+URLs for projects mentioned earlier
+\end_layout
+
+\begin_layout Itemize
+VPython, real-time 3D:
+\color none
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://vpython.org"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+UCSF Chimera - interactive molecular graphics
+\color blue
+:
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://www.cgl.ucsf.edu/chimera"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+PyRAF - Hubble Space Telescope interface to IRAF
+\color blue
+:
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://www.stsci.edu/resources/software_hardware/pyraf"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+BioPython -
+\color none
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://biopython.org"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+VisionEgg - vision research experiments (OpenGL):
+\color blue
+
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://www.visionegg.org"
+
+\end_inset
+
+
+\color none
+
+\end_layout
+
+\begin_layout Itemize
+Natural Language Toolkit:
+\newline
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://nltk.sourceforge.net"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+Neural Integrator - visual programming for neural networks:
+\newline
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://starship.python.net/crew/seehof/NeuralPython.html"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+Orange - component-based data mining:
+\newline
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://www.ailab.si/orange"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout EndFrame
+
+\end_layout
+
+\end_body
+\end_document
Copied: trunk/py4science/talks/0810_berkeley_intro.lyx (from rev 6308, trunk/py4science/intro_talk/0810_berkeley_intro.lyx)
===================================================================
--- trunk/py4science/talks/0810_berkeley_intro.lyx (rev 0)
+++ trunk/py4science/talks/0810_berkeley_intro.lyx 2008-10-25 03:37:12 UTC (rev 6330)
@@ -0,0 +1,2274 @@
+#LyX 1.5.5 created this file. For more info see http://www.lyx.org/
+\lyxformat 276
+\begin_document
+\begin_header
+\textclass beamer
+\begin_preamble
+% Include only certain frames - this speeds up compilation
+% The frames to be included need to be labeled, by using ERT
+% as [label=LABELNAME] (no backslashes or {})
+%\includeonlyframes{currentt}
+
+% To make a printable handout (one page per frame), pass
+% the handout option to the doc class (Layout menu)
+
+% For good fonts in PDFs, use pslatex fonts (Layout menu)
+
+% Colors and symbols
+\usepackage{latexsym}
+\usepackage{color}
+
+% Display covered items in transparent form (as opposed
+% to not showing them at all)
+\newcommand{\coveredinvisible}{
+ \setbeamercovered{invisible}
+}
+\newcommand{\coveredvisible}{
+ \setbeamercovered{highly dynamic}
+}
+
+% Choose default setting here:
+\coveredvisible
+
+\newcommand{\ps}{\vspace{-4mm} }
+
+% Theme configuration. I've basically built a custom theme out of
+% Warsaw, adding infoline and changing the nav. symbol bar
+
+% Warning: the commands below are order-sensitive!
+
+% load the infolines theme, b/c I want the headline Warsaw
+% uses (split), but the footline from infolines.
+% In the document body, these will be deactivated for the title and
+% turned on later
+\useoutertheme{infolines}
+% Main theme
+\usetheme{Warsaw}
+% Adjust the color for the center (title) box to be that of
+% infolines, which Warsaw changes
+\setbeamercolor*{title in head/foot}{parent=palette secondary}
+
+% Define a minimal set of navigation symbols
+\defbeamertemplate*{navigat...
[truncated message content] |
|
From: <ef...@us...> - 2008-10-24 22:35:34
|
Revision: 6329
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6329&view=rev
Author: efiring
Date: 2008-10-24 22:35:25 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
Another typo bug in recent commit for shared axes support
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-10-24 18:16:12 UTC (rev 6328)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-10-24 22:35:25 UTC (rev 6329)
@@ -831,7 +831,7 @@
if self._sharey is not None:
self.yaxis.major = self._sharey.yaxis.major
self.yaxis.minor = self._sharey.yaxis.minor
- y0, y1 = self._sharex.get_ylim()
+ y0, y1 = self._sharey.get_ylim()
self.set_ylim(y0, y1, emit=False)
self.yaxis.set_scale(self._sharey.yaxis.get_scale())
else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-10-24 18:22:09
|
Revision: 6325
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6325&view=rev
Author: mdboom
Date: 2008-10-24 17:35:50 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
Update some statuses.
Modified Paths:
--------------
trunk/matplotlib/doc/devel/outline.rst
Modified: trunk/matplotlib/doc/devel/outline.rst
===================================================================
--- trunk/matplotlib/doc/devel/outline.rst 2008-10-24 17:35:39 UTC (rev 6324)
+++ trunk/matplotlib/doc/devel/outline.rst 2008-10-24 17:35:50 UTC (rev 6325)
@@ -131,7 +131,7 @@
image needs conversion
legend needs conversion
lines needs conversion
-mathtext needs conversion
+mathtext Mike converted
mlab needs conversion
mpl needs conversion
patches Mike converted
@@ -144,7 +144,7 @@
table needs conversion
texmanager Darren needs conversion
text Mike converted
-ticker Mike needs conversion
+ticker John converted
transforms Mike converted
type1font needs conversion
units needs conversion
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-10-24 18:16:22
|
Revision: 6328
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6328&view=rev
Author: mdboom
Date: 2008-10-24 18:16:12 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
Fix docstring.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/contour.py
Modified: trunk/matplotlib/lib/matplotlib/contour.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/contour.py 2008-10-24 17:58:47 UTC (rev 6327)
+++ trunk/matplotlib/lib/matplotlib/contour.py 2008-10-24 18:16:12 UTC (rev 6328)
@@ -53,8 +53,6 @@
*fontsize*:
See http://matplotlib.sf.net/fonts.html
- .. TODO: Update this link to new fonts document
-
*colors*:
- if *None*, the color of each label matches the color of
the corresponding contour
@@ -1050,8 +1048,8 @@
Call signature::
- conmin,segmin,imin,xmin,ymin,dmin = find_nearest_contour(
- self, x, y, indices=None, pixel=True )
+ conmin,segmin,imin,xmin,ymin,dmin = find_nearest_contour(
+ self, x, y, indices=None, pixel=True )
Optional keyword arguments::
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-10-24 17:58:54
|
Revision: 6327
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6327&view=rev
Author: jswhit
Date: 2008-10-24 17:58:47 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
defer import of netcdf module
Modified Paths:
--------------
trunk/toolkits/basemap/Changelog
Modified: trunk/toolkits/basemap/Changelog
===================================================================
--- trunk/toolkits/basemap/Changelog 2008-10-24 17:40:54 UTC (rev 6326)
+++ trunk/toolkits/basemap/Changelog 2008-10-24 17:58:47 UTC (rev 6327)
@@ -1,4 +1,6 @@
version 0.99.2 (not yet released)
+ * defer import of netcdf stuff till it is needed (in NetCDFFile
+ function).
* Added McBryde-Thomas Flat Polar Quartic (projection =
'mbtfpq'), Gall Stereographic Cylindrical (projection =
'gall') and van der Grinten (projection = 'vandg').
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-10-24 17:40:59
|
Revision: 6326
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6326&view=rev
Author: efiring
Date: 2008-10-24 17:40:54 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
Fix error in recent shared axes changes; thanks to David Trem.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-10-24 17:35:50 UTC (rev 6325)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-10-24 17:40:54 UTC (rev 6326)
@@ -512,8 +512,8 @@
self._adjustable = 'datalim'
if sharey is not None:
self._shared_y_axes.join(self, sharey)
- if sharex._adjustable == 'box':
- sharex._adjustable = 'datalim'
+ if sharey._adjustable == 'box':
+ sharey._adjustable = 'datalim'
#warnings.warn(
# 'shared axes: "adjustable" is being changed to "datalim"')
self._adjustable = 'datalim'
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-10-24 17:35:42
|
Revision: 6324
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6324&view=rev
Author: mdboom
Date: 2008-10-24 17:35:39 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
Add mathtext api to toc
Modified Paths:
--------------
trunk/matplotlib/doc/api/index.rst
Modified: trunk/matplotlib/doc/api/index.rst
===================================================================
--- trunk/matplotlib/doc/api/index.rst 2008-10-24 17:35:23 UTC (rev 6323)
+++ trunk/matplotlib/doc/api/index.rst 2008-10-24 17:35:39 UTC (rev 6324)
@@ -23,6 +23,7 @@
colorbar_api.rst
colors_api.rst
nxutils_api.rst
+ mathtext_api.rst
mlab_api.rst
path_api.rst
pyplot_api.rst
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-10-24 17:35:26
|
Revision: 6323
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6323&view=rev
Author: mdboom
Date: 2008-10-24 17:35:23 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
Minor docstring fix.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/figure.py
Modified: trunk/matplotlib/lib/matplotlib/figure.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/figure.py 2008-10-24 17:12:24 UTC (rev 6322)
+++ trunk/matplotlib/lib/matplotlib/figure.py 2008-10-24 17:35:23 UTC (rev 6323)
@@ -280,15 +280,18 @@
Add a centered title to the figure.
kwargs are :class:`matplotlib.text.Text` properties. Using figure
- coordinates, the defaults are::
+ coordinates, the defaults are:
- *x* = 0.5
+ - *x* = 0.5
the x location of text in figure coords
- *y* = 0.98
+
+ - *y* = 0.98
the y location of the text in figure coords
- *horizontalalignment* = 'center'
+
+ - *horizontalalignment* = 'center'
the horizontal alignment of the text
- *verticalalignment* = 'top'
+
+ - *verticalalignment* = 'top'
the vertical alignment of the text
A :class:`matplotlib.text.Text` instance is returned.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-10-24 17:12:29
|
Revision: 6322
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6322&view=rev
Author: mdboom
Date: 2008-10-24 17:12:24 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
Add mathtext API docs.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/mathtext.py
Added Paths:
-----------
trunk/matplotlib/doc/api/mathtext_api.rst
Added: trunk/matplotlib/doc/api/mathtext_api.rst
===================================================================
--- trunk/matplotlib/doc/api/mathtext_api.rst (rev 0)
+++ trunk/matplotlib/doc/api/mathtext_api.rst 2008-10-24 17:12:24 UTC (rev 6322)
@@ -0,0 +1,14 @@
+*******************
+matplotlib mathtext
+*******************
+
+.. inheritance-diagram:: matplotlib.mathtext
+ :parts: 1
+
+:mod:`matplotlib.mathtext`
+=============================
+
+.. automodule:: matplotlib.mathtext
+ :members:
+ :undoc-members:
+ :show-inheritance:
Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mathtext.py 2008-10-24 15:53:59 UTC (rev 6321)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py 2008-10-24 17:12:24 UTC (rev 6322)
@@ -1,175 +1,21 @@
r"""
+:mod:`~matplotlib.mathtext` is a module for parsing a subset of the
+TeX math syntax and drawing them to a matplotlib backend.
-OVERVIEW
+For a tutorial of its usage see :ref:`mathtext-tutorial`. This
+document is primarily concerned with implementation details.
- mathtext is a module for parsing TeX expressions and drawing them
- into a matplotlib.ft2font image buffer. You can draw from this
- buffer into your backend.
+The module uses pyparsing_ to parse the TeX expression.
- A large set of the TeX symbols are provided (see below).
- Subscripting and superscripting are supported, as well as the
- over/under style of subscripting with \sum, \int, etc.
+.. _pyparsing: http://pyparsing.wikispaces.com/
- The module uses pyparsing to parse the TeX expression, an so can
- handle fairly complex TeX expressions Eg, the following renders
- correctly
+The Bakoma distribution of the TeX Computer Modern fonts, and STIX
+fonts are supported. There is experimental support for using
+arbitrary fonts, but results may vary without proper tweaking and
+metrics for those fonts.
- s = r'$\mathcal{R}\prod_{i=\alpha\mathcal{B}}^\infty a_i\sin(2 \pi f x_i)$'
-
- Different fonts may be selected:
- \mathcal Calligraphic fonts
- \mathrm Roman (upright) font
- \mathit Italic font
- \mathtt Typewriter (monospaced) font, similar to Courier
-
- Additionally, if using the STIX fonts:
- \mathbb Blackboard (double-struck) font
- \mathcircled Circled characters
- \mathfrak Fraktur (Gothic-style) font
- \mathscr Script (cursive) font
- \mathsf Sans-serif font
-
- The following accents are provided: \hat, \breve, \grave, \bar,
- \acute, \tilde, \vec, \dot, \ddot. All of them have the same
- syntax, eg to make an overbar you do \bar{o} or to make an o umlaut
- you do \ddot{o}. The shortcuts are also provided, eg: \"o \'e \`e
- \~n \.x \^y
-
- The spacing elements \ , \/ and \hspace{num} are provided. \/
- inserts a small space, and \hspace{num} inserts a fraction of the
- current fontsize. Eg, if num=0.5 and the fontsize is 12.0,
- hspace{0.5} inserts 6 points of space
-
-
-
- If you find TeX expressions that don't parse or render properly,
- please email me, but please check KNOWN ISSUES below first.
-
-REQUIREMENTS
-
- mathtext requires matplotlib.ft2font. Set BUILD_FT2FONT=True in
- setup.py. See BACKENDS below for a summary of availability by
- backend.
-
-LICENSING:
-
- The computer modern fonts this package uses are part of the BaKoMa
- fonts, which are (now) free for commercial and noncommercial use and
- redistribution; see license/LICENSE_BAKOMA in the matplotlib src
- distribution for redistribution requirements.
-
-USAGE:
-
- See http://matplotlib.sf.net/users/mathtext.html for a tutorial
- introduction.
-
- Any text element (xlabel, ylabel, title, text, etc) can use TeX
- markup, as in
-
- xlabel(r'$\Delta_i$')
- ^
- use raw strings
-
- Math and non-math can be interpresed in the same string. E.g.,
-
- r'My label $x_i$'.
-
- A large set of the TeX symbols are provided. Subscripting and
- superscripting are supported, as well as the over/under style of
- subscripting with \sum, \int, etc.
-
-
- Allowed TeX symbols:
-
- $ \% \AA \AE \BbbC \BbbN \BbbP \BbbQ \BbbR \BbbZ \Bumpeq \Cap \Colon
- \Cup \Delta \Doteq \Downarrow \Equiv \Finv \Gamma \H \Im \L \Lambda
- \Ldsh \Leftarrow \Leftrightarrow \Lleftarrow \Lsh \Nearrow \Nwarrow
- \O \OE \Omega \P \Phi \Pi \Psi \Rdsh \Re \Rightarrow \Rrightarrow
- \Rsh \S \Searrow \Sigma \Subset \Supset \Swarrow \Theta \Uparrow
- \Updownarrow \Upsilon \Vdash \Vert \Vvdash \Xi \_ \__sqrt__ \ac
- \acute \acwopencirclearrow \adots \ae \aleph \alpha \angle \approx
- \approxeq \approxident \arceq \ast \asymp \backcong \backprime
- \backsim \backsimeq \backslash \bar \barleftarrow \barwedge \because
- \beta \beth \between \bigcap \bigcirc \bigcup \bigodot \bigoplus
- \bigotimes \bigstar \bigtriangledown \bigtriangleup \biguplus
- \bigvee \bigwedge \blacksquare \blacktriangle \blacktriangledown
- \blacktriangleleft \blacktriangleright \bot \bowtie \boxbar \boxdot
- \boxminus \boxplus \boxtimes \breve \bullet \bumpeq \c \candra \cap
- \carriagereturn \cdot \cdotp \cdots \check \checkmark \chi \circ
- \circeq \circledR \circledS \circledast \circledcirc \circleddash
- \circumflexaccent \clubsuit \clubsuitopen \colon \coloneq
- \combiningacuteaccent \combiningbreve \combiningdiaeresis
- \combiningdotabove \combininggraveaccent \combiningoverline
- \combiningrightarrowabove \combiningtilde \complement \cong \coprod
- \copyright \cup \cupdot \curlyeqprec \curlyeqsucc \curlyvee
- \curlywedge \curvearrowleft \curvearrowright \cwopencirclearrow \d
- \dag \daleth \danger \dashv \ddag \ddddot \dddot \ddot \ddots
- \degree \delta \diamond \diamondsuit \digamma \div \divideontimes
- \dot \doteq \dotminus \dotplus \dots \doublebarwedge ? \downarrow
- \downdownarrows \downharpoonleft \downharpoonright \downzigzagarrow
- \ell \emdash \emptyset \endash \enspace \epsilon \eqcirc \eqcolon
- \eqdef \eqgtr \eqless \eqsim \equiv \eta \eth \exists \fallingdotseq
- \flat \forall \frakC \frakZ \frown \gamma \geq \geqq \gg \ggg \gimel
- \gneqq \gnsim \grave \greater \gtrdot \gtreqless \gtrless \gtrsim
- \hat \heartsuit \hookleftarrow \hookrightarrow \i \iiint \iint
- \imageof \imath \in \infty \int \intercal \invnot \iota \jmath \k
- \kappa \kernelcontraction \l \lambda \lambdabar \lasp \lbrace
- \lbrack \lceil \leftangle \leftarrow \leftarrowtail \leftbrace
- \leftharpoonaccent \leftharpoondown \leftharpoonup \leftleftarrows
- \leftparen \leftrightarrow \leftrightarrows \leftrightharpoons
- \leftthreetimes \leq \leqq \less \lessdot \lesseqgtr \lessgtr
- \lesssim \lfloor \ll \llcorner \lll \lneqq \lnsim \looparrowleft
- \looparrowright \lq \lrcorner \ltimes \maltese \mapsdown \mapsfrom
- \mapsto \mapsup \measeq \measuredangle \mho \mid \minus \models \mp
- \mu \multimap \nLeftarrow \nLeftrightarrow \nRightarrow \nVDash
- \nVdash \nabla \napprox \natural \ncong \ne \nearrow \neg \nequiv
- \nexists \ngeq \ngtr \ni \nleftarrow \nleftrightarrow \nleq \nless
- \nmid \not \notin \nparallel \nprec \nrightarrow \nsim \nsime
- \nsubset \nsubseteq \nsucc \nsupset \nsupseteq \ntriangleleft
- \ntrianglelefteq \ntriangleright \ntrianglerighteq \nu \nvDash
- \nvdash \nwarrow \o \obar \ocirc \odot \oe \oiiint \oiint \oint
- \omega \ominus \oplus \origof \oslash \otimes \overarc
- \overleftarrow \overleftrightarrow \parallel \partial \phi \pi
- \pitchfork \pm \prec \preccurlyeq \preceq \precnsim \precsim \prime
- \prod \propto \prurel \psi \quad \questeq \rasp \rbrace \rbrack
- \rceil \rfloor \rho \rightangle \rightarrow \rightarrowbar
- \rightarrowtail \rightbrace \rightharpoonaccent \rightharpoondown
- \rightharpoonup \rightleftarrows \rightleftharpoons \rightparen
- \rightrightarrows \rightthreetimes \rightzigzagarrow \risingdotseq
- \rq \rtimes \scrB \scrE \scrF \scrH \scrI \scrL \scrM \scrR \scre
- \scrg \scro \scurel \searrow \sharp \sigma \sim \simeq \slash
- \smallsetminus \smile \solbar \spadesuit \spadesuitopen
- \sphericalangle \sqcap \sqcup \sqsubset \sqsubseteq \sqsupset
- \sqsupseteq \ss \star \stareq \sterling \subset \subseteq \subsetneq
- \succ \succcurlyeq \succeq \succnsim \succsim \sum \supset \supseteq
- \supsetneq \swarrow \t \tau \textasciiacute \textasciicircum
- \textasciigrave \textasciitilde \textexclamdown \textquestiondown
- \textquotedblleft \textquotedblright \therefore \theta \thickspace
- \thinspace \tilde \times \to \top \triangledown \triangleleft
- \trianglelefteq \triangleq \triangleright \trianglerighteq
- \turnednot \twoheaddownarrow \twoheadleftarrow \twoheadrightarrow
- \twoheaduparrow \ulcorner \underbar \uparrow \updownarrow
- \updownarrowbar \updownarrows \upharpoonleft \upharpoonright \uplus
- \upsilon \upuparrows \urcorner \vDash \varepsilon \varkappa
- \varnothing \varphi \varpi \varrho \varsigma \vartheta \vartriangle
- \vartriangleleft \vartriangleright \vdash \vdots \vec \vee \veebar
- \veeeq \vert \wedge \wedgeq \widehat \widetilde \wp \wr \xi \yen
- \zeta \{ \| \}
-
-BACKENDS
-
- mathtext currently works with all backends.
-
-KNOWN ISSUES:
-
- - Certainly there are some...
-
-Author : John Hunter <jdh...@ac...>
- Michael Droettboom <md...@st...>
- (rewrite based on TeX box layout algorithms)
-Copyright : John Hunter (2004,2005)
-License : matplotlib license (PSF compatible)
-
+If you find TeX expressions that don't parse or render properly,
+please email md...@st..., but please check KNOWN ISSUES below first.
"""
from __future__ import division
import os
@@ -214,10 +60,9 @@
def get_unicode_index(symbol):
"""get_unicode_index(symbol) -> integer
-Return the integer index (from the Unicode table) of symbol.
-symbol can be a single unicode character, a TeX command (i.e. r'\pi'),
-or a Type1 symbol name (i.e. 'phi').
-
+Return the integer index (from the Unicode table) of symbol. *symbol*
+can be a single unicode character, a TeX command (i.e. r'\pi'), or a
+Type1 symbol name (i.e. 'phi').
"""
# From UTF #25: U+2212 minus sign is the preferred
# representation of the unary and binary minus sign rather than
@@ -239,32 +84,62 @@
class MathtextBackend(object):
+ """
+ The base class for the mathtext backend-specific code. The
+ purpose of :class:`MathtextBackend` subclasses is to interface
+ between mathtext and a specific matplotlib graphics backend.
+
+ Subclasses need to override the following:
+
+ - :meth:`render_glyph`
+ - :meth:`render_filled_rect`
+ - :meth:`get_results`
+
+ And optionally, if you need to use a Freetype hinting style:
+
+ - :meth:`get_hinting_type`
+ """
def __init__(self):
self.fonts_object = None
def set_canvas_size(self, w, h, d):
- 'Dimension the drawing canvas; may be a noop'
+ 'Dimension the drawing canvas'
self.width = w
self.height = h
self.depth = d
def render_glyph(self, ox, oy, info):
+ """
+ Draw a glyph described by *info* to the reference point (*ox*,
+ *oy*).
+ """
raise NotImplementedError()
def render_filled_rect(self, x1, y1, x2, y2):
+ """
+ Draw a filled black rectangle from (*x1*, *y1*) to (*x2*, *y2*).
+ """
raise NotImplementedError()
def get_results(self, box):
- """Return a backend specific tuple of things to return to the
- backend after all processing is done."""
+ """
+ Return a backend-specific tuple to return to the backend after
+ all processing is done.
+ """
raise NotImplementedError()
def get_hinting_type(self):
+ """
+ Get the Freetype hinting type to use with this particular
+ backend.
+ """
return LOAD_NO_HINTING
class MathtextBackendBbox(MathtextBackend):
- """A backend whose only purpose is to get a precise bounding box.
- Only required for the Agg backend."""
+ """
+ A backend whose only purpose is to get a precise bounding box.
+ Only required for the Agg backend.
+ """
def __init__(self, real_backend):
MathtextBackend.__init__(self)
@@ -310,6 +185,10 @@
self.real_backend.oy = self.bbox[1]
class MathtextBackendAggRender(MathtextBackend):
+ """
+ Render glyphs and rectangles to an FTImage buffer, which is later
+ transferred to the Agg image by the Agg backend.
+ """
def __init__(self):
self.ox = 0
self.oy = 0
@@ -353,9 +232,17 @@
return self.image, self.depth
def MathtextBackendBitmap():
+ """
+ A backend to generate standalone mathtext images. No additional
+ matplotlib backend is required.
+ """
return MathtextBackendBbox(MathtextBackendBitmapRender())
class MathtextBackendPs(MathtextBackend):
+ """
+ Store information to write a mathtext rendering to the PostScript
+ backend.
+ """
def __init__(self):
self.pswriter = StringIO()
self.lastfont = None
@@ -393,6 +280,10 @@
self.fonts_object.get_used_characters())
class MathtextBackendPdf(MathtextBackend):
+ """
+ Store information to write a mathtext rendering to the PDF
+ backend.
+ """
def __init__(self):
self.glyphs = []
self.rects = []
@@ -417,6 +308,10 @@
self.fonts_object.get_used_characters())
class MathtextBackendSvg(MathtextBackend):
+ """
+ Store information to write a mathtext rendering to the SVG
+ backend.
+ """
def __init__(self):
self.svg_glyphs = []
self.svg_rects = []
@@ -442,6 +337,11 @@
self.fonts_object.get_used_characters())
class MathtextBackendCairo(MathtextBackend):
+ """
+ Store information to write a mathtext rendering to the Cairo
+ backend.
+ """
+
def __init__(self):
self.glyphs = []
self.rects = []
@@ -466,7 +366,7 @@
class Fonts(object):
"""
- An abstract base class for fonts that want to render mathtext
+ An abstract base class for a system of fonts to use for mathtext.
The class must be able to take symbol keys and font file names and
return the character metrics. It also delegates to a backend class
@@ -474,11 +374,15 @@
"""
def __init__(self, default_font_prop, mathtext_backend):
- """default_font_prop: A FontProperties object to use for the
- default non-math font, or the base font for Unicode font
- rendering.
- mathtext_backend: A subclass of MathTextBackend used to
- delegate the actual rendering."""
+ """
+ *default_font_prop*: A
+ :class:`~matplotlib.font_manager.FontProperties` object to use
+ for the default non-math font, or the base font for Unicode
+ (generic) font rendering.
+
+ *mathtext_backend*: A subclass of :class:`MathTextBackend`
+ used to delegate the actual rendering.
+ """
self.default_font_prop = default_font_prop
self.mathtext_backend = mathtext_backend
# Make these classes doubly-linked
@@ -486,51 +390,86 @@
self.used_characters = {}
def destroy(self):
- """Fix any cyclical references before the object is about
- to be destroyed."""
+ """
+ Fix any cyclical references before the object is about
+ to be destroyed.
+ """
self.used_characters = None
def get_kern(self, font1, fontclass1, sym1, fontsize1,
font2, fontclass2, sym2, fontsize2, dpi):
"""
- Get the kerning distance for font between sym1 and sym2.
+ Get the kerning distance for font between *sym1* and *sym2*.
- fontX: one of the TeX font names, tt, it, rm, cal, sf, bf or
- default (non-math)
- symX: a symbol in raw TeX form. e.g. '1', 'x' or '\sigma'
- fontsizeX: the fontsize in points
- dpi: the current dots-per-inch
+ *fontX*: one of the TeX font names::
- sym is a single symbol(alphanum, punct) or a special symbol
- like \sigma.
+ tt, it, rm, cal, sf, bf or default (non-math)
+ *fontclassX*: TODO
+
+ *symX*: a symbol in raw TeX form. e.g. '1', 'x' or '\sigma'
+
+ *fontsizeX*: the fontsize in points
+
+ *dpi*: the current dots-per-inch
"""
return 0.
def get_metrics(self, font, font_class, sym, fontsize, dpi):
"""
- font: one of the TeX font names, tt, it, rm, cal, sf, bf or
- default (non-math)
- sym: a symbol in raw TeX form. e.g. '1', 'x' or '\sigma'
- fontsize: font size in points
- dpi: current dots-per-inch
+ *font*: one of the TeX font names::
- advance
- height
- width
- xmin, xmax, ymin, ymax - the ink rectangle of the glyph
- iceberg - the distance from the baseline to the top of the glyph.
- horiBearingY in Truetype parlance, height in TeX parlance
+ tt, it, rm, cal, sf, bf or default (non-math)
+
+ *font_class*: TODO
+
+ *sym*: a symbol in raw TeX form. e.g. '1', 'x' or '\sigma'
+
+ *fontsize*: font size in points
+
+ *dpi*: current dots-per-inch
+
+ Returns an object with the following attributes:
+
+ - *advance*: The advance distance (in points) of the glyph.
+
+ - *height*: The height of the glyph in points.
+
+ - *width*: The width of the glyph in points.
+
+ - *xmin*, *xmax*, *ymin*, *ymax* - the ink rectangle of the glyph
+
+ - *iceberg* - the distance from the baseline to the top of
+ the glyph. This corresponds to TeX's definition of
+ "height".
"""
info = self._get_info(font, font_class, sym, fontsize, dpi)
return info.metrics
def set_canvas_size(self, w, h, d):
- 'Dimension the drawing canvas; may be a noop'
+ """
+ Set the size of the buffer used to render the math expression.
+ Only really necessary for the bitmap backends.
+ """
self.width, self.height, self.depth = ceil(w), ceil(h), ceil(d)
self.mathtext_backend.set_canvas_size(self.width, self.height, self.depth)
def render_glyph(self, ox, oy, facename, font_class, sym, fontsize, dpi):
+ """
+ Draw a glyph at
+
+ - *ox*, *oy*: position
+
+ - *facename*: One of the TeX face names
+
+ - *font_class*:
+
+ - *sym*: TeX symbol name or single character
+
+ - *fontsize*: fontsize in points
+
+ - *dpi*: The dpi to draw at.
+ """
info = self._get_info(facename, font_class, sym, fontsize, dpi)
realpath, stat_key = get_realpath_and_stat(info.font.fname)
used_characters = self.used_characters.setdefault(
@@ -539,31 +478,52 @@
self.mathtext_backend.render_glyph(ox, oy, info)
def render_rect_filled(self, x1, y1, x2, y2):
+ """
+ Draw a filled rectangle from (*x1*, *y1*) to (*x2*, *y2*).
+ """
self.mathtext_backend.render_rect_filled(x1, y1, x2, y2)
def get_xheight(self, font, fontsize, dpi):
+ """
+ Get the xheight for the given *font* and *fontsize*.
+ """
raise NotImplementedError()
def get_underline_thickness(self, font, fontsize, dpi):
+ """
+ Get the line thickness that matches the given font. Used as a
+ base unit for drawing lines such as in a fraction or radical.
+ """
raise NotImplementedError()
def get_used_characters(self):
+ """
+ Get the set of characters that were used in the math
+ expression. Used by backends that need to subset fonts so
+ they know which glyphs to include.
+ """
return self.used_characters
def get_results(self, box):
+ """
+ Get the data needed by the backend to render the math
+ expression. The return value is backend-specific.
+ """
return self.mathtext_backend.get_results(box)
def get_sized_alternatives_for_symbol(self, fontname, sym):
"""
Override if your font provides multiple sizes of the same
- symbol.
+ symbol. Should return a list of symbols matching *sym* in
+ various sizes. The expression renderer will select the most
+ appropriate size for a given situation from this list.
"""
return [(fontname, sym)]
class TruetypeFonts(Fonts):
"""
A generic base class for all font setups that use Truetype fonts
- (through ft2font)
+ (through FT2Font).
"""
class CachedFont:
def __init__(self, font):
@@ -589,8 +549,6 @@
Fonts.destroy(self)
def _get_font(self, font):
- """Looks up a CachedFont with its charmap and inverse charmap.
- font may be a TeX font name (cal, rm, it etc.), or postscript name."""
if font in self.fontmap:
basename = self.fontmap[font]
else:
@@ -611,7 +569,6 @@
return 0.
def _get_info(self, fontname, font_class, sym, fontsize, dpi):
- 'load the cmfont, metrics and glyph with caching'
key = fontname, font_class, sym, fontsize, dpi
bunch = self.glyphd.get(key)
if bunch is not None:
@@ -665,8 +622,9 @@
return xHeight
def get_underline_thickness(self, font, fontsize, dpi):
- # This function used to grab underline thickness from the font,
- # but that information is just too un-reliable, so it is now hardcoded.
+ # This function used to grab underline thickness from the font
+ # metrics, but that information is just too un-reliable, so it
+ # is now hardcoded.
return ((0.75 / 12.0) * fontsize * dpi) / 72.0
def get_kern(self, font1, fontclass1, sym1, fontsize1,
@@ -681,7 +639,10 @@
class BakomaFonts(TruetypeFonts):
"""
- Use the Bakoma true type fonts for rendering
+ Use the Bakoma TrueType fonts for rendering.
+
+ Symbols are strewn about a number of font files, each of which has
+ its own proprietary 8-bit encoding.
"""
_fontmap = { 'cal' : 'cmsy10',
'rm' : 'cmr10',
@@ -788,15 +749,19 @@
_size_alternatives[alias] = _size_alternatives[target]
def get_sized_alternatives_for_symbol(self, fontname, sym):
- alternatives = self._size_alternatives.get(sym)
- if alternatives:
- return alternatives
- return [(fontname, sym)]
+ return self._size_alternatives.get(sym, [(fontname, sym)])
class UnicodeFonts(TruetypeFonts):
- """An abstract base class for handling Unicode fonts.
"""
+ An abstract base class for handling Unicode fonts.
+ While some reasonably complete Unicode fonts (such as DejaVu) may
+ work in some situations, the only Unicode font I'm aware of with a
+ complete set of math symbols is STIX.
+
+ This class will "fallback" on the Bakoma fonts when a required
+ symbol can not be found in the font.
+ """
fontmap = {}
use_cmex = True
@@ -900,7 +865,15 @@
class StixFonts(UnicodeFonts):
"""
- A font handling class for the STIX fonts
+ A font handling class for the STIX fonts.
+
+ In addition to what UnicodeFonts provides, this class:
+
+ - supports "virtual fonts" which are complete alpha numeric
+ character sets with different font styles at special Unicode
+ code points, such as "Blackboard".
+
+ - handles sized alternative characters for the STIXSizeX fonts.
"""
_fontmap = { 'rm' : 'STIXGeneral',
'it' : 'STIXGeneral:italic',
@@ -994,7 +967,7 @@
class StixSansFonts(StixFonts):
"""
- A font handling class for the STIX fonts (using sans-serif
+ A font handling class for the STIX fonts (that uses sans-serif
characters by default).
"""
_sans = True
@@ -1187,9 +1160,9 @@
pass
class Node(object):
- """A node in the TeX box model
- node133
"""
+ A node in the TeX box model
+ """
def __init__(self):
self.size = 0
@@ -1203,21 +1176,26 @@
return 0.0
def shrink(self):
- """Shrinks one level smaller. There are only three levels of sizes,
- after which things will no longer get smaller."""
+ """
+ Shrinks one level smaller. There are only three levels of
+ sizes, after which things will no longer get smaller.
+ """
self.size += 1
def grow(self):
- """Grows one level larger. There is no limit to how big something
- can get."""
+ """
+ Grows one level larger. There is no limit to how big
+ something can get.
+ """
self.size -= 1
def render(self, x, y):
pass
class Box(Node):
- """Represents any node with a physical location.
- node135"""
+ """
+ Represents any node with a physical location.
+ """
def __init__(self, width, height, depth):
Node.__init__(self)
self.width = width
@@ -1255,15 +1233,16 @@
Box.__init__(self, width, 0., 0.)
class Char(Node):
- """Represents a single character. Unlike TeX, the font
- information and metrics are stored with each Char to make it
- easier to lookup the font metrics when needed. Note that TeX
- boxes have a width, height, and depth, unlike Type1 and Truetype
- which use a full bounding box and an advance in the x-direction.
- The metrics must be converted to the TeX way, and the advance (if
- different from width) must be converted into a Kern node when the
- Char is added to its parent Hlist.
- node134"""
+ """
+ Represents a single character. Unlike TeX, the font information
+ and metrics are stored with each :class:`Char` to make it easier
+ to lookup the font metrics when needed. Note that TeX boxes have
+ a width, height, and depth, unlike Type1 and Truetype which use a
+ full bounding box and an advance in the x-direction. The metrics
+ must be converted to the TeX way, and the advance (if different
+ from width) must be converted into a :class:`Kern` node when the
+ :class:`Char` is added to its parent :class:`Hlist`.
+ """
def __init__(self, c, state):
Node.__init__(self)
self.c = c
@@ -1294,9 +1273,11 @@
return self._metrics.slanted
def get_kerning(self, next):
- """Return the amount of kerning between this and the given
+ """
+ Return the amount of kerning between this and the given
character. Called when characters are strung together into
- Hlists to create Kern nodes."""
+ :class:`Hlist` to create :class:`Kern` nodes.
+ """
advance = self._metrics.advance - self.width
kern = 0.
if isinstance(next, Char):
@@ -1307,7 +1288,9 @@
return advance + kern
def render(self, x, y):
- """Render the character to the canvas"""
+ """
+ Render the character to the canvas
+ """
self.font_output.render_glyph(
x, y,
self.font, self.font_class, self.c, self.fontsize, self.dpi)
@@ -1328,9 +1311,11 @@
self.depth *= GROW_FACTOR
class Accent(Char):
- """The font metrics need to be dealt with differently for accents,
+ """
+ The font metrics need to be dealt with differently for accents,
since they are already offset correctly from the baseline in
- TrueType fonts."""
+ TrueType fonts.
+ """
def _update_metrics(self):
metrics = self._metrics = self.font_output.get_metrics(
self.font, self.font_class, self.c, self.fontsize, self.dpi)
@@ -1347,14 +1332,17 @@
self._update_metrics()
def render(self, x, y):
- """Render the character to the canvas"""
+ """
+ Render the character to the canvas.
+ """
self.font_output.render_glyph(
x - self._metrics.xmin, y + self._metrics.ymin,
self.font, self.font_class, self.c, self.fontsize, self.dpi)
class List(Box):
- """A list of nodes (either horizontal or vertical).
- node135"""
+ """
+ A list of nodes (either horizontal or vertical).
+ """
def __init__(self, elements):
Box.__init__(self, 0., 0., 0.)
self.shift_amount = 0. # An arbitrary offset
@@ -1372,8 +1360,10 @@
' '.join([repr(x) for x in self.children]))
def _determine_order(self, totals):
- """A helper function to determine the highest order of glue
- used by the members of this list. Used by vpack and hpack."""
+ """
+ A helper function to determine the highest order of glue
+ used by the members of this list. Used by vpack and hpack.
+ """
o = 0
for i in range(len(totals) - 1, 0, -1):
if totals[i] != 0.0:
@@ -1411,8 +1401,9 @@
self.glue_set *= GROW_FACTOR
class Hlist(List):
- """A horizontal list of boxes.
- node135"""
+ """
+ A horizontal list of boxes.
+ """
def __init__(self, elements, w=0., m='additional', do_kern=True):
List.__init__(self, elements)
if do_kern:
@@ -1420,10 +1411,13 @@
self.hpack()
def kern(self):
- """Insert Kern nodes between Chars to set kerning. The
- Chars themselves determine the amount of kerning they need
- (in get_kerning), and this function just creates the linked
- list in the correct way."""
+ """
+ Insert :class:`Kern` nodes between :class:`Char` nodes to set
+ kerning. The :class:`Char` nodes themselves determine the
+ amount of kerning they need (in :meth:`~Char.get_kerning`),
+ and this function just creates the linked list in the correct
+ way.
+ """
new_children = []
num_children = len(self.children)
if num_children:
@@ -1455,20 +1449,24 @@
# return 0.0
def hpack(self, w=0., m='additional'):
- """The main duty of hpack is to compute the dimensions of the
- resulting boxes, and to adjust the glue if one of those dimensions is
- pre-specified. The computed sizes normally enclose all of the material
- inside the new box; but some items may stick out if negative glue is
- used, if the box is overfull, or if a \vbox includes other boxes that
- have been shifted left.
+ """
+ The main duty of :meth:`hpack` is to compute the dimensions of
+ the resulting boxes, and to adjust the glue if one of those
+ dimensions is pre-specified. The computed sizes normally
+ enclose all of the material inside the new box; but some items
+ may stick out if negative glue is used, if the box is
+ overfull, or if a ``\\vbox`` includes other boxes that have
+ been shifted left.
- w: specifies a width
- m: is either 'exactly' or 'additional'.
+ - *w*: specifies a width
- Thus, hpack(w, 'exactly') produces a box whose width is exactly w, while
- hpack (w, 'additional') yields a box whose width is the natural width
- plus w. The default values produce a box with the natural width.
- node644, node649"""
+ - *m*: is either 'exactly' or 'additional'.
+
+ Thus, ``hpack(w, 'exactly')`` produces a box whose width is
+ exactly *w*, while ``hpack(w, 'additional')`` yields a box
+ whose width is the natural width plus *w*. The default values
+ produce a box with the natural width.
+ """
# I don't know why these get reset in TeX. Shift_amount is pretty
# much useless if we do.
#self.shift_amount = 0.
@@ -1514,25 +1512,28 @@
self._set_glue(x, -1, total_shrink, "Underfull")
class Vlist(List):
- """A vertical list of boxes.
- node137"""
+ """
+ A vertical list of boxes.
+ """
def __init__(self, elements, h=0., m='additional'):
List.__init__(self, elements)
self.vpack()
def vpack(self, h=0., m='additional', l=float(inf)):
- """The main duty of vpack is to compute the dimensions of the
- resulting boxes, and to adjust the glue if one of those dimensions is
- pre-specified.
+ """
+ The main duty of :meth:`vpack` is to compute the dimensions of
+ the resulting boxes, and to adjust the glue if one of those
+ dimensions is pre-specified.
- h: specifies a height
- m: is either 'exactly' or 'additional'.
- l: a maximum height
+ - *h*: specifies a height
+ - *m*: is either 'exactly' or 'additional'.
+ - *l*: a maximum height
- Thus, vpack(h, 'exactly') produces a box whose width is exactly w, while
- vpack(w, 'additional') yields a box whose width is the natural width
- plus w. The default values produce a box with the natural width.
- node644, node668"""
+ Thus, ``vpack(h, 'exactly')`` produces a box whose height is
+ exactly *h*, while ``vpack(h, 'additional')`` yields a box
+ whose height is the natural height plus *h*. The default
+ values produce a box with the natural width.
+ """
# I don't know why these get reset in TeX. Shift_amount is pretty
# much useless if we do.
# self.shift_amount = 0.
@@ -1585,13 +1586,15 @@
self._set_glue(x, -1, total_shrink, "Underfull")
class Rule(Box):
- """A Rule node stands for a solid black rectangle; it has width,
- depth, and height fields just as in an Hlist. However, if any of these
- dimensions is inf, the actual value will be determined by running the
- rule up to the boundary of the innermost enclosing box. This is called
- a "running dimension." The width is never running in an Hlist; the
- height and depth are never running in a Vlist.
- node138"""
+ """
+ A :class:`Rule` node stands for a solid black rectangle; it has
+ *width*, *depth*, and *height* fields just as in an
+ :class:`Hlist`. However, if any of these dimensions is inf, the
+ actual value will be determined by running the rule up to the
+ boundary of the innermost enclosing box. This is called a "running
+ dimension." The width is never running in an :class:`Hlist`; the
+ height and depth are never running in a :class:`Vlist`.
+ """
def __init__(self, width, height, depth, state):
Box.__init__(self, width, height, depth)
self.font_output = state.font_output
@@ -1600,7 +1603,9 @@
self.font_output.render_rect_filled(x, y, x + w, y + h)
class Hrule(Rule):
- """Convenience class to create a horizontal rule."""
+ """
+ Convenience class to create a horizontal rule.
+ """
def __init__(self, state):
thickness = state.font_output.get_underline_thickness(
state.font, state.fontsize, state.dpi)
@@ -1608,18 +1613,21 @@
Rule.__init__(self, inf, height, depth, state)
class Vrule(Rule):
- """Convenience class to create a vertical rule."""
+ """
+ Convenience class to create a vertical rule.
+ """
def __init__(self, state):
thickness = state.font_output.get_underline_thickness(
state.font, state.fontsize, state.dpi)
Rule.__init__(self, thickness, inf, inf, state)
class Glue(Node):
- """Most of the information in this object is stored in the underlying
- GlueSpec class, which is shared between multiple glue objects. (This
+ """
+ Most of the information in this object is stored in the underlying
+ :class:`GlueSpec` class, which is shared between multiple glue objects. (This
is a memory optimization which probably doesn't matter anymore, but it's
easier to stick to what TeX does.)
- node149, node152"""
+ """
def __init__(self, glue_type, copy=False):
Node.__init__(self)
self.glue_subtype = 'normal'
@@ -1647,7 +1655,9 @@
self.glue_spec.width *= GROW_FACTOR
class GlueSpec(object):
- """node150, node151"""
+ """
+ See :class:`Glue`.
+ """
def __init__(self, width=0., stretch=0., stretch_order=0, shrink=0., shrink_order=0):
self.width = width
self.stretch = stretch
@@ -1709,26 +1719,32 @@
Glue.__init__(self, 'ss')
class HCentered(Hlist):
- """A convenience class to create an Hlist whose contents are centered
- within its enclosing box."""
+ """
+ A convenience class to create an :class:`Hlist` whose contents are
+ centered within its enclosing box.
+ """
def __init__(self, elements):
Hlist.__init__(self, [SsGlue()] + elements + [SsGlue()],
do_kern=False)
class VCentered(Hlist):
- """A convenience class to create an Vlist whose contents are centered
- within its enclosing box."""
+ """
+ A convenience class to create a :class:`Vlist` whose contents are
+ centered within its enclosing box.
+ """
def __init__(self, elements):
Vlist.__init__(self, [SsGlue()] + elements + [SsGlue()])
class Kern(Node):
- """A Kern node has a width field to specify a (normally negative)
- amount of spacing. This spacing correction appears in horizontal lists
- between letters like A and V when the font designer said that it looks
- better to move them closer together or further apart. A kern node can
- also appear in a vertical list, when its 'width' denotes additional
- spacing in the vertical direction.
- node155"""
+ """
+ A :class:`Kern` node has a width field to specify a (normally
+ negative) amount of spacing. This spacing correction appears in
+ horizontal lists between letters like A and V when the font
+ designer said that it looks better to move them closer together or
+ further apart. A kern node can also appear in a vertical list,
+ when its *width* denotes additional spacing in the vertical
+ direction.
+ """
def __init__(self, width):
Node.__init__(self)
self.width = width
@@ -1746,11 +1762,13 @@
self.width *= GROW_FACTOR
class SubSuperCluster(Hlist):
- """This class is a sort of hack to get around that fact that this
- code doesn't parse to an mlist and then an hlist, but goes directly
- to hlists. This lets us store enough information in the hlist itself,
- namely the nucleas, sub- and super-script, such that if another script
- follows that needs to be attached, it can be reconfigured on the fly."""
+ """
+ :class:`SubSuperCluster` is a sort of hack to get around that fact
+ that this code do a two-pass parse like TeX. This lets us store
+ enough information in the hlist itself, namely the nucleus, sub-
+ and super-script, such that if another script follows that needs
+ to be attached, it can be reconfigured on the fly.
+ """
def __init__(self):
self.nucleus = None
self.sub = None
@@ -1758,11 +1776,13 @@
Hlist.__init__(self, [])
class AutoHeightChar(Hlist):
- """A class that will create a character as close to the given height
- and depth as possible. When using a font with multiple height versions
- of some characters (such as the BaKoMa fonts), the correct glyph will
- be selected, otherwise this will always just return a scaled version
- of the glyph."""
+ """
+ :class:`AutoHeightChar` will create a character as close to the
+ given height and depth as possible. When using a font with
+ multiple height versions of some characters (such as the BaKoMa
+ fonts), the correct glyph will be selected, otherwise this will
+ always just return a scaled version of the glyph.
+ """
def __init__(self, c, height, depth, state, always=False):
alternatives = state.font_output.get_sized_alternatives_for_symbol(
state.font, c)
@@ -1784,11 +1804,13 @@
self.shift_amount = shift
class AutoWidthChar(Hlist):
- """A class that will create a character as close to the given width
- as possible. When using a font with multiple width versions
- of some characters (such as the BaKoMa fonts), the correct glyph will
- be selected, otherwise this will always just return a scaled version
- of the glyph."""
+ """
+ :class:`AutoWidthChar` will create a character as close to the
+ given width as possible. When using a font with multiple width
+ versions of some characters (such as the BaKoMa fonts), the
+ correct glyph will be selected, otherwise this will always just
+ return a scaled version of the glyph.
+ """
def __init__(self, c, width, state, always=False, char_class=Char):
alternatives = state.font_output.get_sized_alternatives_for_symbol(
state.font, c)
@@ -1808,13 +1830,15 @@
self.width = char.width
class Ship(object):
- """Once the boxes have been set up, this sends them to output.
- Since boxes can be inside of boxes inside of boxes, the main
- work of Ship is done by two mutually recursive routines, hlist_out
- and vlist_out , which traverse the Hlists and Vlists inside of
- horizontal and vertical boxes. The global variables used in TeX to
- store state as it processes have become member variables here.
- node592."""
+ """
+ Once the boxes have been set up, this sends them to output. Since
+ boxes can be inside of boxes inside of boxes, the main work of
+ :class:`Ship` is done by two mutually recursive routines,
+ :meth:`hlist_out` and :meth:`vlist_out`, which traverse the
+ :class:`Hlist` nodes and :class:`Vlist` nodes inside of horizontal
+ and vertical boxes. The global variables used in TeX to store
+ state as it processes have become member variables here.
+ """
def __call__(self, ox, oy, box):
self.max_push = 0 # Deepest nesting of push commands so far
self.cur_s = 0
@@ -1959,6 +1983,9 @@
# PARSER
def Error(msg):
+ """
+ Helper class to raise parser errors.
+ """
def raise_error(s, loc, toks):
raise ParseFatalException(msg + "\n" + s)
@@ -1967,6 +1994,14 @@
return empty
class Parser(object):
+ """
+ This is the pyparsing-based parser for math expressions. It
+ actually parses full strings *containing* math expressions, in
+ that raw text may also appear outside of pairs of ``$``.
+
+ The grammar is based directly on that in TeX, though it cuts a few
+ corners.
+ """
_binary_operators = set(r'''
+ *
\pm \sqcap \rhd
@@ -2198,11 +2233,20 @@
self.clear()
def clear(self):
+ """
+ Clear any state before parsing.
+ """
self._expr = None
self._state_stack = None
self._em_width_cache = {}
def parse(self, s, fonts_object, fontsize, dpi):
+ """
+ Parse expression *s* using the given *fonts_object* for
+ output, at the given *fontsize* and *dpi*.
+
+ Returns the parse tree of :class:`Node` instances.
+ """
self._state_stack = [self.State(fonts_object, 'default', 'rm', fontsize, dpi)]
try:
self._expression.parseString(s)
@@ -2219,6 +2263,12 @@
# is pushed and popped accordingly. The current state always
# exists in the top element of the stack.
class State(object):
+ """
+ Stores the state of the parser.
+
+ States are pushed and popped from a stack as necessary, and
+ the "current" state is always at the top of the stack.
+ """
def __init__(self, font_output, font, font_class, fontsize, dpi):
self.font_output = font_output
self._font = font
@@ -2243,12 +2293,22 @@
font = property(_get_font, _set_font)
def get_state(self):
+ """
+ Get the current :class:`State` of the parser.
+ """
return self._state_stack[-1]
def pop_state(self):
+ """
+ Pop a :class:`State` off of the stack.
+ """
self._state_stack.pop()
def push_state(self):
+ """
+ Push a new :class:`State` onto the stack which is just a copy
+ of the current state.
+ """
self._state_stack.append(self.get_state().copy())
def finish(self, s, loc, toks):
@@ -2674,14 +2734,6 @@
# MAIN
class MathTextParser(object):
- """
- Parse the math expression s, return the (bbox, fonts) tuple needed
- to render it.
-
- fontsize must be in points
-
- return is width, height, fonts
- """
_parser = None
_backend_mapping = {
@@ -2701,10 +2753,23 @@
}
def __init__(self, output):
+ """
+ Create a MathTextParser for the given backend *output*.
+ """
self._output = output.lower()
self._cache = maxdict(50)
def parse(self, s, dpi = 72, prop = None):
+ """
+ Parse the given math expression *s* at the given *dpi*. If
+ *prop* is provided, it is a
+ :class:`~matplotlib.font_manager.FontProperties` object
+ specifying the "default" font to use in the math expression,
+ used for all non-math text.
+
+ The results are cached, so multiple calls to :meth:`parse`
+ with the same expression should be fast.
+ """
if prop is None:
prop = FontProperties()
cacheKey = (s, dpi, hash(prop))
@@ -2712,7 +2777,7 @@
if result is not None:
return result
- if self._output == 'PS' and rcParams['ps.useafm']:
+ if self._output == 'ps' and rcParams['ps.useafm']:
font_output = StandardPsFonts(prop)
else:
backend = self._backend_mapping[self._output]()
@@ -2748,6 +2813,15 @@
def to_mask(self, texstr, dpi=120, fontsize=14):
"""
+ *texstr*
+ A valid mathtext string, eg r'IQ: $\sigma_i=15$'
+
+ *dpi*
+ The dots-per-inch to render the text
+
+ *fontsize*
+ The font size in points
+
Returns a tuple (*array*, *depth*)
- *array* is an NxM uint8 alpha ubyte mask array of
@@ -2755,15 +2829,6 @@
- depth is the offset of the baseline from the bottom of the
image in pixels.
-
- ''texstr''
- A valid mathtext string, eg r'IQ: $\sigma_i=15$'
-
- ''dpi''
- The dots-per-inch to render the text
-
- ''fontsize''
- The font size in points
"""
assert(self._output=="bitmap")
prop = FontProperties(size=fontsize)
@@ -2774,27 +2839,25 @@
def to_rgba(self, texstr, color='black', dpi=120, fontsize=14):
"""
- Returns a tuple (*array*, *depth*)
+ *texstr*
+ A valid mathtext string, eg r'IQ: $\sigma_i=15$'
- - *array* is an NxMx4 RGBA array of ubyte rasterized tex.
+ *color*
+ Any matplotlib color argument
- - depth is the offset of the baseline from the bottom of the
- image in pixels.
+ *dpi*
+ The dots-per-inch to render the text
- Returns a tuple (array, depth), where depth is the offset of
- the baseline from the bottom of the image.
+ *fontsize*
+ The font size in points
- ''texstr''
- A valid mathtext string, eg r'IQ: $\sigma_i=15$'
+ Returns a tuple (*array*, *depth*)
- ''color''
- A valid matplotlib color argument
+ - *array* is an NxM uint8 alpha ubyte mask array of
+ rasterized tex.
- ''dpi''
- The dots-per-inch to render the text
-
- ''fontsize''
- The font size in points
+ - depth is the offset of the baseline from the bottom of the
+ image in pixels.
"""
x, depth = self.to_mask(texstr, dpi=dpi, fontsize=fontsize)
@@ -2813,22 +2876,24 @@
Returns the offset of the baseline from the bottom of the
image in pixels.
- ''filename''
+ *filename*
A writable filename or fileobject
- ''texstr''
+ *texstr*
A valid mathtext string, eg r'IQ: $\sigma_i=15$'
- ''color''
+ *color*
A valid matplotlib color argument
- ''dpi''
+ *dpi*
The dots-per-inch to render the text
- ''fontsize''
+ *fontsize*
The font size in points
- """
+ Returns the offset of the baseline from the bottom of the
+ image in pixels.
+ """
rgba, depth = self.to_rgba(texstr, color=color, dpi=dpi, fontsize=fontsize)
numrows, numcols, tmp = rgba.shape
@@ -2840,16 +2905,15 @@
Returns the offset of the baseline from the bottom of the
image in pixels.
- ''texstr''
+ *texstr*
A valid mathtext string, eg r'IQ: $\sigma_i=15$'
- ''dpi''
+ *dpi*
The dots-per-inch to render the text
- ''fontsize''
+ *fontsize*
The font size in points
-
- """
+ """
assert(self._output=="bitmap")
prop = FontProperties(size=fontsize)
ftimage, depth = self.parse(texstr, dpi=dpi, prop=prop)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-10-24 15:54:02
|
Revision: 6321
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6321&view=rev
Author: jdh2358
Date: 2008-10-24 15:53:59 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
added action potential example
Added Paths:
-----------
trunk/py4science/examples/data/membrane.dat
trunk/py4science/examples/detect_action_potentials.py
Added: trunk/py4science/examples/data/membrane.dat
===================================================================
--- trunk/py4science/examples/data/membrane.dat (rev 0)
+++ trunk/py4science/examples/data/membrane.dat 2008-10-24 15:53:59 UTC (rev 6321)
@@ -0,0 +1,64 @@
+\xB0\xFA*\xBF\xB0\xFA*\xBF\xBA\x9A+\xBF\xB0\xFA*\xBF\xB0\xFA*\xBF\xC4:,\xBF\xC4:,\xBF\xC4:,\xBF\xB0\xFA*\xBF\xBA\x9A+\xBF\xBA\x9A+\xBF\xB0\xFA*\xBF\xBA\x9A+\xBF\xB0\xFA*\xBF\xA6Z*\xBF\xB0\xFA*\xBF\xB0\xFA*\xBF\xA6Z*\xBF\xA6Z*\xBF\xB0\xFA*\xBF\xC4:,\xBF\xC4:,\xBF\x9C\xBA)\xBF\xA6Z*\xBF\xA6Z*\xBF\xB0\xFA*\xBF\xB0\xFA*\xBF\xB0\xFA*\xBF\xBA\x9A+\xBF\xC4:,\xBF\xC4:,\xBF\xB0\xFA*\xBF\xBA\x9A+\xBF\xB0\xFA*\xBF\xBA\x9A+\xBF\xBA\x9A+\xBF\xBA\x9A+\xBF\xBA\x9A+\xBF\xBA\x9A+\xBF\xBA\x9A+\xBF\xB0\xFA*\xBF\xB0\xFA*\xBF\xBA\x9A+\xBF\xBA\x9A+\xBF\xBA\x9A+\xBF\xB0\xFA*\xBF\xB0\xFA*\xBF\xBA\x9A+\xBF\xA6Z*\xBF\xB0\xFA*\xBF\xB0\xFA*\xBF\xBA\x9A+\xBF\xBA\x9A+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8B\xB6\xBD\x9D\xC9\xBE]\xCDU\xBE]\xCDU\xBE\xD3*\xAD\xBEc,ƾ\xA3-ھk\xAE\xE6\xBE3/\xF3\xBE\xD3/\xFD\xBE\xB8\xBF\xB8\xBFb\xBFvX\xBFvX\xBF\x8A\x98\xBF\x948 \xBF\x948 \xBF\xB2\xBF\xA8x
+\xBF\xA8x
+\xBF\xA8x
+\xBF\x8A\x98\xBF\xA8x
+\xBF\x9E\xD8 \xBF\x948 \xBF\x8A\x98\xBF\xA8x
+\xBF\xA8x
+\xBF\x80\xF8\xBF\x8A\x98\xBF\x8A\x98\xBF\x80\xF8\xBFl\xB8\xBFl\xB8\xBFvX\xBFl\xB8\xBFl\xB8\xBFN\xD8\xBFb\xBFb\xBFXx\xBFXx\xBFN\xD8\xBF:\x98\xBF:\x98\xBF:\x98\xBF&X\xBF&X\xBF\xB8\xBF&X\xBF&X\xBF\xFB\xAF\xFF\xBEx |
|
From: <md...@us...> - 2008-10-24 14:57:40
|
Revision: 6320
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6320&view=rev
Author: mdboom
Date: 2008-10-24 14:57:38 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
Remove empty "else" clause.
Modified Paths:
--------------
trunk/matplotlib/src/_png.cpp
Modified: trunk/matplotlib/src/_png.cpp
===================================================================
--- trunk/matplotlib/src/_png.cpp 2008-10-24 14:55:14 UTC (rev 6319)
+++ trunk/matplotlib/src/_png.cpp 2008-10-24 14:57:38 UTC (rev 6320)
@@ -221,7 +221,6 @@
png_set_strip_16(png_ptr);
} else if (bit_depth < 8) {
png_set_packing(png_ptr);
- } else {
}
// convert misc color types to rgb for simplicity
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-10-24 14:55:19
|
Revision: 6319
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6319&view=rev
Author: mdboom
Date: 2008-10-24 14:55:14 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
Remove unnecessary declaration.
Modified Paths:
--------------
trunk/matplotlib/src/_backend_agg.cpp
Modified: trunk/matplotlib/src/_backend_agg.cpp
===================================================================
--- trunk/matplotlib/src/_backend_agg.cpp 2008-10-24 14:05:07 UTC (rev 6318)
+++ trunk/matplotlib/src/_backend_agg.cpp 2008-10-24 14:55:14 UTC (rev 6319)
@@ -823,7 +823,6 @@
typedef agg::image_accessor_clip<agg::pixfmt_rgba32> image_accessor_type;
typedef agg::span_interpolator_linear<> interpolator_type;
typedef agg::span_image_filter_rgba_nn<image_accessor_type, interpolator_type> image_span_gen_type;
- typedef agg::renderer_scanline_aa_solid<amask_ren_type> amask_aa_renderer_type;
typedef agg::renderer_scanline_aa<amask_ren_type, color_span_alloc_type, image_span_gen_type> renderer_type;
color_span_alloc_type sa;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-10-24 14:05:13
|
Revision: 6318
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6318&view=rev
Author: mdboom
Date: 2008-10-24 14:05:07 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
Support reading low-bit depth (< 8) PNG images. Add PNG test suite to make sure we're supporting the basic kinds of PNG files available.
Modified Paths:
--------------
trunk/matplotlib/src/_png.cpp
Added Paths:
-----------
trunk/matplotlib/examples/tests/pngsuite/
trunk/matplotlib/examples/tests/pngsuite/basn0g01.png
trunk/matplotlib/examples/tests/pngsuite/basn0g02.png
trunk/matplotlib/examples/tests/pngsuite/basn0g04.png
trunk/matplotlib/examples/tests/pngsuite/basn0g08.png
trunk/matplotlib/examples/tests/pngsuite/basn0g16.png
trunk/matplotlib/examples/tests/pngsuite/basn2c08.png
trunk/matplotlib/examples/tests/pngsuite/basn2c16.png
trunk/matplotlib/examples/tests/pngsuite/basn3p01.png
trunk/matplotlib/examples/tests/pngsuite/basn3p02.png
trunk/matplotlib/examples/tests/pngsuite/basn3p04.png
trunk/matplotlib/examples/tests/pngsuite/basn3p08.png
trunk/matplotlib/examples/tests/pngsuite/basn4a08.png
trunk/matplotlib/examples/tests/pngsuite/basn4a16.png
trunk/matplotlib/examples/tests/pngsuite/basn6a08.png
trunk/matplotlib/examples/tests/pngsuite/basn6a16.png
trunk/matplotlib/examples/tests/pngsuite/pngsuite.py
trunk/matplotlib/examples/tests/pngsuite/truth.png
Added: trunk/matplotlib/examples/tests/pngsuite/basn0g01.png
===================================================================
(Binary files differ)
Property changes on: trunk/matplotlib/examples/tests/pngsuite/basn0g01.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/matplotlib/examples/tests/pngsuite/basn0g02.png
===================================================================
(Binary files differ)
Property changes on: trunk/matplotlib/examples/tests/pngsuite/basn0g02.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/matplotlib/examples/tests/pngsuite/basn0g04.png
===================================================================
(Binary files differ)
Property changes on: trunk/matplotlib/examples/tests/pngsuite/basn0g04.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/matplotlib/examples/tests/pngsuite/basn0g08.png
===================================================================
(Binary files differ)
Property changes on: trunk/matplotlib/examples/tests/pngsuite/basn0g08.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/matplotlib/examples/tests/pngsuite/basn0g16.png
===================================================================
(Binary files differ)
Property changes on: trunk/matplotlib/examples/tests/pngsuite/basn0g16.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/matplotlib/examples/tests/pngsuite/basn2c08.png
===================================================================
(Binary files differ)
Property changes on: trunk/matplotlib/examples/tests/pngsuite/basn2c08.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/matplotlib/examples/tests/pngsuite/basn2c16.png
===================================================================
(Binary files differ)
Property changes on: trunk/matplotlib/examples/tests/pngsuite/basn2c16.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/matplotlib/examples/tests/pngsuite/basn3p01.png
===================================================================
(Binary files differ)
Property changes on: trunk/matplotlib/examples/tests/pngsuite/basn3p01.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/matplotlib/examples/tests/pngsuite/basn3p02.png
===================================================================
(Binary files differ)
Property changes on: trunk/matplotlib/examples/tests/pngsuite/basn3p02.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/matplotlib/examples/tests/pngsuite/basn3p04.png
===================================================================
(Binary files differ)
Property changes on: trunk/matplotlib/examples/tests/pngsuite/basn3p04.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/matplotlib/examples/tests/pngsuite/basn3p08.png
===================================================================
(Binary files differ)
Property changes on: trunk/matplotlib/examples/tests/pngsuite/basn3p08.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/matplotlib/examples/tests/pngsuite/basn4a08.png
===================================================================
(Binary files differ)
Property changes on: trunk/matplotlib/examples/tests/pngsuite/basn4a08.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/matplotlib/examples/tests/pngsuite/basn4a16.png
===================================================================
(Binary files differ)
Property changes on: trunk/matplotlib/examples/tests/pngsuite/basn4a16.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/matplotlib/examples/tests/pngsuite/basn6a08.png
===================================================================
(Binary files differ)
Property changes on: trunk/matplotlib/examples/tests/pngsuite/basn6a08.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/matplotlib/examples/tests/pngsuite/basn6a16.png
===================================================================
(Binary files differ)
Property changes on: trunk/matplotlib/examples/tests/pngsuite/basn6a16.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/matplotlib/examples/tests/pngsuite/pngsuite.py
===================================================================
--- trunk/matplotlib/examples/tests/pngsuite/pngsuite.py (rev 0)
+++ trunk/matplotlib/examples/tests/pngsuite/pngsuite.py 2008-10-24 14:05:07 UTC (rev 6318)
@@ -0,0 +1,24 @@
+"""
+This test loads a subset of the files in Willem van Schaik's PNG test
+suite available here:
+
+ http://libpng.org/pub/png/pngsuite.html
+
+The result should look like truth.png.
+"""
+
+from matplotlib import pyplot as plt
+import glob
+
+files = glob.glob("basn*.png")
+files.sort()
+
+plt.figure(figsize=(len(files), 2))
+
+for i, fname in enumerate(files):
+ data = plt.imread(fname)
+ plt.imshow(data, extent=[i,i+1,0,1])
+
+plt.gca().get_frame().set_facecolor("#ddffff")
+plt.gca().set_xlim(0, len(files))
+plt.show()
Added: trunk/matplotlib/examples/tests/pngsuite/truth.png
===================================================================
(Binary files differ)
Property changes on: trunk/matplotlib/examples/tests/pngsuite/truth.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/matplotlib/src/_png.cpp
===================================================================
--- trunk/matplotlib/src/_png.cpp 2008-10-24 11:43:31 UTC (rev 6317)
+++ trunk/matplotlib/src/_png.cpp 2008-10-24 14:05:07 UTC (rev 6318)
@@ -213,19 +213,25 @@
png_uint_32 width = info_ptr->width;
png_uint_32 height = info_ptr->height;
+ bool do_gray_conversion = (info_ptr->bit_depth < 8 &&
+ info_ptr->color_type == PNG_COLOR_TYPE_GRAY);
+ int bit_depth = info_ptr->bit_depth;
+ if (bit_depth == 16) {
+ png_set_strip_16(png_ptr);
+ } else if (bit_depth < 8) {
+ png_set_packing(png_ptr);
+ } else {
+ }
+
// convert misc color types to rgb for simplicity
if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
- info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
+ info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
png_set_gray_to_rgb(png_ptr);
- else if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
+ } else if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) {
png_set_palette_to_rgb(png_ptr);
+ }
-
- int bit_depth = info_ptr->bit_depth;
- if (bit_depth == 16) png_set_strip_16(png_ptr);
-
-
png_set_interlace_handling(png_ptr);
png_read_update_info(png_ptr, info_ptr);
@@ -247,8 +253,6 @@
png_read_image(png_ptr, row_pointers);
-
-
npy_intp dimensions[3];
dimensions[0] = height; //numrows
dimensions[1] = width; //numcols
@@ -256,19 +260,31 @@
PyArrayObject *A = (PyArrayObject *) PyArray_SimpleNew(3, dimensions, PyArray_FLOAT);
-
- for (png_uint_32 y = 0; y < height; y++) {
- png_byte* row = row_pointers[y];
- for (png_uint_32 x = 0; x < width; x++) {
-
- png_byte* ptr = (rgba) ? &(row[x*4]) : &(row[x*3]);
- size_t offset = y*A->strides[0] + x*A->strides[1];
- //if ((y<10)&&(x==10)) std::cout << "r = " << ptr[0] << " " << ptr[0]/255.0 << std::endl;
- *(float*)(A->data + offset + 0*A->strides[2]) = (float)(ptr[0]/255.0f);
- *(float*)(A->data + offset + 1*A->strides[2]) = (float)(ptr[1]/255.0f);
- *(float*)(A->data + offset + 2*A->strides[2]) = (float)(ptr[2]/255.0f);
- *(float*)(A->data + offset + 3*A->strides[2]) = rgba ? (float)(ptr[3]/255.0f) : 1.0f;
+ if (do_gray_conversion) {
+ float max_value = (float)((1L << bit_depth) - 1);
+ for (png_uint_32 y = 0; y < height; y++) {
+ png_byte* row = row_pointers[y];
+ for (png_uint_32 x = 0; x < width; x++) {
+ float value = row[x] / max_value;
+ size_t offset = y*A->strides[0] + x*A->strides[1];
+ *(float*)(A->data + offset + 0*A->strides[2]) = value;
+ *(float*)(A->data + offset + 1*A->strides[2]) = value;
+ *(float*)(A->data + offset + 2*A->strides[2]) = value;
+ *(float*)(A->data + offset + 3*A->strides[2]) = 1.0f;
+ }
}
+ } else {
+ for (png_uint_32 y = 0; y < height; y++) {
+ png_byte* row = row_pointers[y];
+ for (png_uint_32 x = 0; x < width; x++) {
+ png_byte* ptr = (rgba) ? &(row[x*4]) : &(row[x*3]);
+ size_t offset = y*A->strides[0] + x*A->strides[1];
+ *(float*)(A->data + offset + 0*A->strides[2]) = (float)(ptr[0]/255.0);
+ *(float*)(A->data + offset + 1*A->strides[2]) = (float)(ptr[1]/255.0);
+ *(float*)(A->data + offset + 2*A->strides[2]) = (float)(ptr[2]/255.0);
+ *(float*)(A->data + offset + 3*A->strides[2]) = rgba ? (float)(ptr[3]/255.0) : 1.0f;
+ }
+ }
}
//free the png memory
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-10-24 12:14:38
|
Revision: 6317
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6317&view=rev
Author: jswhit
Date: 2008-10-24 11:43:31 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
defer import of netcdf module
Modified Paths:
--------------
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-10-24 06:51:29 UTC (rev 6316)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-10-24 11:43:31 UTC (rev 6317)
@@ -36,7 +36,7 @@
import numpy as np
import numpy.ma as ma
from shapelib import ShapeFile
-import _geoslib, netcdf, netcdftime
+import _geoslib, netcdftime
# basemap data files now installed in lib/matplotlib/toolkits/basemap/data
basemap_datadir = os.sep.join([os.path.dirname(__file__), 'data'])
@@ -3758,6 +3758,7 @@
accesses to the same URL avoid the network.
"""
+ import netcdf
if file.startswith('http'):
return netcdf._RemoteFile(file,maskandscale=maskandscale,\
cache=cache,username=username,password=password,verbose=verbose)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-10-24 06:51:38
|
Revision: 6316
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6316&view=rev
Author: efiring
Date: 2008-10-24 06:51:29 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
Make shared axes work better with constrained aspect ratio.
This is restricted to the case of adjustable=datalim, and is
experimental.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-10-24 00:08:58 UTC (rev 6315)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-10-24 06:51:29 UTC (rev 6316)
@@ -499,15 +499,24 @@
self._originalPosition = self._position.frozen()
self.set_axes(self)
self.set_aspect('auto')
- self.set_adjustable('box')
+ self._adjustable = 'box'
self.set_anchor('C')
self._sharex = sharex
self._sharey = sharey
if sharex is not None:
self._shared_x_axes.join(self, sharex)
+ if sharex._adjustable == 'box':
+ sharex._adjustable = 'datalim'
+ #warnings.warn(
+ # 'shared axes: "adjustable" is being changed to "datalim"')
+ self._adjustable = 'datalim'
if sharey is not None:
self._shared_y_axes.join(self, sharey)
-
+ if sharex._adjustable == 'box':
+ sharex._adjustable = 'datalim'
+ #warnings.warn(
+ # 'shared axes: "adjustable" is being changed to "datalim"')
+ self._adjustable = 'datalim'
self.set_label(label)
self.set_figure(fig)
@@ -772,6 +781,11 @@
if which in ('both', 'original'):
self._originalPosition.set(pos)
+ def reset_position(self):
+ 'Make the original position the active position'
+ pos = self.get_position(original=True)
+ self.set_position(pos, which='active')
+
def _set_artist_props(self, a):
'set the boilerplate props for artists added to axes'
a.set_figure(self.figure)
@@ -992,6 +1006,10 @@
ACCEPTS: [ 'box' | 'datalim' ]
"""
if adjustable in ('box', 'datalim'):
+ if self in self._shared_x_axes or self in self._shared_y_axes:
+ if adjustable == 'box':
+ raise ValueError(
+ 'adjustable must be "datalim" for shared axes')
self._adjustable = adjustable
else:
raise ValueError('argument must be "box", or "datalim"')
@@ -1043,11 +1061,11 @@
axes box or the view limits.
'''
if position is None:
- position = self.get_position(True)
+ position = self.get_position(original=True)
aspect = self.get_aspect()
if aspect == 'auto':
- self.set_position( position , 'active')
+ self.set_position( position , which='active')
return
if aspect == 'equal':
@@ -1058,7 +1076,10 @@
#Ensure at drawing time that any Axes involved in axis-sharing
# does not have its position changed.
if self in self._shared_x_axes or self in self._shared_y_axes:
- self._adjustable = 'datalim'
+ if self._adjustable == 'box':
+ self._adjustable = 'datalim'
+ warnings.warn(
+ 'shared axes: "adjustable" is being changed to "datalim"')
figW,figH = self.get_figure().get_size_inches()
fig_aspect = figH/figW
@@ -1069,6 +1090,10 @@
self.set_position(pb1.anchored(self.get_anchor(), pb), 'active')
return
+ # reset active to original in case it had been changed
+ # by prior use of 'box'
+ self.set_position(position, which='active')
+
xmin,xmax = self.get_xbound()
xsize = max(math.fabs(xmax-xmin), 1e-30)
ymin,ymax = self.get_ybound()
@@ -1489,7 +1514,7 @@
if not self.get_visible(): return
renderer.open_group('axes')
- self.apply_aspect(self.get_position(True))
+ self.apply_aspect()
# the patch draws the background rectangle -- the frame below
# will draw the edges
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-10-24 00:09:02
|
Revision: 6315
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6315&view=rev
Author: efiring
Date: 2008-10-24 00:08:58 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
Support autoscaling with shared axes
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/ticker.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-10-23 19:56:04 UTC (rev 6314)
+++ trunk/matplotlib/CHANGELOG 2008-10-24 00:08:58 UTC (rev 6315)
@@ -1,3 +1,5 @@
+2008-10-23 Autoscaling is now supported with shared axes - EF
+
2008-10-23 Fixed exception in dviread that happened with Minion - JKS
2008-10-21 set_xlim, ylim now return a copy of the viewlim array to
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-10-23 19:56:04 UTC (rev 6314)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-10-24 00:08:58 UTC (rev 6315)
@@ -1451,20 +1451,30 @@
"""
# if image data only just use the datalim
if not self._autoscaleon: return
+ if scalex:
+ xshared = self._shared_x_axes.get_siblings(self)
+ dl = [ax.dataLim for ax in xshared]
+ bb = mtransforms.BboxBase.union(dl)
+ x0, x1 = bb.intervalx
+ if scaley:
+ yshared = self._shared_y_axes.get_siblings(self)
+ dl = [ax.dataLim for ax in yshared]
+ bb = mtransforms.BboxBase.union(dl)
+ y0, y1 = bb.intervaly
if (tight or (len(self.images)>0 and
len(self.lines)==0 and
len(self.patches)==0)):
-
- if scalex: self.set_xbound(self.dataLim.intervalx)
-
- if scaley: self.set_ybound(self.dataLim.intervaly)
+ if scalex:
+ self.set_xbound(x0, x1)
+ if scaley:
+ self.set_ybound(y0, 11)
return
if scalex:
- XL = self.xaxis.get_major_locator().autoscale()
+ XL = self.xaxis.get_major_locator().view_limits(x0, x1)
self.set_xbound(XL)
if scaley:
- YL = self.yaxis.get_major_locator().autoscale()
+ YL = self.yaxis.get_major_locator().view_limits(y0, y1)
self.set_ybound(YL)
#### Drawing
Modified: trunk/matplotlib/lib/matplotlib/ticker.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/ticker.py 2008-10-23 19:56:04 UTC (rev 6314)
+++ trunk/matplotlib/lib/matplotlib/ticker.py 2008-10-24 00:08:58 UTC (rev 6315)
@@ -641,9 +641,17 @@
'Return the locations of the ticks'
raise NotImplementedError('Derived must override')
+ def view_limits(self, vmin, vmax):
+ """
+ select a scale for the range from vmin to vmax
+
+ Normally This will be overridden.
+ """
+ return mtransforms.nonsingular(vmin, vmax)
+
def autoscale(self):
'autoscale the view limits'
- return mtransforms.nonsingular(*self.axis.get_view_interval())
+ return self.view_limits(*self.axis.get_view_interval())
def pan(self, numsteps):
'Pan numticks (can be positive or negative)'
@@ -773,11 +781,9 @@
def _set_numticks(self):
self.numticks = 11 # todo; be smart here; this is just for dev
- def autoscale(self):
+ def view_limits(self, vmin, vmax):
'Try to choose the view limits intelligently'
- vmin, vmax = self.axis.get_data_interval()
-
if vmax<vmin:
vmin, vmax = vmax, vmin
@@ -859,13 +865,11 @@
locs = vmin + np.arange(n+1) * base
return locs
- def autoscale(self):
+ def view_limits(self, dmin, dmax):
"""
Set the view limits to the nearest multiples of base that
contain the data
"""
- dmin, dmax = self.axis.get_data_interval()
-
vmin = self._base.le(dmin)
vmax = self._base.ge(dmax)
if vmin==vmax:
@@ -946,8 +950,7 @@
vmin, vmax = mtransforms.nonsingular(vmin, vmax, expander = 0.05)
return self.bin_boundaries(vmin, vmax)
- def autoscale(self):
- dmin, dmax = self.axis.get_data_interval()
+ def view_limits(self, dmin, dmax):
if self._symmetric:
maxabs = max(abs(dmin), abs(dmax))
dmin = -maxabs
@@ -1043,9 +1046,9 @@
return np.array(ticklocs)
- def autoscale(self):
+ def view_limits(self, vmin, vmax):
'Try to choose the view limits intelligently'
- vmin, vmax = self.axis.get_data_interval()
+
if vmax<vmin:
vmin, vmax = vmax, vmin
@@ -1114,10 +1117,9 @@
ticklocs = np.sign(decades) * b ** np.abs(decades)
return np.array(ticklocs)
- def autoscale(self):
+ def view_limits(self, vmin, vmax):
'Try to choose the view limits intelligently'
b = self._transform.base
- vmin, vmax = self.axis.get_data_interval()
if vmax<vmin:
vmin, vmax = vmax, vmin
@@ -1167,13 +1169,12 @@
d = abs(vmax-vmin)
self._locator = self.get_locator(d)
- def autoscale(self):
+ def view_limits(self, vmin, vmax):
'Try to choose the view limits intelligently'
- vmin, vmax = self.axis.get_data_interval()
d = abs(vmax-vmin)
self._locator = self.get_locator(d)
- return self._locator.autoscale()
+ return self._locator.view_limits(vmin, vmax)
def get_locator(self, d):
'pick the best locator based on a distance'
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-10-23 19:56:11
|
Revision: 6314
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6314&view=rev
Author: efiring
Date: 2008-10-23 19:56:04 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
Update movie_demo.py to work with current mpl.
Modified Paths:
--------------
trunk/matplotlib/examples/animation/movie_demo.py
Modified: trunk/matplotlib/examples/animation/movie_demo.py
===================================================================
--- trunk/matplotlib/examples/animation/movie_demo.py 2008-10-23 17:35:50 UTC (rev 6313)
+++ trunk/matplotlib/examples/animation/movie_demo.py 2008-10-23 19:56:04 UTC (rev 6314)
@@ -15,9 +15,12 @@
# the script to suit your own needs.
#
-
-from matplotlib.matlab import * # For plotting graphs.
-import os # For issuing commands to the OS.
+import matplotlib
+matplotlib.use('Agg')
+import matplotlib.pyplot as plt # For plotting graphs.
+import numpy as np
+import subprocess # For issuing commands to the OS.
+import os
import sys # For determining the Python version.
#
@@ -25,24 +28,29 @@
# Python interpreter, and matplotlib. The version of
# Mencoder is printed when it is called.
#
-# This script is known to have worked for:
-#
-# OS version: ('Linux', 'flux-capacitor', '2.4.26', '#1 SMP Sa Apr 17 19:33:42 CEST 2004', 'i686')
-# Python version: 2.3.4 (#2, May 29 2004, 03:31:27) [GCC 3.3.3 (Debian 20040417)]
-# matplotlib version: 0.61.0
-# MEncoder version:
-# MEncoder 1.0pre4-3.3.3 (C) 2000-2004 MPlayer Team
-# CPU: Intel Celeron 2/Pentium III Coppermine,Geyserville 996.1 MHz (Family: 6, Stepping: 10)
-# Detected cache-line size is 32 bytes
-# CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 0
-# Compiled for x86 CPU with extensions: MMX MMX2 SSE
-#
print 'Executing on', os.uname()
print 'Python version', sys.version
print 'matplotlib version', matplotlib.__version__
+not_found_msg = """
+The mencoder command was not found;
+mencoder is used by this script to make an avi file from a set of pngs.
+It is typically not installed by default on linux distros because of
+legal restrictions, but it is widely available.
+"""
+try:
+ subprocess.check_call(['mencoder'])
+except subprocess.CalledProcessError:
+ print "mencoder command was found"
+ pass # mencoder is found, but returns non-zero exit as expected
+ # This is a quick and dirty check; it leaves some spurious output
+ # for the user to puzzle over.
+except OSError:
+ print not_found_msg
+ sys.exit("quitting\n")
+
#
# First, let's create some data to work with. In this example
# we'll use a normalized Gaussian waveform whose mean and
@@ -57,16 +65,16 @@
# Initialize variables needed to create and store the example data set.
numberOfTimeSteps = 100 # Number of frames we want in the movie.
-x = arange(-10,10,0.01) # Values to be plotted on the x-axis.
+x = np.arange(-10,10,0.01) # Values to be plotted on the x-axis.
mean = -6 # Initial mean of the Gaussian.
stddev = 0.2 # Initial standard deviation.
meaninc = 0.1 # Mean increment.
stddevinc = 0.1 # Standard deviation increment.
# Create an array of zeros and fill it with the example data.
-y = zeros((numberOfTimeSteps,len(x)), Float64)
+y = np.zeros((numberOfTimeSteps,len(x)), float)
for i in range(numberOfTimeSteps) :
- y[i] = (1/sqrt(2*pi*stddev))*exp(-((x-mean)**2)/(2*stddev))
+ y[i] = (1/np.sqrt(2*np.pi*stddev))*np.exp(-((x-mean)**2)/(2*stddev))
mean = mean + meaninc
stddev = stddev + stddevinc
@@ -81,15 +89,15 @@
#
# The next four lines are just like Matlab.
#
- plot(x,y[i],'b.')
- axis((x[0],x[-1],-0.25,1))
- xlabel('time (ms)')
- ylabel('probability density function')
-
+ plt.plot(x,y[i],'b.')
+ plt.axis((x[0],x[-1],-0.25,1))
+ plt.xlabel('time (ms)')
+ plt.ylabel('probability density function')
+
#
# Notice the use of LaTeX-like markup.
#
- title(r'$\cal{N}(\mu, \sigma^2)$', fontsize=20)
+ plt.title(r'$\cal{N}(\mu, \sigma^2)$', fontsize=20)
#
# The file name indicates how the image will be saved and the
@@ -100,7 +108,7 @@
# images directly to a file without displaying them.
#
filename = str('%03d' % i) + '.png'
- savefig(filename, dpi=100)
+ plt.savefig(filename, dpi=100)
#
# Let the user know what's happening.
@@ -110,7 +118,7 @@
#
# Clear the figure to make way for the next image.
#
- clf()
+ plt.clf()
#
# Now that we have graphed images of the dataset, we will stitch them
@@ -137,4 +145,12 @@
'-o',
'output.avi')
-os.spawnvp(os.P_WAIT, 'mencoder', command)
+#os.spawnvp(os.P_WAIT, 'mencoder', command)
+
+print "\n\nabout to execute:\n%s\n\n" % ' '.join(command)
+subprocess.check_call(command)
+
+print "\n\n The movie was written to 'output.avi'"
+
+print "\n\n You may want to delete *.png now.\n\n"
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-10-23 17:36:03
|
Revision: 6313
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6313&view=rev
Author: mdboom
Date: 2008-10-23 17:35:50 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
Fix math expression.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-10-23 17:35:14 UTC (rev 6312)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-10-23 17:35:50 UTC (rev 6313)
@@ -6623,7 +6623,7 @@
.. math::
- C_{xy} = \\frac{|P_{xy}|^2}{P_{xx}*P_{yy}}
+ C_{xy} = \\frac{|P_{xy}|^2}{P_{xx}P_{yy}}
The return value is a tuple (*Cxy*, *f*), where *f* are the
frequencies of the coherence vector.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|