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: <js...@us...> - 2008-08-04 12:20:29
|
Revision: 5961
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5961&view=rev
Author: jswhit
Date: 2008-08-04 12:20:25 +0000 (Mon, 04 Aug 2008)
Log Message:
-----------
don't include doc pngs in sdist
Modified Paths:
--------------
trunk/toolkits/basemap/MANIFEST.in
Modified: trunk/toolkits/basemap/MANIFEST.in
===================================================================
--- trunk/toolkits/basemap/MANIFEST.in 2008-08-04 11:49:31 UTC (rev 5960)
+++ trunk/toolkits/basemap/MANIFEST.in 2008-08-04 12:20:25 UTC (rev 5961)
@@ -80,7 +80,6 @@
include pyshapelib/shapelib/*.c pyshapelib/shapelib/*.h
include MANIFEST.in
include doc/users/figures/*py
-include doc/users/figures/*png
include doc/users/*rst
include doc/api/*rst
include doc/README.txt
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-08-04 11:49:34
|
Revision: 5960
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5960&view=rev
Author: jswhit
Date: 2008-08-04 11:49:31 +0000 (Mon, 04 Aug 2008)
Log Message:
-----------
additional shape checking in rotate_vector.
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-08-04 11:44:30 UTC (rev 5959)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-08-04 11:49:31 UTC (rev 5960)
@@ -2423,6 +2423,9 @@
uin.shape[1] == vin.shape[1] == lons.shape[0] and\
uin.shape[0] == vin.shape[0] == lats.shape[0]:
lons, lats = np.meshgrid(lons, lats)
+ else:
+ if not lons.shape == lats.shape == uin.shape == vin.shape:
+ raise TypeError("shapes of lons,lats and uin,vin don't match")
x, y = self(lons, lats)
# rotate from geographic to map coordinates.
if ma.isMaskedArray(uin):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-08-04 11:44:36
|
Revision: 5959
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5959&view=rev
Author: jswhit
Date: 2008-08-04 11:44:30 +0000 (Mon, 04 Aug 2008)
Log Message:
-----------
only run meshgrid on lons,lats in rotate_vector if it really
makes sense to do so.
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-08-03 18:02:34 UTC (rev 5958)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-08-04 11:44:30 UTC (rev 5959)
@@ -2415,7 +2415,13 @@
returns ``uout,vout,x,y`` (where ``x,y`` are the map projection
coordinates of the grid defined by ``lons,lats``).
"""
- if lons.ndim == 1 and lats.ndim == 1:
+ # if lons,lats are 1d and uin,vin are 2d, and
+ # lats describes 1st dim of uin,vin, and
+ # lons describes 2nd dim of uin,vin, make lons,lats 2d
+ # with meshgrid.
+ if lons.ndim == lats.ndim == 1 and uin.ndim == vin.ndim == 2 and\
+ uin.shape[1] == vin.shape[1] == lons.shape[0] and\
+ uin.shape[0] == vin.shape[0] == lats.shape[0]:
lons, lats = np.meshgrid(lons, lats)
x, y = self(lons, lats)
# rotate from geographic to map coordinates.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cm...@us...> - 2008-08-03 18:02:36
|
Revision: 5958
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5958&view=rev
Author: cmoad
Date: 2008-08-03 18:02:34 +0000 (Sun, 03 Aug 2008)
Log Message:
-----------
tagging new release
Added Paths:
-----------
tags/v0_98_3/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cm...@us...> - 2008-08-03 17:57:00
|
Revision: 5957
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5957&view=rev
Author: cmoad
Date: 2008-08-03 17:56:58 +0000 (Sun, 03 Aug 2008)
Log Message:
-----------
minor rev bump
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-08-02 18:54:32 UTC (rev 5956)
+++ trunk/matplotlib/CHANGELOG 2008-08-03 17:56:58 UTC (rev 5957)
@@ -1,3 +1,6 @@
+=================================================================
+2008-08-03 Released 0.98.3 at svn r5947
+
2008-08-01 Backported memory leak fixes in _ttconv.cpp - MGD
2008-07-31 Added masked array support to griddata. - JSW
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-08-02 18:54:38
|
Revision: 5956
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5956&view=rev
Author: jswhit
Date: 2008-08-02 18:54:32 +0000 (Sat, 02 Aug 2008)
Log Message:
-----------
make land_color, ocean_color kwargs in drawlsmask
Modified Paths:
--------------
trunk/toolkits/basemap/doc/users/figures/background2.py
trunk/toolkits/basemap/examples/geos_demo.py
trunk/toolkits/basemap/examples/ortho_demo.py
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Modified: trunk/toolkits/basemap/doc/users/figures/background2.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/background2.py 2008-08-02 12:40:17 UTC (rev 5955)
+++ trunk/toolkits/basemap/doc/users/figures/background2.py 2008-08-02 18:54:32 UTC (rev 5956)
@@ -6,5 +6,6 @@
resolution=None,lat_1=45.,lat_2=55,lat_0=50,lon_0=-107.)
# draw a land-sea mask for a map background.
# lakes=True means plot inland lakes with ocean color.
-m.drawlsmask('coral','aqua',lakes=True)
+m.drawlsmask(land_color='coral',ocean_color='aqua',lakes=True)
+plt.show()
plt.savefig('background2.png')
Modified: trunk/toolkits/basemap/examples/geos_demo.py
===================================================================
--- trunk/toolkits/basemap/examples/geos_demo.py 2008-08-02 12:40:17 UTC (rev 5955)
+++ trunk/toolkits/basemap/examples/geos_demo.py 2008-08-02 18:54:32 UTC (rev 5956)
@@ -11,7 +11,7 @@
# plot land-sea mask.
# land red, oceans blue.
# lakes=True means plot inland lakes with ocean color.
-m.drawlsmask('red','blue',lakes=True)
+m.drawlsmask(land_color='red',ocean_color='blue',lakes=True)
# draw parallels and meridians.
m.drawparallels(np.arange(-90.,120.,30.))
m.drawmeridians(np.arange(0.,420.,60.))
Modified: trunk/toolkits/basemap/examples/ortho_demo.py
===================================================================
--- trunk/toolkits/basemap/examples/ortho_demo.py 2008-08-02 12:40:17 UTC (rev 5955)
+++ trunk/toolkits/basemap/examples/ortho_demo.py 2008-08-02 18:54:32 UTC (rev 5956)
@@ -11,7 +11,7 @@
m = Basemap(projection='ortho',lon_0=lon_0,lat_0=lat_0,resolution=None)
# land red, oceans blue.
# lakes=True means plot inland lakes with ocean color.
-m.drawlsmask('red','blue', lakes=True)
+m.drawlsmask(land_color='red',ocean_color='blue', lakes=True)
# draw parallels and meridians.
m.drawparallels(np.arange(-90.,120.,30.))
m.drawmeridians(np.arange(0.,420.,60.))
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-08-02 12:40:17 UTC (rev 5955)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-08-02 18:54:32 UTC (rev 5956)
@@ -2940,7 +2940,7 @@
self.set_axes_limits(ax=ax)
return retnh,retsh
- def drawlsmask(self,land_color,ocean_color,lsmask=None,
+ def drawlsmask(self,land_color="0.8",ocean_color="w",lsmask=None,
lsmask_lons=None,lsmask_lats=None,lakes=False,**kwargs):
"""
Draw land-sea mask image.
@@ -2953,17 +2953,12 @@
.. tabularcolumns:: |l|L|
============== ====================================================
- Arguments Description
+ Keywords Description
============== ====================================================
land_color desired land color (color name or rgba tuple).
+ Default gray ("0.8").
ocean_color desired ocean color (color name or rgba tuple).
- ============== ====================================================
-
- .. tabularcolumns:: |l|L|
-
- ============== ====================================================
- Keywords Description
- ============== ====================================================
+ Default white.
lakes If True, inland lakes are also colored with
ocean_color (default is lakes=False).
lsmask An array of 0's for ocean pixels, 1's for
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-08-02 12:40:22
|
Revision: 5955
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5955&view=rev
Author: jswhit
Date: 2008-08-02 12:40:17 +0000 (Sat, 02 Aug 2008)
Log Message:
-----------
fix typo in docstring
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-08-02 12:38:57 UTC (rev 5954)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-08-02 12:40:17 UTC (rev 5955)
@@ -2956,7 +2956,7 @@
Arguments Description
============== ====================================================
land_color desired land color (color name or rgba tuple).
- rgba_ocean desired ocean color (color name or rgba tuple).
+ ocean_color desired ocean color (color name or rgba tuple).
============== ====================================================
.. tabularcolumns:: |l|L|
@@ -2965,7 +2965,7 @@
Keywords Description
============== ====================================================
lakes If True, inland lakes are also colored with
- rgba_ocean (default is lakes=False).
+ ocean_color (default is lakes=False).
lsmask An array of 0's for ocean pixels, 1's for
land pixels and optionally 2's for inland
lake pixels defining a global land-sea mask.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-08-02 12:38:59
|
Revision: 5954
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5954&view=rev
Author: jswhit
Date: 2008-08-02 12:38:57 +0000 (Sat, 02 Aug 2008)
Log Message:
-----------
update
Modified Paths:
--------------
trunk/toolkits/basemap/doc/README.txt
Modified: trunk/toolkits/basemap/doc/README.txt
===================================================================
--- trunk/toolkits/basemap/doc/README.txt 2008-08-01 19:50:48 UTC (rev 5953)
+++ trunk/toolkits/basemap/doc/README.txt 2008-08-02 12:38:57 UTC (rev 5954)
@@ -1,9 +1,18 @@
To build docs ....
+
* install sphinx from svn.
+
* make _static and sphinxext symlinks here that point to the corresponding
directories in the matplotlib doc tree, e.g.
ln -s ../../../matplotlib/doc/_static _static
ln -s ../../../matplotlib/doc/sphinxext sphinxext
-* run make.py. Entry point is build/html/index.html.
+* copy matplotlibrc to users/figures, edit to make default figure size 6,6
+ instead of 8,6.
+
+* run 'python make.py html'. Entry point is build/html/index.html.
+
+* to update on sf site:
+ cd build
+ rsync -avz html js...@ma...:/home/groups/m/ma/matplotlib/htdocs/basemap/doc/ -essh
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-08-01 19:50:54
|
Revision: 5953
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5953&view=rev
Author: jswhit
Date: 2008-08-01 19:50:48 +0000 (Fri, 01 Aug 2008)
Log Message:
-----------
don't set figure size
Modified Paths:
--------------
trunk/toolkits/basemap/doc/users/figures/background1.py
trunk/toolkits/basemap/doc/users/figures/background2.py
trunk/toolkits/basemap/doc/users/figures/background3.py
Modified: trunk/toolkits/basemap/doc/users/figures/background1.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/background1.py 2008-08-01 18:44:09 UTC (rev 5952)
+++ trunk/toolkits/basemap/doc/users/figures/background1.py 2008-08-01 19:50:48 UTC (rev 5953)
@@ -1,6 +1,5 @@
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
-plt.figure(figsize=(6,5))
# setup Lambert Conformal basemap.
m = Basemap(width=12000000,height=9000000,projection='lcc',
resolution='c',lat_1=45.,lat_2=55,lat_0=50,lon_0=-107.)
Modified: trunk/toolkits/basemap/doc/users/figures/background2.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/background2.py 2008-08-01 18:44:09 UTC (rev 5952)
+++ trunk/toolkits/basemap/doc/users/figures/background2.py 2008-08-01 19:50:48 UTC (rev 5953)
@@ -1,6 +1,5 @@
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
-plt.figure(figsize=(6,5))
# setup Lambert Conformal basemap.
# set resolution=None to skip processing of boundary datasets.
m = Basemap(width=12000000,height=9000000,projection='lcc',
Modified: trunk/toolkits/basemap/doc/users/figures/background3.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/background3.py 2008-08-01 18:44:09 UTC (rev 5952)
+++ trunk/toolkits/basemap/doc/users/figures/background3.py 2008-08-01 19:50:48 UTC (rev 5953)
@@ -1,6 +1,5 @@
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
-plt.figure(figsize=(6,5))
# setup Lambert Conformal basemap.
# set resolution=None to skip processing of boundary datasets.
m = Basemap(width=12000000,height=9000000,projection='lcc',
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-08-01 18:44:14
|
Revision: 5952
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5952&view=rev
Author: jswhit
Date: 2008-08-01 18:44:09 +0000 (Fri, 01 Aug 2008)
Log Message:
-----------
eliminate title, make plot a little smaller.
Modified Paths:
--------------
trunk/toolkits/basemap/doc/users/figures/background1.py
trunk/toolkits/basemap/doc/users/figures/background2.py
trunk/toolkits/basemap/doc/users/figures/background3.py
Modified: trunk/toolkits/basemap/doc/users/figures/background1.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/background1.py 2008-08-01 18:25:38 UTC (rev 5951)
+++ trunk/toolkits/basemap/doc/users/figures/background1.py 2008-08-01 18:44:09 UTC (rev 5952)
@@ -1,5 +1,6 @@
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
+plt.figure(figsize=(6,5))
# setup Lambert Conformal basemap.
m = Basemap(width=12000000,height=9000000,projection='lcc',
resolution='c',lat_1=45.,lat_2=55,lat_0=50,lon_0=-107.)
@@ -11,5 +12,4 @@
m.drawmapboundary(fill_color='aqua')
# fill continents, set lake color same as ocean color.
m.fillcontinents(color='coral',lake_color='aqua')
-plt.title("Lambert Conformal Projection")
plt.savefig('background1.png')
Modified: trunk/toolkits/basemap/doc/users/figures/background2.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/background2.py 2008-08-01 18:25:38 UTC (rev 5951)
+++ trunk/toolkits/basemap/doc/users/figures/background2.py 2008-08-01 18:44:09 UTC (rev 5952)
@@ -1,5 +1,6 @@
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
+plt.figure(figsize=(6,5))
# setup Lambert Conformal basemap.
# set resolution=None to skip processing of boundary datasets.
m = Basemap(width=12000000,height=9000000,projection='lcc',
@@ -7,5 +8,4 @@
# draw a land-sea mask for a map background.
# lakes=True means plot inland lakes with ocean color.
m.drawlsmask('coral','aqua',lakes=True)
-plt.title("Lambert Conformal Projection")
plt.savefig('background2.png')
Modified: trunk/toolkits/basemap/doc/users/figures/background3.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/background3.py 2008-08-01 18:25:38 UTC (rev 5951)
+++ trunk/toolkits/basemap/doc/users/figures/background3.py 2008-08-01 18:44:09 UTC (rev 5952)
@@ -1,9 +1,9 @@
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
+plt.figure(figsize=(6,5))
# setup Lambert Conformal basemap.
# set resolution=None to skip processing of boundary datasets.
m = Basemap(width=12000000,height=9000000,projection='lcc',
resolution=None,lat_1=45.,lat_2=55,lat_0=50,lon_0=-107.)
m.bluemarble()
-plt.title("Lambert Conformal Projection")
plt.savefig('background3.png')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-08-01 18:25:43
|
Revision: 5951
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5951&view=rev
Author: jswhit
Date: 2008-08-01 18:25:38 +0000 (Fri, 01 Aug 2008)
Log Message:
-----------
update text with examples.
Modified Paths:
--------------
trunk/toolkits/basemap/doc/users/geography.rst
Modified: trunk/toolkits/basemap/doc/users/geography.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/geography.rst 2008-08-01 18:03:01 UTC (rev 5950)
+++ trunk/toolkits/basemap/doc/users/geography.rst 2008-08-01 18:25:38 UTC (rev 5951)
@@ -33,4 +33,22 @@
world in lat/lon coordinates from the international dateline eastward
and the South Pole northward.
-.. toctree::
+Here are examples of the three different ways to draw a map background.
+
+1. Draw coastlines, filling ocean and land areas.
+
+.. literalinclude:: figures/background1.py
+
+.. image:: figures/background1.png
+
+2. Draw a land-sea mask as an image.
+
+.. literalinclude:: figures/background2.py
+
+.. image:: figures/background2.png
+
+3. Draw the NASA 'Blue Marble' image.
+
+.. literalinclude:: figures/background3.py
+
+.. image:: figures/background3.png
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-08-01 18:03:06
|
Revision: 5950
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5950&view=rev
Author: jswhit
Date: 2008-08-01 18:03:01 +0000 (Fri, 01 Aug 2008)
Log Message:
-----------
update lsmask call
Modified Paths:
--------------
trunk/toolkits/basemap/examples/geos_demo.py
Modified: trunk/toolkits/basemap/examples/geos_demo.py
===================================================================
--- trunk/toolkits/basemap/examples/geos_demo.py 2008-08-01 18:00:58 UTC (rev 5949)
+++ trunk/toolkits/basemap/examples/geos_demo.py 2008-08-01 18:03:01 UTC (rev 5950)
@@ -9,10 +9,9 @@
fig=plt.figure()
m = Basemap(projection='geos',lon_0=lon_0,rsphere=(6378137.00,6356752.3142),resolution=None)
# plot land-sea mask.
-rgba_land = (0,255,0,255) # land green.
-rgba_ocean = (0,0,255,255) # ocean blue.
+# land red, oceans blue.
# lakes=True means plot inland lakes with ocean color.
-m.drawlsmask(rgba_land, rgba_ocean, lakes=True)
+m.drawlsmask('red','blue',lakes=True)
# draw parallels and meridians.
m.drawparallels(np.arange(-90.,120.,30.))
m.drawmeridians(np.arange(0.,420.,60.))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-08-01 18:01:03
|
Revision: 5949
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5949&view=rev
Author: jswhit
Date: 2008-08-01 18:00:58 +0000 (Fri, 01 Aug 2008)
Log Message:
-----------
update docstring
Modified Paths:
--------------
trunk/toolkits/basemap/examples/ortho_demo.py
Modified: trunk/toolkits/basemap/examples/ortho_demo.py
===================================================================
--- trunk/toolkits/basemap/examples/ortho_demo.py 2008-08-01 17:57:59 UTC (rev 5948)
+++ trunk/toolkits/basemap/examples/ortho_demo.py 2008-08-01 18:00:58 UTC (rev 5949)
@@ -9,9 +9,7 @@
# map with land/sea mask plotted
fig = plt.figure()
m = Basemap(projection='ortho',lon_0=lon_0,lat_0=lat_0,resolution=None)
-# plot land-sea mask.
-rgba_land = (0,255,0,255) # land green.
-rgba_ocean = (0,0,255,255) # ocean blue.
+# land red, oceans blue.
# lakes=True means plot inland lakes with ocean color.
m.drawlsmask('red','blue', lakes=True)
# draw parallels and meridians.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-08-01 17:58:05
|
Revision: 5948
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5948&view=rev
Author: jswhit
Date: 2008-08-01 17:57:59 +0000 (Fri, 01 Aug 2008)
Log Message:
-----------
change drawlsmask method to accept any valid matplotlib color specification.
Modified Paths:
--------------
trunk/toolkits/basemap/examples/ortho_demo.py
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Added Paths:
-----------
trunk/toolkits/basemap/doc/users/figures/background1.py
trunk/toolkits/basemap/doc/users/figures/background2.py
trunk/toolkits/basemap/doc/users/figures/background3.py
Added: trunk/toolkits/basemap/doc/users/figures/background1.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/background1.py (rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/background1.py 2008-08-01 17:57:59 UTC (rev 5948)
@@ -0,0 +1,15 @@
+from mpl_toolkits.basemap import Basemap
+import matplotlib.pyplot as plt
+# setup Lambert Conformal basemap.
+m = Basemap(width=12000000,height=9000000,projection='lcc',
+ resolution='c',lat_1=45.,lat_2=55,lat_0=50,lon_0=-107.)
+# draw coastlines.
+m.drawcoastlines()
+# draw a boundary around the map, fill the background.
+# this background will end up being the ocean color, since
+# the continents will be drawn on top.
+m.drawmapboundary(fill_color='aqua')
+# fill continents, set lake color same as ocean color.
+m.fillcontinents(color='coral',lake_color='aqua')
+plt.title("Lambert Conformal Projection")
+plt.savefig('background1.png')
Added: trunk/toolkits/basemap/doc/users/figures/background2.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/background2.py (rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/background2.py 2008-08-01 17:57:59 UTC (rev 5948)
@@ -0,0 +1,11 @@
+from mpl_toolkits.basemap import Basemap
+import matplotlib.pyplot as plt
+# setup Lambert Conformal basemap.
+# set resolution=None to skip processing of boundary datasets.
+m = Basemap(width=12000000,height=9000000,projection='lcc',
+ resolution=None,lat_1=45.,lat_2=55,lat_0=50,lon_0=-107.)
+# draw a land-sea mask for a map background.
+# lakes=True means plot inland lakes with ocean color.
+m.drawlsmask('coral','aqua',lakes=True)
+plt.title("Lambert Conformal Projection")
+plt.savefig('background2.png')
Added: trunk/toolkits/basemap/doc/users/figures/background3.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/background3.py (rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/background3.py 2008-08-01 17:57:59 UTC (rev 5948)
@@ -0,0 +1,9 @@
+from mpl_toolkits.basemap import Basemap
+import matplotlib.pyplot as plt
+# setup Lambert Conformal basemap.
+# set resolution=None to skip processing of boundary datasets.
+m = Basemap(width=12000000,height=9000000,projection='lcc',
+ resolution=None,lat_1=45.,lat_2=55,lat_0=50,lon_0=-107.)
+m.bluemarble()
+plt.title("Lambert Conformal Projection")
+plt.savefig('background3.png')
Modified: trunk/toolkits/basemap/examples/ortho_demo.py
===================================================================
--- trunk/toolkits/basemap/examples/ortho_demo.py 2008-08-01 17:10:38 UTC (rev 5947)
+++ trunk/toolkits/basemap/examples/ortho_demo.py 2008-08-01 17:57:59 UTC (rev 5948)
@@ -13,7 +13,7 @@
rgba_land = (0,255,0,255) # land green.
rgba_ocean = (0,0,255,255) # ocean blue.
# lakes=True means plot inland lakes with ocean color.
-m.drawlsmask(rgba_land, rgba_ocean, lakes=True)
+m.drawlsmask('red','blue', lakes=True)
# draw parallels and meridians.
m.drawparallels(np.arange(-90.,120.,30.))
m.drawmeridians(np.arange(0.,420.,60.))
@@ -32,9 +32,9 @@
m.drawmapboundary(fill_color='aqua')
# add a map scale.
length = 5000
-x1,y1 = 0.2*m.xmax, 0.2*m.ymax
+x1,y1 = 0.3*m.xmax, 0.25*m.ymax
lon1,lat1 = m(x1,y1,inverse=True)
-m.drawmapscale(lon1,lat1,lon_0,lat_0,length,fontsize=8,barstyle='fancy',\
+m.drawmapscale(lon1,lat1,lon1,lat1,length,fontsize=8,barstyle='fancy',\
labelstyle='fancy',units='km')
plt.title('Orthographic Map Centered on Lon=%s, Lat=%s' % (lon_0,lat_0))
plt.show()
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-08-01 17:10:38 UTC (rev 5947)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-08-01 17:57:59 UTC (rev 5948)
@@ -2940,7 +2940,7 @@
self.set_axes_limits(ax=ax)
return retnh,retsh
- def drawlsmask(self,rgba_land,rgba_ocean,lsmask=None,
+ def drawlsmask(self,land_color,ocean_color,lsmask=None,
lsmask_lons=None,lsmask_lats=None,lakes=False,**kwargs):
"""
Draw land-sea mask image.
@@ -2955,15 +2955,8 @@
============== ====================================================
Arguments Description
============== ====================================================
- rgba_land rgba integer tuple that describes desired
- land color. For example, for green (non-transparent)
- land areas, use rgba_land = (0,255,0,255).
- rgba_ocean rgba integer tuple that describes desired
- ocean color. For example, for blue (non-transparent)
- ocean areas, use (0,0,255,255). To make transparent
- blue oceans (useful if you just want to mask land
- regions over another image), use
- rgba_ocean = (0,0,255,0).
+ land_color desired land color (color name or rgba tuple).
+ rgba_ocean desired ocean color (color name or rgba tuple).
============== ====================================================
.. tabularcolumns:: |l|L|
@@ -2995,6 +2988,22 @@
Extra keyword ``ax`` can be used to override the default axis instance.
"""
+ # convert land and ocean colors to integer rgba tuples with
+ # values between 0 and 255.
+ from matplotlib.colors import ColorConverter
+ c = ColorConverter()
+ # if conversion fails, assume it's because the color
+ # given is already an rgba tuple with values between 0 and 255.
+ try:
+ cl = c.to_rgba(land_color)
+ rgba_land = tuple([int(255*x) for x in cl])
+ except:
+ rgba_land = land_color
+ try:
+ co = c.to_rgba(ocean_color)
+ rgba_ocean = tuple([int(255*x) for x in co])
+ except:
+ rgba_ocean = ocean_color
# look for axes instance (as keyword, an instance variable
# or from plt.gca().
if not kwargs.has_key('ax') and self.ax is None:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-08-01 17:10:41
|
Revision: 5947
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5947&view=rev
Author: mdboom
Date: 2008-08-01 17:10:38 +0000 (Fri, 01 Aug 2008)
Log Message:
-----------
Added Perry's part of Day 2 to outline.
Modified Paths:
--------------
trunk/py4science/classes/0808_scipy_agenda.txt
Modified: trunk/py4science/classes/0808_scipy_agenda.txt
===================================================================
--- trunk/py4science/classes/0808_scipy_agenda.txt 2008-08-01 15:04:46 UTC (rev 5946)
+++ trunk/py4science/classes/0808_scipy_agenda.txt 2008-08-01 17:10:38 UTC (rev 5947)
@@ -97,7 +97,7 @@
Day 2
=====
-* basic plotting with matplotlib
+* basic plotting with matplotlib (90 min) [Mike]
* basic line/scatter plotting
* customizing colors, styles
* legend
@@ -105,7 +105,12 @@
* matplotlibrc
* math text
-... probably some of Perry's content here ...
+* intermediate numpy (90 min) [Perry]
+ * advanced indexing
+ * use of where
+ * zen, examples of vectorizing
+ * ieee special number and error handling (5 min)
+ * masked arrays (10-15 min)
* advanced plotting with matplotlib
* the object-oriented API
@@ -115,3 +120,18 @@
* histograms
* images
* color maps
+
+* advanced numpy (Below is probably overloaded, will have to cull) (90 min) [Perry]
+ * memory management (5*10 min)
+ * memory mapped arrays
+ * array internals/indexing order issues (10 min)
+ * general performance issues (5 min)
+ * record arrays (10 min)
+ * object arrays (5 min)
+ * character arrays (5 min)
+ * interfacing to PIL (5 min)
+ * standard lib review (fft, random, etc, some of these will be used in examples before this so this seems questionable...) (5 min)
+ * interfacing to C/C++/Fortran review (10 min)
+ * no real details, just a survey of different approaches
+
+* scipy review (45 min?) [preferably Travis can do this, did he respond?]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-08-01 15:04:48
|
Revision: 5946
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5946&view=rev
Author: mdboom
Date: 2008-08-01 15:04:46 +0000 (Fri, 01 Aug 2008)
Log Message:
-----------
Merged revisions 5846-5945 via svnmerge from
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_91_maint
........
r5852 | sameerd | 2008-07-24 17:56:57 -0400 (Thu, 24 Jul 2008) | 3 lines
Fixing edge cases in rec_join in branch
........
r5945 | mdboom | 2008-08-01 11:00:35 -0400 (Fri, 01 Aug 2008) | 2 lines
Backport memory leak fixes in _ttconv.cpp
........
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
- /branches/v0_91_maint:1-5845
+ /branches/v0_91_maint:1-5945
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-08-01 15:00:35 UTC (rev 5945)
+++ trunk/matplotlib/CHANGELOG 2008-08-01 15:04:46 UTC (rev 5946)
@@ -1,3 +1,5 @@
+2008-08-01 Backported memory leak fixes in _ttconv.cpp - MGD
+
2008-07-31 Added masked array support to griddata. - JSW
2008-07-26 Added optional C and reduce_C_function arguments to
@@ -48,6 +50,9 @@
2008-07-17 Fix bug with NaNs at end of path (thanks, Andrew Straw for
the report) - MGD
+2008-07-16 Improve error handling in texmanager, thanks to Ian Henry
+ for reporting - DSD
+
2008-07-12 Added support for external backends with the
"module://my_backend" syntax - JDH
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-08-01 15:00:43
|
Revision: 5945
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5945&view=rev
Author: mdboom
Date: 2008-08-01 15:00:35 +0000 (Fri, 01 Aug 2008)
Log Message:
-----------
Backport memory leak fixes in _ttconv.cpp
Modified Paths:
--------------
branches/v0_91_maint/CHANGELOG
branches/v0_91_maint/src/_ttconv.cpp
Modified: branches/v0_91_maint/CHANGELOG
===================================================================
--- branches/v0_91_maint/CHANGELOG 2008-08-01 12:19:26 UTC (rev 5944)
+++ branches/v0_91_maint/CHANGELOG 2008-08-01 15:00:35 UTC (rev 5945)
@@ -1,3 +1,5 @@
+2008-08-01 Backported memory leak fixes in _ttconv.cpp - MGD
+
2008-07-24 Deprecated (raise NotImplementedError) all the mlab2
functions from matplotlib.mlab out of concern that some of
them were not clean room implementations. JDH
@@ -2,3 +4,3 @@
-2008-07-16 Improve error handling in texmanager, thanks to Ian Henry
+2008-07-16 Improve error handling in texmanager, thanks to Ian Henry
for reporting - DSD
Modified: branches/v0_91_maint/src/_ttconv.cpp
===================================================================
--- branches/v0_91_maint/src/_ttconv.cpp 2008-08-01 12:19:26 UTC (rev 5944)
+++ branches/v0_91_maint/src/_ttconv.cpp 2008-08-01 15:00:35 UTC (rev 5945)
@@ -25,22 +25,23 @@
}
~PythonFileWriter() {
- if (_write_method)
- Py_DECREF(_write_method);
+ Py_XDECREF(_write_method);
}
void set(PyObject* write_method) {
- if (_write_method)
- Py_DECREF(_write_method);
+ Py_XDECREF(_write_method);
_write_method = write_method;
- if (_write_method)
- Py_INCREF(_write_method);
+ Py_XINCREF(_write_method);
}
virtual void write(const char* a) {
- if (_write_method)
- if (! PyObject_CallFunction(_write_method, (char *)"s", a))
+ PyObject* result = NULL;
+ if (_write_method) {
+ result = PyObject_CallFunction(_write_method, (char *)"s", a);
+ if (! result)
throw PythonExceptionOccurred();
+ Py_DECREF(result);
+ }
}
};
@@ -54,6 +55,7 @@
}
file_writer->set(write_method);
+ Py_DECREF(write_method);
return 1;
}
@@ -68,11 +70,14 @@
PyObject* item;
while ( (item = PyIter_Next(iterator)) ) {
long value = PyInt_AsLong(item);
+ Py_DECREF(item);
if (value == -1 && PyErr_Occurred())
return 0;
result->push_back(value);
}
+ Py_DECREF(iterator);
+
return 1;
}
@@ -83,11 +88,11 @@
int fonttype;
std::vector<int> glyph_ids;
- static const char *kwlist[] = {
+ static const char *kwlist[] = {
"filename", "output", "fonttype", "glyph_ids", NULL };
if (! PyArg_ParseTupleAndKeywords
- (args, kwds,
- "sO&i|O&:convert_ttf_to_ps",
+ (args, kwds,
+ "sO&i|O&:convert_ttf_to_ps",
(char**)kwlist,
&filename,
fileobject_to_PythonFileWriter,
@@ -96,9 +101,9 @@
pyiterable_to_vector_int,
&glyph_ids))
return NULL;
-
+
if (fonttype != 3 && fonttype != 42) {
- PyErr_SetString(PyExc_ValueError,
+ PyErr_SetString(PyExc_ValueError,
"fonttype must be either 3 (raw Postscript) or 42 "
"(embedded Truetype)");
return NULL;
@@ -109,7 +114,7 @@
} catch (TTException& e) {
PyErr_SetString(PyExc_RuntimeError, e.getMessage());
return NULL;
- } catch (PythonExceptionOccurred& e) {
+ } catch (PythonExceptionOccurred& ) {
return NULL;
} catch (...) {
PyErr_SetString(PyExc_RuntimeError, "Unknown C++ exception");
@@ -130,9 +135,13 @@
virtual void add_pair(const char* a, const char* b) {
PyObject* value = PyString_FromString(b);
- if (value)
- if (PyDict_SetItemString(_dict, a, value))
+ if (value) {
+ if (PyDict_SetItemString(_dict, a, value)) {
+ Py_DECREF(value);
throw PythonExceptionOccurred();
+ }
+ }
+ Py_DECREF(value);
}
};
@@ -144,8 +153,8 @@
static const char *kwlist[] = { "filename", "glyph_ids", NULL };
if (! PyArg_ParseTupleAndKeywords
- (args, kwds,
- "s|O&:convert_ttf_to_ps",
+ (args, kwds,
+ "s|O&:get_pdf_charprocs",
(char **)kwlist,
&filename,
pyiterable_to_vector_int,
@@ -161,11 +170,14 @@
try {
::get_pdf_charprocs( filename, glyph_ids, dict );
} catch (TTException& e) {
+ Py_DECREF(result);
PyErr_SetString(PyExc_RuntimeError, e.getMessage());
return NULL;
- } catch (PythonExceptionOccurred& e) {
+ } catch (PythonExceptionOccurred& ) {
+ Py_DECREF(result);
return NULL;
} catch (...) {
+ Py_DECREF(result);
PyErr_SetString(PyExc_RuntimeError, "Unknown C++ exception");
return NULL;
}
@@ -174,7 +186,7 @@
}
static PyMethodDef ttconv_methods[] = {
- {"convert_ttf_to_ps", (PyCFunction)convert_ttf_to_ps, METH_KEYWORDS,
+ {"convert_ttf_to_ps", (PyCFunction)convert_ttf_to_ps, METH_KEYWORDS,
"convert_ttf_to_ps(filename, output, fonttype, glyph_ids)\n"
"\n"
"Converts the Truetype font into a Type 3 or Type 42 Postscript font, "
@@ -191,7 +203,7 @@
"then all glyphs will be included. If any of the glyphs specified are "
"composite glyphs, then the component glyphs will also be included."
},
- {"get_pdf_charprocs", (PyCFunction)py_get_pdf_charprocs, METH_KEYWORDS,
+ {"get_pdf_charprocs", (PyCFunction)py_get_pdf_charprocs, METH_KEYWORDS,
"get_pdf_charprocs(filename, glyph_ids)\n"
"\n"
"Given a Truetype font file, returns a dictionary containing the PDF Type 3\n"
@@ -204,14 +216,14 @@
"the values are the stream content needed to render that glyph. This\n"
"is useful to generate the CharProcs dictionary in a PDF Type 3 font.\n"
},
- {NULL} /* Sentinel */
+ {0, 0, 0, 0} /* Sentinel */
};
#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */
#define PyMODINIT_FUNC void
#endif
PyMODINIT_FUNC
-initttconv(void)
+initttconv(void)
{
PyObject* m;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-08-01 12:19:30
|
Revision: 5944
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5944&view=rev
Author: jswhit
Date: 2008-08-01 12:19:26 +0000 (Fri, 01 Aug 2008)
Log Message:
-----------
fix typo
Modified Paths:
--------------
trunk/toolkits/basemap/doc/users/geography.rst
Modified: trunk/toolkits/basemap/doc/users/geography.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/geography.rst 2008-08-01 12:18:07 UTC (rev 5943)
+++ trunk/toolkits/basemap/doc/users/geography.rst 2008-08-01 12:19:26 UTC (rev 5944)
@@ -30,7 +30,7 @@
image as a map background.
* :func:`~mpl_toolkits.basemap.Basemap.warpimage`: use an abitrary
image as a map background. The image must be global, covering the
- world in lat/lon cooridinates from dateline to dateline and South
- Pole to North Pole.
+ world in lat/lon coordinates from the international dateline eastward
+ and the South Pole northward.
.. toctree::
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-08-01 12:18:11
|
Revision: 5943
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5943&view=rev
Author: jswhit
Date: 2008-08-01 12:18:07 +0000 (Fri, 01 Aug 2008)
Log Message:
-----------
add some more text
Modified Paths:
--------------
trunk/toolkits/basemap/doc/users/geography.rst
Modified: trunk/toolkits/basemap/doc/users/geography.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/geography.rst 2008-08-01 12:14:29 UTC (rev 5942)
+++ trunk/toolkits/basemap/doc/users/geography.rst 2008-08-01 12:18:07 UTC (rev 5943)
@@ -1,7 +1,7 @@
.. _geography:
-Drawing Coastlines, Rivers and Political Boundaries
-===================================================
+Drawing a Map Background
+========================
Basemap includes the
`GSSH <http://www.soest.hawaii.edu/wessel/gshhs/gshhs.html>`_
@@ -20,4 +20,17 @@
in North America.
* :func:`~mpl_toolkits.basemap.Basemap.drawrivers`: draw rivers.
+Instead of drawing coastlines and political boundaries, an image can be
+used as a map background. Basemap provides several options for this:
+
+* :func:`~mpl_toolkits.basemap.Basemap.drawlsmask`: draw a high-resolution
+ land-sea mask as an image, with land and ocean colors specified.
+* :func:`~mpl_toolkits.basemap.Basemap.bluemarble`: draw a NASA
+ `Blue Marble <http://visibleearth.nasa.gov/view_set.php?categoryID=2363>`_
+ image as a map background.
+* :func:`~mpl_toolkits.basemap.Basemap.warpimage`: use an abitrary
+ image as a map background. The image must be global, covering the
+ world in lat/lon cooridinates from dateline to dateline and South
+ Pole to North Pole.
+
.. toctree::
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-08-01 12:14:31
|
Revision: 5942
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5942&view=rev
Author: dsdale
Date: 2008-08-01 12:14:29 +0000 (Fri, 01 Aug 2008)
Log Message:
-----------
added backend_fallback to traited config
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/config/mplconfig.py
Modified: trunk/matplotlib/lib/matplotlib/config/mplconfig.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2008-07-31 19:08:08 UTC (rev 5941)
+++ trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2008-08-01 12:14:29 UTC (rev 5942)
@@ -64,6 +64,7 @@
class backend(TConfig):
use = T.Trait('Agg', mplT.BackendHandler())
+ fallback = T.Trait(True, mplT.BoolHandler())
class cairo(TConfig):
format = T.Trait('png', 'png', 'ps', 'pdf', 'svg')
@@ -284,6 +285,7 @@
self.tconfig_map = {
'backend' : (self.tconfig.backend, 'use'),
+ 'backend_fallback' : (self.tconfig.backend, 'fallback'),
'numerix' : (self.tconfig, 'numerix'),
'maskedarray' : (self.tconfig, 'maskedarray'),
'toolbar' : (self.tconfig, 'toolbar'),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-07-31 19:08:14
|
Revision: 5941
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5941&view=rev
Author: jdh2358
Date: 2008-07-31 19:08:08 +0000 (Thu, 31 Jul 2008)
Log Message:
-----------
bumbed release number
Modified Paths:
--------------
trunk/matplotlib/doc/pyplots/tex_demo.pdf
trunk/matplotlib/lib/matplotlib/__init__.py
Modified: trunk/matplotlib/doc/pyplots/tex_demo.pdf
===================================================================
--- trunk/matplotlib/doc/pyplots/tex_demo.pdf 2008-07-31 19:05:30 UTC (rev 5940)
+++ trunk/matplotlib/doc/pyplots/tex_demo.pdf 2008-07-31 19:08:08 UTC (rev 5941)
@@ -4,9 +4,9 @@
<< /Type /Catalog /Pages 3 0 R >>
endobj
2 0 obj
-<< /CreationDate (D:20080613153922-04'00')
+<< /CreationDate (D:20080731010125-07'00')
/Producer (matplotlib pdf backend)
-/Creator (matplotlib 0.98.0, http://matplotlib.sf.net) >>
+/Creator (matplotlib 0.98.3rc2, http://matplotlib.sf.net) >>
endobj
3 0 obj
<< /Count 1 /Kids [ 4 0 R ] /Type /Pages >>
@@ -22,28 +22,26 @@
5 0 obj
<< /Filter /FlateDecode /Length 11 0 R >>
stream
-x\x9C\xCDYM\x8F]5\x9D\xB5\xFF\xC1\xEC\xCC.Yĩ\xBB\Fb\x83"Eb$\xA0H\xC0\x82\x8F2J\x830\xFC\xFD9\xF6}/\xFD\x9E}\xE9<u\xA4\xCE,\x92n\xFB\x96\xCB\xF6\xA9\xE3Se\xB7ħ\x91\xE3s\xFC{(R\xBC\x8EY?_\x8E\x9F\xE2\x8E\xDF\xE8\xF5O\xF4\x87a\xF7$dM\xFDsr\x8CP\xEF?G\xE3屡\x94\xF2p\xD2\xCD\xCE\xC3^~;ik.ɢ\xE3\xFFW\xCF\xE2\x97\xF1\x971\xC7ώ3
-X\x9C%+\xB0\x94\x96\x8C
-{\x93ׅ3̤&Qe\xCB\xDCWS4\xF3 \xA2I\x85\xB3\xB5Z밯\x89$Gᚚre\xD5\xEC}\x89\x86i\xB0z\xE6\xC4\xD9+\xA9\xF6^\x85\x95!M\xE4DZ-g\xEE\xFD5i\x93\xC8M\x93\xCC\xEBlV\xD1_)9ܰk2f\xCD\xD4T[\xEF\xCFI)\xAE\x92
-{)R\xBC\xF5U֚\xAAE\xC6\xE4\xF5dV\xE7$\x8C\xEE\xECX\x93\x93Za\x92ޟ\x93U \xAC%5i\xE2Yͭ\xF7{b\xC1\xACثT\xAA\L\xB9\xEF\xA9q*\xD83\xDC37\xC3VǬ\xAD$,\xA6\xC1;\xBB\xB5\xB1\xF4\xDEl8;\xE7\\xF36'#4\xADH\xAC\xBE\xDCJ#3\xFD%e\xF2`%i\xAE\xE8sk\x87\xC3\xE4\x96c1ĥ5-\xA5#\x80 ![\xA2\x93I\x99K\xAA\xD5BƎ\xCD\xC5
-[\xB5\xD1\xDFN\x89ةW/J"#\xDA,\x82\xE5\x816X\x94a\x9DU\x8B\x8FU
-\xA6\xCB9\x80\xA5eG<\xA8n\xF6\xAD\xD3k#(b\x8D\xC9ќ\x8D\xD49wzC\x87\xAF\x8B |
|
From: <md...@us...> - 2008-07-31 19:05:35
|
Revision: 5940
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5940&view=rev
Author: mdboom
Date: 2008-07-31 19:05:30 +0000 (Thu, 31 Jul 2008)
Log Message:
-----------
Fix image maps in inheritance diagrams.
Modified Paths:
--------------
trunk/matplotlib/doc/sphinxext/inheritance_diagram.py
Modified: trunk/matplotlib/doc/sphinxext/inheritance_diagram.py
===================================================================
--- trunk/matplotlib/doc/sphinxext/inheritance_diagram.py 2008-07-31 18:39:37 UTC (rev 5939)
+++ trunk/matplotlib/doc/sphinxext/inheritance_diagram.py 2008-07-31 19:05:30 UTC (rev 5940)
@@ -326,10 +326,10 @@
# Create a mapping from fully-qualified class names to URLs.
urls = {}
for child in node:
- if 'refuri' in child:
- urls[child['reftitle']] = child['refuri']
- elif 'refid' in child:
- urls[child['reftitle']] = '#' + child['refid']
+ if child.get('refuri') is not None:
+ urls[child['reftitle']] = child.get('refuri')
+ elif child.get('refid') is not None:
+ urls[child['reftitle']] = '#' + child.get('refid')
# These arguments to dot will save a PNG file to disk and write
# an HTML image map to stdout.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-07-31 18:39:41
|
Revision: 5939
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5939&view=rev
Author: mdboom
Date: 2008-07-31 18:39:37 +0000 (Thu, 31 Jul 2008)
Log Message:
-----------
Remove warnings in _delaunay.cpp and consolidate duplicate cleanup code (so it doesn't have to be manually kept in sync).
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/delaunay/_delaunay.cpp
Modified: trunk/matplotlib/lib/matplotlib/delaunay/_delaunay.cpp
===================================================================
--- trunk/matplotlib/lib/matplotlib/delaunay/_delaunay.cpp 2008-07-31 18:38:56 UTC (rev 5938)
+++ trunk/matplotlib/lib/matplotlib/delaunay/_delaunay.cpp 2008-07-31 18:39:37 UTC (rev 5939)
@@ -12,8 +12,8 @@
extern "C" {
-static void reorder_edges(int npoints, int ntriangles,
- double *x, double *y,
+static void reorder_edges(int npoints, int ntriangles,
+ double *x, double *y,
int *edge_db, int *tri_edges, int *tri_nbrs)
{
int neighbors[3], nodes[3];
@@ -69,7 +69,7 @@
// Not trusting me? Okay, let's go through it:
// We have three edges to deal with and three nodes. Without loss
- // of generality, let's label the nodes A, B, and C with (A, B)
+ // of generality, let's label the nodes A, B, and C with (A, B)
// forming the first edge in the order they arrive on input.
// Then there are eight possibilities as to how the other edge-tuples
// may be labeled, but only two variations that are going to affect the
@@ -85,7 +85,7 @@
// The second test we need to perform is for counter-clockwiseness.
// Again, there are only two variations that will affect the outcome:
// either ABC is counter-clockwise, or it isn't. In the former case,
- // we're done setting the node order, we just need to associate the
+ // we're done setting the node order, we just need to associate the
// appropriate neighbor triangles with their opposite nodes, something
// which can be done by inspection. In the latter case, to order the
// nodes counter-clockwise, we only have to switch B and C to get
@@ -113,8 +113,8 @@
static PyObject* getMesh(int npoints, double *x, double *y)
{
- PyObject *vertices, *edge_db, *tri_edges, *tri_nbrs;
- PyObject *temp;
+ PyObject *vertices = NULL, *edge_db = NULL, *tri_edges = NULL, *tri_nbrs = NULL;
+ PyObject *temp = NULL;
int tri0, tri1, reg0, reg1;
double tri0x, tri0y, tri1x, tri1y;
int length, numtri, i, j;
@@ -136,21 +136,21 @@
dim[0] = length;
dim[1] = 2;
edge_db = PyArray_SimpleNew(2, dim, PyArray_INT);
- if (!edge_db) goto fail;
+ if (!edge_db) goto exit;
edge_db_ptr = (int*)PyArray_DATA(edge_db);
-
+
dim[0] = numtri;
vertices = PyArray_SimpleNew(2, dim, PyArray_DOUBLE);
- if (!vertices) goto fail;
+ if (!vertices) goto exit;
vertices_ptr = (double*)PyArray_DATA(vertices);
dim[1] = 3;
tri_edges = PyArray_SimpleNew(2, dim, PyArray_INT);
- if (!tri_edges) goto fail;
+ if (!tri_edges) goto exit;
tri_edges_ptr = (int*)PyArray_DATA(tri_edges);
tri_nbrs = PyArray_SimpleNew(2, dim, PyArray_INT);
- if (!tri_nbrs) goto fail;
+ if (!tri_nbrs) goto exit;
tri_nbrs_ptr = (int*)PyArray_DATA(tri_nbrs);
for (i=0; i<(3*numtri); i++) {
@@ -192,25 +192,17 @@
// tri_edges contains lists of edges; convert to lists of nodes in
// counterclockwise order and reorder tri_nbrs to match. Each node
// corresponds to the edge opposite it in the triangle.
- reorder_edges(npoints, numtri, x, y, edge_db_ptr, tri_edges_ptr,
+ reorder_edges(npoints, numtri, x, y, edge_db_ptr, tri_edges_ptr,
tri_nbrs_ptr);
temp = Py_BuildValue("(OOOO)", vertices, edge_db, tri_edges, tri_nbrs);
- if (!temp) goto fail;
- Py_DECREF(vertices);
- Py_DECREF(edge_db);
- Py_DECREF(tri_edges);
- Py_DECREF(tri_nbrs);
-
- return temp;
-
-fail:
+ exit:
Py_XDECREF(vertices);
Py_XDECREF(edge_db);
Py_XDECREF(tri_edges);
Py_XDECREF(tri_nbrs);
- return NULL;
+ return temp;
}
static PyObject *linear_planes(int ntriangles, double *x, double *y, double *z,
@@ -221,7 +213,7 @@
int i;
double *planes_ptr;
double x02, y02, z02, x12, y12, z12, xy0212;
-
+
dims[0] = ntriangles;
dims[1] = 3;
planes = PyArray_SimpleNew(2, dims, PyArray_DOUBLE);
@@ -240,15 +232,15 @@
xy0212 = y02/y12;
INDEX3(planes_ptr,i,0) = (z02 - z12 * xy0212) / (x02 - x12 * xy0212);
INDEX3(planes_ptr,i,1) = (z12 - INDEX3(planes_ptr,i,0)*x12) / y12;
- INDEX3(planes_ptr,i,2) = (z[INDEX3(nodes,i,2)] -
- INDEX3(planes_ptr,i,0)*x[INDEX3(nodes,i,2)] -
+ INDEX3(planes_ptr,i,2) = (z[INDEX3(nodes,i,2)] -
+ INDEX3(planes_ptr,i,0)*x[INDEX3(nodes,i,2)] -
INDEX3(planes_ptr,i,1)*y[INDEX3(nodes,i,2)]);
} else {
xy0212 = x02/x12;
INDEX3(planes_ptr,i,1) = (z02 - z12 * xy0212) / (y02 - y12 * xy0212);
INDEX3(planes_ptr,i,0) = (z12 - INDEX3(planes_ptr,i,1)*y12) / x12;
- INDEX3(planes_ptr,i,2) = (z[INDEX3(nodes,i,2)] -
- INDEX3(planes_ptr,i,0)*x[INDEX3(nodes,i,2)] -
+ INDEX3(planes_ptr,i,2) = (z[INDEX3(nodes,i,2)] -
+ INDEX3(planes_ptr,i,0)*x[INDEX3(nodes,i,2)] -
INDEX3(planes_ptr,i,1)*y[INDEX3(nodes,i,2)]);
}
}
@@ -256,24 +248,24 @@
return (PyObject*)planes;
}
-static double linear_interpolate_single(double targetx, double targety,
+static double linear_interpolate_single(double targetx, double targety,
double *x, double *y, int *nodes, int *neighbors,
PyObject *planes, double defvalue, int start_triangle, int *end_triangle)
{
double *planes_ptr;
planes_ptr = (double*)PyArray_DATA(planes);
if (start_triangle == -1) start_triangle = 0;
- *end_triangle = walking_triangles(start_triangle, targetx, targety,
+ *end_triangle = walking_triangles(start_triangle, targetx, targety,
x, y, nodes, neighbors);
if (*end_triangle == -1) return defvalue;
- return (targetx*INDEX3(planes_ptr,*end_triangle,0) +
+ return (targetx*INDEX3(planes_ptr,*end_triangle,0) +
targety*INDEX3(planes_ptr,*end_triangle,1) +
INDEX3(planes_ptr,*end_triangle,2));
}
-static PyObject *linear_interpolate_grid(double x0, double x1, int xsteps,
+static PyObject *linear_interpolate_grid(double x0, double x1, int xsteps,
double y0, double y1, int ysteps,
- PyObject *planes, double defvalue,
+ PyObject *planes, double defvalue,
int npoints, double *x, double *y, int *nodes, int *neighbors)
{
int ix, iy;
@@ -312,10 +304,10 @@
static PyObject *compute_planes_method(PyObject *self, PyObject *args)
{
PyObject *pyx, *pyy, *pyz, *pynodes;
- PyObject *x, *y, *z, *nodes;
+ PyObject *x = NULL, *y = NULL, *z = NULL, *nodes = NULL;
int npoints, ntriangles;
- PyObject *planes;
+ PyObject *planes = NULL;
if (!PyArg_ParseTuple(args, "OOOO", &pyx, &pyy, &pyz, &pynodes)) {
return NULL;
@@ -323,58 +315,52 @@
x = PyArray_FROMANY(pyx, PyArray_DOUBLE, 1, 1, NPY_IN_ARRAY);
if (!x) {
PyErr_SetString(PyExc_ValueError, "x must be a 1-D array of floats");
- goto fail;
+ goto exit;
}
y = PyArray_FROMANY(pyy, PyArray_DOUBLE, 1, 1, NPY_IN_ARRAY);
if (!y) {
PyErr_SetString(PyExc_ValueError, "y must be a 1-D array of floats");
- goto fail;
+ goto exit;
}
z = PyArray_FROMANY(pyz, PyArray_DOUBLE, 1, 1, NPY_IN_ARRAY);
if (!z) {
PyErr_SetString(PyExc_ValueError, "z must be a 1-D array of floats");
- goto fail;
+ goto exit;
}
npoints = PyArray_DIM(x, 0);
if ((PyArray_DIM(y, 0) != npoints) || (PyArray_DIM(z, 0) != npoints)) {
PyErr_SetString(PyExc_ValueError, "x,y,z arrays must be of equal length");
- goto fail;
+ goto exit;
}
nodes = PyArray_FROMANY(pynodes, PyArray_INT, 2, 2, NPY_IN_ARRAY);
if (!nodes) {
PyErr_SetString(PyExc_ValueError, "nodes must be a 2-D array of ints");
- goto fail;
+ goto exit;
}
ntriangles = PyArray_DIM(nodes, 0);
if (PyArray_DIM(nodes, 1) != 3) {
PyErr_SetString(PyExc_ValueError, "nodes must have shape (ntriangles, 3)");
- goto fail;
+ goto exit;
}
- planes = linear_planes(ntriangles, (double*)PyArray_DATA(x),
+ planes = linear_planes(ntriangles, (double*)PyArray_DATA(x),
(double*)PyArray_DATA(y), (double*)PyArray_DATA(z), (int*)PyArray_DATA(nodes));
- Py_DECREF(x);
- Py_DECREF(y);
- Py_DECREF(z);
- Py_DECREF(nodes);
-
- return planes;
-
-fail:
+exit:
Py_XDECREF(x);
Py_XDECREF(y);
Py_XDECREF(z);
Py_XDECREF(nodes);
- return NULL;
+
+ return planes;
}
static PyObject *linear_interpolate_method(PyObject *self, PyObject *args)
{
double x0, x1, y0, y1, defvalue;
int xsteps, ysteps;
- PyObject *pyplanes, *pyx, *pyy, *pynodes, *pyneighbors, *grid;
- PyObject *planes, *x, *y, *nodes, *neighbors;
+ PyObject *pyplanes, *pyx, *pyy, *pynodes, *pyneighbors, *grid = NULL;
+ PyObject *planes = NULL, *x = NULL, *y = NULL, *nodes = NULL, *neighbors = NULL;
int npoints;
@@ -385,54 +371,47 @@
x = PyArray_FROMANY(pyx, PyArray_DOUBLE, 1, 1, NPY_IN_ARRAY);
if (!x) {
PyErr_SetString(PyExc_ValueError, "x must be a 1-D array of floats");
- goto fail;
+ goto exit;
}
y = PyArray_FROMANY(pyy, PyArray_DOUBLE, 1, 1, NPY_IN_ARRAY);
if (!y) {
PyErr_SetString(PyExc_ValueError, "y must be a 1-D array of floats");
- goto fail;
+ goto exit;
}
npoints = PyArray_DIM(x, 0);
if (PyArray_DIM(y, 0) != npoints) {
PyErr_SetString(PyExc_ValueError, "x,y arrays must be of equal length");
- goto fail;
+ goto exit;
}
planes = PyArray_FROMANY(pyplanes, PyArray_DOUBLE, 2, 2, NPY_IN_ARRAY);
if (!planes) {
PyErr_SetString(PyExc_ValueError, "planes must be a 2-D array of floats");
- goto fail;
+ goto exit;
}
nodes = PyArray_FROMANY(pynodes, PyArray_INT, 2, 2, NPY_IN_ARRAY);
if (!nodes) {
PyErr_SetString(PyExc_ValueError, "nodes must be a 2-D array of ints");
- goto fail;
+ goto exit;
}
neighbors = PyArray_FROMANY(pyneighbors, PyArray_INT, 2, 2, NPY_IN_ARRAY);
if (!neighbors) {
PyErr_SetString(PyExc_ValueError, "neighbors must be a 2-D array of ints");
- goto fail;
+ goto exit;
}
grid = linear_interpolate_grid(x0, x1, xsteps, y0, y1, ysteps,
(PyObject*)planes, defvalue, npoints,
(double*)PyArray_DATA(x), (double*)PyArray_DATA(y),
(int*)PyArray_DATA(nodes), (int*)PyArray_DATA(neighbors));
-
- Py_DECREF(x);
- Py_DECREF(y);
- Py_DECREF(planes);
- Py_DECREF(nodes);
- Py_DECREF(neighbors);
- return grid;
-
-fail:
+ exit:
Py_XDECREF(x);
Py_XDECREF(y);
Py_XDECREF(planes);
Py_XDECREF(nodes);
Py_XDECREF(neighbors);
- return NULL;
+
+ return grid;
}
// Thanks to C++'s memory rules, we can't use the usual "goto fail;" method of
@@ -455,7 +434,7 @@
{
PyObject *pyx, *pyy, *pyz, *pycenters, *pynodes, *pyneighbors, *pyintx, *pyinty;
PyObject *x = NULL, *y = NULL, *z = NULL, *centers = NULL, *nodes = NULL,
- *neighbors = NULL, *intx = NULL, *inty = NULL, *intz;
+ *neighbors = NULL, *intx = NULL, *inty = NULL, *intz = NULL;
double defvalue;
int size, npoints, ntriangles;
@@ -506,7 +485,7 @@
return NULL;
}
ntriangles = PyArray_DIM(neighbors, 0);
- if ((PyArray_DIM(nodes, 0) != ntriangles) ||
+ if ((PyArray_DIM(nodes, 0) != ntriangles) ||
(PyArray_DIM(centers, 0) != ntriangles)) {
PyErr_SetString(PyExc_ValueError, "centers,nodes,neighbors must be of equal length");
CLEANUP
@@ -542,13 +521,13 @@
return NULL;
}
- NaturalNeighbors nn(npoints, ntriangles,
+ NaturalNeighbors nn(npoints, ntriangles,
(double*)PyArray_DATA(x), (double*)PyArray_DATA(y),
- (double*)PyArray_DATA(centers), (int*)PyArray_DATA(nodes),
+ (double*)PyArray_DATA(centers), (int*)PyArray_DATA(nodes),
(int*)PyArray_DATA(neighbors));
size = PyArray_Size(intx);
- nn.interpolate_unstructured((double*)PyArray_DATA(z), size,
- (double*)PyArray_DATA(intx), (double*)PyArray_DATA(inty),
+ nn.interpolate_unstructured((double*)PyArray_DATA(z), size,
+ (double*)PyArray_DATA(intx), (double*)PyArray_DATA(inty),
(double*)PyArray_DATA(intz), defvalue);
Py_XDECREF(x);
@@ -575,13 +554,13 @@
static PyObject *nn_interpolate_method(PyObject *self, PyObject *args)
{
PyObject *pyx, *pyy, *pyz, *pycenters, *pynodes, *pyneighbors, *grid;
- PyObject *x, *y, *z, *centers, *nodes, *neighbors;
+ PyObject *x = NULL, *y = NULL, *z = NULL, *centers = NULL, *nodes = NULL, *neighbors = NULL;
double x0, x1, y0, y1, defvalue;
int xsteps, ysteps;
int npoints, ntriangles;
intp dims[2];
- if (!PyArg_ParseTuple(args, "ddiddidOOOOOO", &x0, &x1, &xsteps,
+ if (!PyArg_ParseTuple(args, "ddiddidOOOOOO", &x0, &x1, &xsteps,
&y0, &y1, &ysteps, &defvalue, &pyx, &pyy, &pyz, &pycenters, &pynodes,
&pyneighbors)) {
return NULL;
@@ -629,7 +608,7 @@
return NULL;
}
ntriangles = PyArray_DIM(neighbors, 0);
- if ((PyArray_DIM(nodes, 0) != ntriangles) ||
+ if ((PyArray_DIM(nodes, 0) != ntriangles) ||
(PyArray_DIM(centers, 0) != ntriangles)) {
PyErr_SetString(PyExc_ValueError, "centers,nodes,neighbors must be of equal length");
CLEANUP
@@ -644,11 +623,11 @@
return NULL;
}
- NaturalNeighbors nn(npoints, ntriangles,
+ NaturalNeighbors nn(npoints, ntriangles,
(double*)PyArray_DATA(x), (double*)PyArray_DATA(y),
- (double*)PyArray_DATA(centers), (int*)PyArray_DATA(nodes),
+ (double*)PyArray_DATA(centers), (int*)PyArray_DATA(nodes),
(int*)PyArray_DATA(neighbors));
- nn.interpolate_grid((double*)PyArray_DATA(z),
+ nn.interpolate_grid((double*)PyArray_DATA(z),
x0, x1, xsteps,
y0, y1, ysteps,
(double*)PyArray_DATA(grid),
@@ -663,8 +642,8 @@
static PyObject *delaunay_method(PyObject *self, PyObject *args)
{
- PyObject *pyx, *pyy, *mesh;
- PyObject *x, *y;
+ PyObject *pyx, *pyy, *mesh = NULL;
+ PyObject *x = NULL, *y = NULL;
int npoints;
if (!PyArg_ParseTuple(args, "OO", &pyx, &pyy)) {
@@ -673,37 +652,31 @@
x = PyArray_FROMANY(pyx, PyArray_DOUBLE, 1, 1, NPY_IN_ARRAY);
if (!x) {
PyErr_SetString(PyExc_ValueError, "x must be a 1-D array of floats");
- goto fail;
+ goto exit;
}
y = PyArray_FROMANY(pyy, PyArray_DOUBLE, 1, 1, NPY_IN_ARRAY);
if (!y) {
PyErr_SetString(PyExc_ValueError, "y must be a 1-D array of floats");
- goto fail;
+ goto exit;
}
npoints = PyArray_DIM(x, 0);
if (PyArray_DIM(y, 0) != npoints) {
PyErr_SetString(PyExc_ValueError, "x and y must have the same length");
- goto fail;
+ goto exit;
}
mesh = getMesh(npoints, (double*)PyArray_DATA(x), (double*)PyArray_DATA(y));
- if (!mesh) goto fail;
-
- Py_DECREF(x);
- Py_DECREF(y);
-
- return mesh;
-
-fail:
+ exit:
Py_XDECREF(x);
Py_XDECREF(y);
- return NULL;
+
+ return mesh;
}
static PyMethodDef delaunay_methods[] = {
- {"delaunay", (PyCFunction)delaunay_method, METH_VARARGS,
+ {"delaunay", (PyCFunction)delaunay_method, METH_VARARGS,
"Compute the Delaunay triangulation of a cloud of 2-D points.\n\n"
"circumcenters, edges, tri_points, tri_neighbors = delaunay(x, y)\n\n"
"x, y -- shape-(npoints,) arrays of floats giving the X and Y coordinates of the points\n"
@@ -730,7 +703,7 @@
PyMODINIT_FUNC init_delaunay(void)
{
PyObject* m;
- m = Py_InitModule3("_delaunay", delaunay_methods,
+ m = Py_InitModule3("_delaunay", delaunay_methods,
"Tools for computing the Delaunay triangulation and some operations on it.\n"
);
if (m == NULL)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-07-31 18:39:00
|
Revision: 5938
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5938&view=rev
Author: jswhit
Date: 2008-07-31 18:38:56 +0000 (Thu, 31 Jul 2008)
Log Message:
-----------
use 'import numpy as np'
Modified Paths:
--------------
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdftime.py
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/proj.py
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdftime.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdftime.py 2008-07-31 15:37:56 UTC (rev 5937)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdftime.py 2008-07-31 18:38:56 UTC (rev 5938)
@@ -1,7 +1,8 @@
"""
Performs conversions of netCDF time coordinate data to/from datetime objects.
"""
-import math, numpy, re, time
+import math, re, time
+import numpy as np
from datetime import datetime as real_datetime
_units = ['days','hours','minutes','seconds','day','hour','minute','second']
@@ -629,7 +630,7 @@
except:
isscalar = True
if not isscalar:
- date = numpy.array(date)
+ date = np.array(date)
shape = date.shape
if self.calendar in ['julian','standard','gregorian','proleptic_gregorian']:
if isscalar:
@@ -656,7 +657,7 @@
else:
jdelta = [_360DayFromDate(d)-self._jd0 for d in date.flat]
if not isscalar:
- jdelta = numpy.array(jdelta)
+ jdelta = np.array(jdelta)
# convert to desired units, add time zone offset.
if self.units in ['second','seconds']:
jdelta = jdelta*86400. + self.tzoffset*60.
@@ -669,7 +670,7 @@
if isscalar:
return jdelta
else:
- return numpy.reshape(jdelta,shape)
+ return np.reshape(jdelta,shape)
def num2date(self,time_value):
"""
@@ -681,8 +682,8 @@
Resolution is 1 second.
-Works for scalars, sequences and numpy arrays.
-Returns a scalar if input is a scalar, else returns a numpy array.
+Works for scalars, sequences and np arrays.
+Returns a scalar if input is a scalar, else returns a np array.
The datetime instances returned by C{num2date} are 'real' python datetime
objects if the date falls in the Gregorian calendar (i.e.
@@ -699,7 +700,7 @@
except:
isscalar = True
if not isscalar:
- time_value = numpy.array(time_value)
+ time_value = np.array(time_value)
shape = time_value.shape
# convert to desired units, remove time zone offset.
if self.units in ['second','seconds']:
@@ -734,7 +735,7 @@
if isscalar:
return date
else:
- return numpy.reshape(numpy.array(date),shape)
+ return np.reshape(np.array(date),shape)
def _parse_date(origin):
"""Parses a date string and returns a tuple
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/proj.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/proj.py 2008-07-31 15:37:56 UTC (rev 5937)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/proj.py 2008-07-31 18:38:56 UTC (rev 5938)
@@ -1,4 +1,4 @@
-import numpy as npy
+import numpy as np
import pyproj
import math
@@ -92,15 +92,15 @@
self._proj4 = pyproj.Proj(projparams)
# find major and minor axes of ellipse defining map proj region.
delta = 0.01
- lats = npy.arange(0,90,delta)
+ lats = np.arange(0,90,delta)
lon_0 = projparams['lon_0']
- lons = lon_0*npy.ones(len(lats),'d')
+ lons = lon_0*np.ones(len(lats),'d')
x, y = self._proj4(lons, lats)
yi = (y > 1.e20).tolist()
ny = yi.index(1)-1
height = y[ny]
- lons = npy.arange(lon_0,lon_0+90,delta)
- lats = npy.zeros(len(lons),'d')
+ lons = np.arange(lon_0,lon_0+90,delta)
+ lats = np.zeros(len(lons),'d')
x, y = self(lons, lats)
xi = (x > 1.e20).tolist()
nx = xi.index(1)-1
@@ -264,8 +264,8 @@
"""
dx = (self.urcrnrx-self.llcrnrx)/(nx-1)
dy = (self.urcrnry-self.llcrnry)/(ny-1)
- x = self.llcrnrx+dx*npy.indices((ny,nx),npy.float32)[1,:,:]
- y = self.llcrnry+dy*npy.indices((ny,nx),npy.float32)[0,:,:]
+ x = self.llcrnrx+dx*np.indices((ny,nx),np.float32)[1,:,:]
+ y = self.llcrnry+dy*np.indices((ny,nx),np.float32)[0,:,:]
lons, lats = self(x, y, inverse=True)
if returnxy:
return lons, lats, x, y
@@ -280,9 +280,9 @@
"""
dx = (self.urcrnrx-self.llcrnrx)/(nx-1)
dy = (self.urcrnry-self.llcrnry)/(ny-1)
- xy = npy.empty((ny,nx,2), npy.float64)
- xy[...,0] = self.llcrnrx+dx*npy.indices((ny,nx),npy.float32)[1,:,:]
- xy[...,1] = self.llcrnry+dy*npy.indices((ny,nx),npy.float32)[0,:,:]
+ xy = np.empty((ny,nx,2), np.float64)
+ xy[...,0] = self.llcrnrx+dx*np.indices((ny,nx),np.float32)[1,:,:]
+ xy[...,1] = self.llcrnry+dy*np.indices((ny,nx),np.float32)[0,:,:]
lonlat = self(xy, inverse=True)
if returnxy:
return lonlat, xy
@@ -329,9 +329,9 @@
t2 = time.clock()
print 'compute lats/lons for all points on AWIPS 221 grid (%sx%s)' %(nx,ny)
print 'max/min lons'
- print min(npy.ravel(lons)),max(npy.ravel(lons))
+ print min(np.ravel(lons)),max(np.ravel(lons))
print 'max/min lats'
- print min(npy.ravel(lats)),max(npy.ravel(lats))
+ print min(np.ravel(lats)),max(np.ravel(lats))
print 'took',t2-t1,'secs'
print 'Same thing but with a single 3-D array'
t1 = time.clock()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-07-31 15:38:00
|
Revision: 5937
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5937&view=rev
Author: mdboom
Date: 2008-07-31 15:37:56 +0000 (Thu, 31 Jul 2008)
Log Message:
-----------
Fix memory leaks in ttconv (that manifest themselves in the PDF and PS backends).
Modified Paths:
--------------
trunk/matplotlib/src/_ttconv.cpp
Modified: trunk/matplotlib/src/_ttconv.cpp
===================================================================
--- trunk/matplotlib/src/_ttconv.cpp 2008-07-31 14:44:07 UTC (rev 5936)
+++ trunk/matplotlib/src/_ttconv.cpp 2008-07-31 15:37:56 UTC (rev 5937)
@@ -25,22 +25,23 @@
}
~PythonFileWriter() {
- if (_write_method)
- Py_DECREF(_write_method);
+ Py_XDECREF(_write_method);
}
void set(PyObject* write_method) {
- if (_write_method)
- Py_DECREF(_write_method);
+ Py_XDECREF(_write_method);
_write_method = write_method;
- if (_write_method)
- Py_INCREF(_write_method);
+ Py_XINCREF(_write_method);
}
virtual void write(const char* a) {
- if (_write_method)
- if (! PyObject_CallFunction(_write_method, (char *)"s", a))
+ PyObject* result = NULL;
+ if (_write_method) {
+ result = PyObject_CallFunction(_write_method, (char *)"s", a);
+ if (! result)
throw PythonExceptionOccurred();
+ Py_DECREF(result);
+ }
}
};
@@ -54,6 +55,7 @@
}
file_writer->set(write_method);
+ Py_DECREF(write_method);
return 1;
}
@@ -68,11 +70,14 @@
PyObject* item;
while ( (item = PyIter_Next(iterator)) ) {
long value = PyInt_AsLong(item);
+ Py_DECREF(item);
if (value == -1 && PyErr_Occurred())
return 0;
result->push_back(value);
}
+ Py_DECREF(iterator);
+
return 1;
}
@@ -130,9 +135,13 @@
virtual void add_pair(const char* a, const char* b) {
PyObject* value = PyString_FromString(b);
- if (value)
- if (PyDict_SetItemString(_dict, a, value))
+ if (value) {
+ if (PyDict_SetItemString(_dict, a, value)) {
+ Py_DECREF(value);
throw PythonExceptionOccurred();
+ }
+ }
+ Py_DECREF(value);
}
};
@@ -145,7 +154,7 @@
static const char *kwlist[] = { "filename", "glyph_ids", NULL };
if (! PyArg_ParseTupleAndKeywords
(args, kwds,
- "s|O&:convert_ttf_to_ps",
+ "s|O&:get_pdf_charprocs",
(char **)kwlist,
&filename,
pyiterable_to_vector_int,
@@ -161,11 +170,14 @@
try {
::get_pdf_charprocs( filename, glyph_ids, dict );
} catch (TTException& e) {
+ Py_DECREF(result);
PyErr_SetString(PyExc_RuntimeError, e.getMessage());
return NULL;
} catch (PythonExceptionOccurred& ) {
+ Py_DECREF(result);
return NULL;
} catch (...) {
+ Py_DECREF(result);
PyErr_SetString(PyExc_RuntimeError, "Unknown C++ exception");
return NULL;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|