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-02-13 21:24:41
|
Revision: 4961
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4961&view=rev
Author: jswhit
Date: 2008-02-13 13:24:21 -0800 (Wed, 13 Feb 2008)
Log Message:
-----------
added no_rot parameter (only relevant for omerc projection)
Modified Paths:
--------------
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py 2008-02-13 17:15:11 UTC (rev 4960)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py 2008-02-13 21:24:21 UTC (rev 4961)
@@ -79,7 +79,7 @@
projection_params = {'cyl' : 'corners only (no width/height)',
'merc' : 'corners plus lat_ts (no width/height)',
'tmerc' : 'lon_0,lat_0',
- 'omerc' : 'lat_0,lat_1,lat_2,lon_1,lon_2',
+ 'omerc' : 'lon_0,lat_0,lat_1,lat_2,lon_1,lon_2,no_rot',
'mill' : 'corners only (no width/height)',
'lcc' : 'lon_0,lat_0,lat_1,lat_2',
'laea' : 'lon_0,lat_0',
@@ -215,6 +215,9 @@
for oblique mercator.
lon_2 - longitude of one of the two points on the projection centerline
for oblique mercator.
+ no_rot - only used by oblique mercator. If set to True, the map projection
+ coordinates will not be rotated to true North. Default is False (projection
+ coordinates are automatically rotated).
lat_0 - central latitude (y-axis origin) - used by all projections,
Must be equator for mercator projection.
lon_0 - central meridian (x-axis origin) - used by all projections,
@@ -336,6 +339,7 @@
lat_1=None, lat_2=None,
lat_0=None, lon_0=None,
lon_1=None, lon_2=None,
+ no_rot=False,
suppress_ticks=True,
satellite_height=35786000,
boundinglat=None,
@@ -527,13 +531,15 @@
self.llcrnrlon = llcrnrlon; self.llcrnrlat = llcrnrlat
self.urcrnrlon = urcrnrlon; self.urcrnrlat = urcrnrlat
elif projection == 'omerc':
- if lat_1 is None or lon_1 is None or lat_2 is None or lon_2 is None or lat_0 is None:
- raise ValueError, 'must specify lat_0 and lat_1,lon_1 and lat_2,lon_2 for Oblique Mercator basemap'
+ if lat_1 is None or lon_1 is None or lat_2 is None or lon_2 is None:
+ raise ValueError, 'must specify lat_1,lon_1 and lat_2,lon_2 for Oblique Mercator basemap'
projparams['lat_1'] = lat_1
projparams['lon_1'] = lon_1
projparams['lat_2'] = lat_2
projparams['lon_2'] = lon_2
projparams['lat_0'] = lat_0
+ if no_rot:
+ projparams['no_rot']=''
#if not using_corners:
# raise ValueError, 'cannot specify map region with width and height keywords for this projection, please specify lat/lon values of corners'
if not using_corners:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-02-13 17:15:18
|
Revision: 4960
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4960&view=rev
Author: jswhit
Date: 2008-02-13 09:15:11 -0800 (Wed, 13 Feb 2008)
Log Message:
-----------
renamed _geos to _geoslib, fixes for omerc
Modified Paths:
--------------
trunk/toolkits/basemap/Changelog
trunk/toolkits/basemap/examples/test.py
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py
trunk/toolkits/basemap/setup.py
Added Paths:
-----------
trunk/toolkits/basemap/src/_geoslib.c
trunk/toolkits/basemap/src/_geoslib.pyx
Removed Paths:
-------------
trunk/toolkits/basemap/src/_geos.c
trunk/toolkits/basemap/src/_geos.pyx
Modified: trunk/toolkits/basemap/Changelog
===================================================================
--- trunk/toolkits/basemap/Changelog 2008-02-13 13:50:29 UTC (rev 4959)
+++ trunk/toolkits/basemap/Changelog 2008-02-13 17:15:11 UTC (rev 4960)
@@ -6,6 +6,9 @@
namespace package, so basemap can now be installed
if matplotlib is installed as an egg. Python 2.3
support re-enabled.
+ * changed _geos to _geoslib, so as not to conflict with
+ the python module bundled with the GEOS library.
+ * some fixes/enhancements for omerc projection.
version 0.9.9.1 (svn revision 4808)
* require python 2.4 (really only needed for building).
Once namespace packages are re-enabled in matplotlib,
Modified: trunk/toolkits/basemap/examples/test.py
===================================================================
--- trunk/toolkits/basemap/examples/test.py 2008-02-13 13:50:29 UTC (rev 4959)
+++ trunk/toolkits/basemap/examples/test.py 2008-02-13 17:15:11 UTC (rev 4960)
@@ -196,10 +196,9 @@
# create new figure
fig=figure()
# setup oblique mercator basemap.
-m = Basemap(llcrnrlon=-130.,llcrnrlat=39,urcrnrlon=-124.,urcrnrlat=60.,\
+m = Basemap(height=16700000,width=12000000,
resolution='l',area_thresh=1000.,projection='omerc',\
- lon_2=-140,lat_2=55,lon_1=-120,lat_1=40)
-fig.add_axes([0.125,0.2,0.6,0.6])
+ lon_0=-100,lat_0=15,lon_2=-120,lat_2=65,lon_1=-50,lat_1=-55)
# transform to nx x ny regularly spaced native projection grid
nx = int((m.xmax-m.xmin)/20000.)+1; ny = int((m.ymax-m.ymin)/20000.)+1
topodat = m.transform_scalar(topoin,lons,lats,nx,ny)
@@ -216,13 +215,9 @@
m.drawcountries()
m.drawstates()
# draw parallels
-delat = 3.
-circles = arange(40,60,delat)
-m.drawparallels(circles,labels=[1,0,0,0],fontsize=10)
+m.drawparallels(arange(-80,81,20),labels=[1,0,0,0],fontsize=10)
# draw meridians
-delon = 3.
-meridians = arange(-140,-120,delon)
-m.drawmeridians(meridians,labels=[0,0,0,1],fontsize=10)
+m.drawmeridians(arange(-180,181,30),labels=[0,0,0,1],fontsize=10)
title('Oblique Mercator Projection')
print 'plotting Oblique Mercator example ...'
print m.srs
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py 2008-02-13 13:50:29 UTC (rev 4959)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py 2008-02-13 17:15:11 UTC (rev 4960)
@@ -36,7 +36,7 @@
import numpy as npy
from numpy import linspace, squeeze, ma
from shapelib import ShapeFile
-import _geos, pupynere, netcdftime
+import _geoslib, pupynere, netcdftime
# basemap data files now installed in lib/matplotlib/toolkits/basemap/data
basemap_datadir = os.sep.join([os.path.dirname(__file__), 'data'])
@@ -79,7 +79,7 @@
projection_params = {'cyl' : 'corners only (no width/height)',
'merc' : 'corners plus lat_ts (no width/height)',
'tmerc' : 'lon_0,lat_0',
- 'omerc' : 'lon_0,lat_0,lat_1,lat_2,lon_1,lon_2,no width/height',
+ 'omerc' : 'lat_0,lat_1,lat_2,lon_1,lon_2',
'mill' : 'corners only (no width/height)',
'lcc' : 'lon_0,lat_0,lat_1,lat_2',
'laea' : 'lon_0,lat_0',
@@ -527,14 +527,23 @@
self.llcrnrlon = llcrnrlon; self.llcrnrlat = llcrnrlat
self.urcrnrlon = urcrnrlon; self.urcrnrlat = urcrnrlat
elif projection == 'omerc':
- if lat_1 is None or lon_1 is None or lat_2 is None or lon_2 is None:
- raise ValueError, 'must specify lat_1,lon_1 and lat_2,lon_2 for Oblique Mercator basemap'
+ if lat_1 is None or lon_1 is None or lat_2 is None or lon_2 is None or lat_0 is None:
+ raise ValueError, 'must specify lat_0 and lat_1,lon_1 and lat_2,lon_2 for Oblique Mercator basemap'
projparams['lat_1'] = lat_1
projparams['lon_1'] = lon_1
projparams['lat_2'] = lat_2
projparams['lon_2'] = lon_2
+ projparams['lat_0'] = lat_0
+ #if not using_corners:
+ # raise ValueError, 'cannot specify map region with width and height keywords for this projection, please specify lat/lon values of corners'
if not using_corners:
- raise ValueError, 'cannot specify map region with width and height keywords for this projection, please specify lat/lon values of corners'
+ if width is None or height is None:
+ raise ValueError, 'must either specify lat/lon values of corners (llcrnrlon,llcrnrlat,ucrnrlon,urcrnrlat) in degrees or width and height in meters'
+ if lon_0 is None or lat_0 is None:
+ raise ValueError, 'must specify lon_0 and lat_0 when using width, height to specify projection region'
+ llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat = _choosecorners(width,height,**projparams)
+ self.llcrnrlon = llcrnrlon; self.llcrnrlat = llcrnrlat
+ self.urcrnrlon = urcrnrlon; self.urcrnrlat = urcrnrlat
elif projection == 'aeqd':
if lat_0 is None or lon_0 is None:
raise ValueError, 'must specify lat_0 and lon_0 for Azimuthal Equidistant basemap'
@@ -736,12 +745,12 @@
polygon_types = []
# coastlines are polygons, other boundaries are line segments.
if name == 'gshhs':
- Shape = _geos.Polygon
+ Shape = _geoslib.Polygon
else:
- Shape = _geos.LineString
+ Shape = _geoslib.LineString
# see if map projection region polygon contains a pole.
- NPole = _geos.Point(self(0.,90.))
- SPole = _geos.Point(self(0.,-90.))
+ NPole = _geoslib.Point(self(0.,90.))
+ SPole = _geoslib.Point(self(0.,-90.))
boundarypolyxy = self._boundarypolyxy
boundarypolyll = self._boundarypolyll
hasNP = NPole.within(boundarypolyxy)
@@ -749,7 +758,8 @@
containsPole = hasNP or hasSP
# these projections cannot cross pole.
if containsPole and\
- self.projection in ['tmerc','cass','omerc','merc','mill','cyl','robin','moll','sinu','geos']:
+ self.projection in ['merc','mill','cyl','robin','moll','sinu','geos']:
+ #self.projection in ['tmerc','omerc','cass','merc','mill','cyl','robin','moll','sinu','geos']:
raise ValueError('%s projection cannot cross pole'%(self.projection))
# make sure orthographic projection has containsPole=True
# we will compute the intersections in stereographic
@@ -770,7 +780,7 @@
b = self._boundarypolyll.boundary
blons = b[:,0]; blats = b[:,1]
b[:,0], b[:,1] = maptran(blons, blats)
- boundarypolyxy = _geos.Polygon(b)
+ boundarypolyxy = _geoslib.Polygon(b)
for line in bdatmetafile:
linesplit = line.split()
area = float(linesplit[1])
@@ -817,7 +827,7 @@
lats.append(-90.)
b = npy.empty((len(lons),2),npy.float64)
b[:,0] = lons; b[:,1] = lats
- poly = _geos.Polygon(b)
+ poly = _geoslib.Polygon(b)
antart = True
else:
poly = Shape(b)
@@ -940,7 +950,7 @@
y = rminor*npy.sin(thetas) + rminor
b = npy.empty((len(x),2),npy.float64)
b[:,0]=x; b[:,1]=y
- boundaryxy = _geos.Polygon(b)
+ boundaryxy = _geoslib.Polygon(b)
# compute proj instance for full disk, if necessary.
if not self._fulldisk:
projparms = self.projparams.copy()
@@ -979,7 +989,7 @@
x, y = maptran(lons,lats)
b = npy.empty((len(x),2),npy.float64)
b[:,0]=x; b[:,1]=y
- boundaryxy = _geos.Polygon(b)
+ boundaryxy = _geoslib.Polygon(b)
else: # all other projections are rectangular.
# left side (x = xmin, ymin <= y <= ymax)
yy = linspace(self.ymin, self.ymax, ny)[:-1]
@@ -1000,7 +1010,7 @@
b = npy.empty((4,2),npy.float64)
b[:,0]=[self.xmin,self.xmin,self.xmax,self.xmax]
b[:,1]=[self.ymin,self.ymax,self.ymax,self.ymin]
- boundaryxy = _geos.Polygon(b)
+ boundaryxy = _geoslib.Polygon(b)
if self.projection in ['mill','merc','cyl']:
# make sure map boundary doesn't quite include pole.
if self.urcrnrlat > 89.9999:
@@ -1016,7 +1026,7 @@
x, y = self(lons, lats)
b = npy.empty((len(x),2),npy.float64)
b[:,0]=x; b[:,1]=y
- boundaryxy = _geos.Polygon(b)
+ boundaryxy = _geoslib.Polygon(b)
else:
if self.projection not in ['moll','robin','sinu']:
lons, lats = maptran(x,y,inverse=True)
@@ -1034,7 +1044,7 @@
n = n + 1
b = npy.empty((len(lons),2),npy.float64)
b[:,0]=lons; b[:,1]=lats
- boundaryll = _geos.Polygon(b)
+ boundaryll = _geoslib.Polygon(b)
return boundaryll, boundaryxy
Modified: trunk/toolkits/basemap/setup.py
===================================================================
--- trunk/toolkits/basemap/setup.py 2008-02-13 13:50:29 UTC (rev 4959)
+++ trunk/toolkits/basemap/setup.py 2008-02-13 17:15:11 UTC (rev 4960)
@@ -31,7 +31,7 @@
else:
return [("HAVE_UPDATE_HEADER", "0")]
-def check_geosversion(GEOS_dir):
+def checkversion(GEOS_dir):
"""check geos C-API header file (geos_c.h)"""
try:
f = open(os.path.join(GEOS_dir,'include/geos_c.h'))
@@ -54,7 +54,7 @@
# if GEOS_dir not set, check a few standard locations.
GEOS_dirs = ['/usr/local','/sw','/opt','/opt/local',os.path.expanduser('~')]
for direc in GEOS_dirs:
- geos_version = check_geosversion(direc)
+ geos_version = checkversion(direc)
print 'checking for GEOS lib in %s ....' % direc
if geos_version != '"2.2.3"':
continue
@@ -63,7 +63,7 @@
GEOS_dir = direc
break
else:
- geos_version = check_geosversion(GEOS_dir)
+ geos_version = checkversion(GEOS_dir)
#if geos_version != '"2.2.3"':
# raise SystemExit("""
#Can't find geos library version 2.2.3. Please set the
@@ -81,15 +81,15 @@
deps = glob.glob('src/*.c')
deps.remove(os.path.join('src','_proj.c'))
deps.remove(os.path.join('src','_geod.c'))
-deps.remove(os.path.join('src','_geos.c'))
+deps.remove(os.path.join('src','_geoslib.c'))
packages = ['mpl_toolkits','mpl_toolkits.basemap']
package_dirs = {'':'lib'}
extensions = [Extension("mpl_toolkits.basemap._proj",deps+['src/_proj.c'],include_dirs = ['src'],)]
extensions.append(Extension("mpl_toolkits.basemap._geod",deps+['src/_geod.c'],include_dirs = ['src'],))
# for some reason, pickling won't work if this extension is installed
-# as "matplotlib.toolkits.basemap._geos"
-extensions.append(Extension("_geos",['src/_geos.c'],
+# as "matplotlib.toolkits.basemap._geoslib"
+extensions.append(Extension("_geoslib",['src/_geoslib.c'],
library_dirs=geos_library_dirs,
runtime_library_dirs=geos_library_dirs,
include_dirs=geos_include_dirs,
Deleted: trunk/toolkits/basemap/src/_geos.c
===================================================================
--- trunk/toolkits/basemap/src/_geos.c 2008-02-13 13:50:29 UTC (rev 4959)
+++ trunk/toolkits/basemap/src/_geos.c 2008-02-13 17:15:11 UTC (rev 4960)
@@ -1,3119 +0,0 @@
-/* Generated by Cython 0.9.6.8 on Thu Nov 15 13:56:55 2007 */
-
-#define PY_SSIZE_T_CLEAN
-#include "Python.h"
-#include "structmember.h"
-#ifndef PY_LONG_LONG
- #define PY_LONG_LONG LONG_LONG
-#endif
-#if PY_VERSION_HEX < 0x02050000
- typedef int Py_ssize_t;
- #define PY_SSIZE_T_MAX INT_MAX
- #define PY_SSIZE_T_MIN INT_MIN
- #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
- #define PyInt_AsSsize_t(o) PyInt_AsLong(o)
- #define PyNumber_Index(o) PyNumber_Int(o)
- #define PyIndex_Check(o) PyNumber_Check(o)
-#endif
-#ifndef WIN32
- #define __stdcall
- #define __cdecl
-#endif
-#ifdef __cplusplus
-#define __PYX_EXTERN_C extern "C"
-#else
-#define __PYX_EXTERN_C extern
-#endif
-#include <math.h>
-#include "numpy/arrayobject.h"
-#include "geos_c.h"
-
-
-#ifdef __GNUC__
-#define INLINE __inline__
-#elif _WIN32
-#define INLINE __inline
-#else
-#define INLINE
-#endif
-
-typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
-typedef struct {PyObject **p; char *s; long n; int is_unicode;} __Pyx_StringTabEntry; /*proto*/
-
-static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b) {
- Py_ssize_t ival;
- PyObject* x = PyNumber_Index(b);
- if (!x) return -1;
- ival = PyInt_AsSsize_t(x);
- Py_DECREF(x);
- return ival;
-}
-
-#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
-static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
- if (x == Py_True) return 1;
- else if (x == Py_False) return 0;
- else return PyObject_IsTrue(x);
-}
-
-
-
-static int __pyx_skip_dispatch = 0;
-
-
-#ifdef __GNUC__
-/* Test for GCC > 2.95 */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
-#define likely(x) __builtin_expect(!!(x), 1)
-#define unlikely(x) __builtin_expect(!!(x), 0)
-#else /* __GNUC__ > 2 ... */
-#define likely(x) (x)
-#define unlikely(x) (x)
-#endif /* __GNUC__ > 2 ... */
-#else /* __GNUC__ */
-#define likely(x) (x)
-#define unlikely(x) (x)
-#endif /* __GNUC__ */
-
-static PyObject *__pyx_m;
-static PyObject *__pyx_b;
-static int __pyx_lineno;
-static char *__pyx_filename;
-static char **__pyx_f;
-
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
-
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
-
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-
-static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-static void __Pyx_WriteUnraisable(char *name); /*proto*/
-
-static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
-
-static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
-
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
-
-static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/
-
-static PyObject *__Pyx_ImportModule(char *name); /*proto*/
-
-static void __Pyx_AddTraceback(char *funcname); /*proto*/
-
-static int __Pyx_RegisterCleanup(); /*proto*/
-static PyObject* cleanup(PyObject *self, PyObject *unused); /*proto*/
-static PyMethodDef cleanup_def = {"__cleanup", (PyCFunction)&cleanup, METH_NOARGS, 0};
-
-/* Declarations from numpy */
-
-
-/* Declarations from _geos */
-
-struct __pyx_obj_5_geos_BaseGeometry {
- PyObject_HEAD
- GEOSGeom *_geom;
- unsigned int _npts;
- PyObject *boundary;
-};
-
-struct __pyx_obj_5_geos_Polygon {
- struct __pyx_obj_5_geos_BaseGeometry __pyx_base;
-};
-
-struct __pyx_obj_5_geos_LineString {
- struct __pyx_obj_5_geos_BaseGeometry __pyx_base;
-};
-
-struct __pyx_obj_5_geos_Point {
- struct __pyx_obj_5_geos_BaseGeometry __pyx_base;
- PyObject *x;
- PyObject *y;
-};
-
-
-
-
-
-static PyTypeObject *__pyx_ptype_5_geos_ndarray = 0;
-static PyTypeObject *__pyx_ptype_5_geos_BaseGeometry = 0;
-static PyTypeObject *__pyx_ptype_5_geos_Polygon = 0;
-static PyTypeObject *__pyx_ptype_5_geos_LineString = 0;
-static PyTypeObject *__pyx_ptype_5_geos_Point = 0;
-static void __pyx_f_5_geos_notice_h(char *,char *); /*proto*/
-static void __pyx_f_5_geos_error_h(char *,char *); /*proto*/
-static PyObject *__pyx_f_5_geos_geos_version(void); /*proto*/
-static PyObject *__pyx_f_5_geos__get_coords(GEOSGeom *); /*proto*/
-
-
-/* Implementation of _geos */
-
-static char __pyx_k3[] = "0.1";
-static char __pyx_k4[] = "2.2.3-CAPI-1.1.1";
-static char __pyx_k5[] = "version 2.2.3 of the geos library is required";
-
-static PyObject *__pyx_n_is_valid;
-static PyObject *__pyx_n_geom_type;
-static PyObject *__pyx_n_within;
-static PyObject *__pyx_n_intersects;
-static PyObject *__pyx_n_intersection;
-static PyObject *__pyx_n_get_coords;
-static PyObject *__pyx_n___dealloc__;
-static PyObject *__pyx_n___reduce__;
-static PyObject *__pyx_n___init__;
-static PyObject *__pyx_n_area;
-static PyObject *__pyx_n_sys;
-static PyObject *__pyx_n_numpy;
-static PyObject *__pyx_n___version__;
-static PyObject *__pyx_n___geos_version__;
-static PyObject *__pyx_n_ValueError;
-
-static PyObject *__pyx_k3p;
-static PyObject *__pyx_k4p;
-static PyObject *__pyx_k5p;
-
-static PyObject *__pyx_builtin_ValueError;
-
-static PyObject *__pyx_n_stdout;
-static PyObject *__pyx_n_write;
-
-static PyObject *__pyx_k6p;
-
-static char __pyx_k6[] = "GEOS_NOTICE: %s\n";
-
-static void __pyx_f_5_geos_notice_h(char *__pyx_v_fmt,char *__pyx_v_msg) {
- PyObject *__pyx_v_format;
- PyObject *__pyx_v_message;
- PyObject *__pyx_v_warn_msg;
- PyObject *__pyx_1 = 0;
- PyObject *__pyx_2 = 0;
- PyObject *__pyx_3 = 0;
- __pyx_v_format = Py_None; Py_INCREF(Py_None);
- __pyx_v_message = Py_None; Py_INCREF(Py_None);
- __pyx_v_warn_msg = Py_None; Py_INCREF(Py_None);
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":101
- *
- * cdef void notice_h(char *fmt, char*msg):
- * format = PyString_FromString(fmt) # <<<<<<<<<<<<<<
- * message = PyString_FromString(msg)
- * try:
- */
- __pyx_1 = PyString_FromString(__pyx_v_fmt); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; goto __pyx_L1;}
- Py_DECREF(__pyx_v_format);
- __pyx_v_format = __pyx_1;
- __pyx_1 = 0;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":102
- * cdef void notice_h(char *fmt, char*msg):
- * format = PyString_FromString(fmt)
- * message = PyString_FromString(msg) # <<<<<<<<<<<<<<
- * try:
- * warn_msg = format % message
- */
- __pyx_1 = PyString_FromString(__pyx_v_msg); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;}
- Py_DECREF(__pyx_v_message);
- __pyx_v_message = __pyx_1;
- __pyx_1 = 0;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":103
- * format = PyString_FromString(fmt)
- * message = PyString_FromString(msg)
- * try: # <<<<<<<<<<<<<<
- * warn_msg = format % message
- * except:
- */
- /*try:*/ {
- __pyx_1 = PyNumber_Remainder(__pyx_v_format, __pyx_v_message); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L2;}
- Py_DECREF(__pyx_v_warn_msg);
- __pyx_v_warn_msg = __pyx_1;
- __pyx_1 = 0;
- }
- goto __pyx_L3;
- __pyx_L2:;
- Py_XDECREF(__pyx_1); __pyx_1 = 0;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":105
- * try:
- * warn_msg = format % message
- * except: # <<<<<<<<<<<<<<
- * warn_msg = format
- * sys.stdout.write('GEOS_NOTICE: %s\n' % warn_msg)
- */
- /*except:*/ {
- __Pyx_AddTraceback("_geos.notice_h");
- if (__Pyx_GetException(&__pyx_1, &__pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;}
- Py_INCREF(__pyx_v_format);
- Py_DECREF(__pyx_v_warn_msg);
- __pyx_v_warn_msg = __pyx_v_format;
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":107
- * except:
- * warn_msg = format
- * sys.stdout.write('GEOS_NOTICE: %s\n' % warn_msg) # <<<<<<<<<<<<<<
- *
- * cdef void error_h(char *fmt, char*msg):
- */
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_stdout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_write); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = PyNumber_Remainder(__pyx_k6p, __pyx_v_warn_msg); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;}
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
- __pyx_1 = 0;
- __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_1); __pyx_1 = 0;
-
- goto __pyx_L0;
- __pyx_L1:;
- Py_XDECREF(__pyx_1);
- Py_XDECREF(__pyx_2);
- Py_XDECREF(__pyx_3);
- __Pyx_WriteUnraisable("_geos.notice_h");
- __pyx_L0:;
- Py_DECREF(__pyx_v_format);
- Py_DECREF(__pyx_v_message);
- Py_DECREF(__pyx_v_warn_msg);
-}
-
-static PyObject *__pyx_n_stderr;
-
-static PyObject *__pyx_k7p;
-
-static char __pyx_k7[] = "GEOS_ERROR: %s\n";
-
-static void __pyx_f_5_geos_error_h(char *__pyx_v_fmt,char *__pyx_v_msg) {
- PyObject *__pyx_v_format;
- PyObject *__pyx_v_message;
- PyObject *__pyx_v_warn_msg;
- PyObject *__pyx_1 = 0;
- PyObject *__pyx_2 = 0;
- PyObject *__pyx_3 = 0;
- __pyx_v_format = Py_None; Py_INCREF(Py_None);
- __pyx_v_message = Py_None; Py_INCREF(Py_None);
- __pyx_v_warn_msg = Py_None; Py_INCREF(Py_None);
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":110
- *
- * cdef void error_h(char *fmt, char*msg):
- * format = PyString_FromString(fmt) # <<<<<<<<<<<<<<
- * message = PyString_FromString(msg)
- * try:
- */
- __pyx_1 = PyString_FromString(__pyx_v_fmt); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; goto __pyx_L1;}
- Py_DECREF(__pyx_v_format);
- __pyx_v_format = __pyx_1;
- __pyx_1 = 0;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":111
- * cdef void error_h(char *fmt, char*msg):
- * format = PyString_FromString(fmt)
- * message = PyString_FromString(msg) # <<<<<<<<<<<<<<
- * try:
- * warn_msg = format % message
- */
- __pyx_1 = PyString_FromString(__pyx_v_msg); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; goto __pyx_L1;}
- Py_DECREF(__pyx_v_message);
- __pyx_v_message = __pyx_1;
- __pyx_1 = 0;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":112
- * format = PyString_FromString(fmt)
- * message = PyString_FromString(msg)
- * try: # <<<<<<<<<<<<<<
- * warn_msg = format % message
- * except:
- */
- /*try:*/ {
- __pyx_1 = PyNumber_Remainder(__pyx_v_format, __pyx_v_message); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; goto __pyx_L2;}
- Py_DECREF(__pyx_v_warn_msg);
- __pyx_v_warn_msg = __pyx_1;
- __pyx_1 = 0;
- }
- goto __pyx_L3;
- __pyx_L2:;
- Py_XDECREF(__pyx_1); __pyx_1 = 0;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":114
- * try:
- * warn_msg = format % message
- * except: # <<<<<<<<<<<<<<
- * warn_msg = format
- * sys.stderr.write('GEOS_ERROR: %s\n' % warn_msg)
- */
- /*except:*/ {
- __Pyx_AddTraceback("_geos.error_h");
- if (__Pyx_GetException(&__pyx_1, &__pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;}
- Py_INCREF(__pyx_v_format);
- Py_DECREF(__pyx_v_warn_msg);
- __pyx_v_warn_msg = __pyx_v_format;
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":116
- * except:
- * warn_msg = format
- * sys.stderr.write('GEOS_ERROR: %s\n' % warn_msg) # <<<<<<<<<<<<<<
- *
- * # check library version
- */
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_stderr); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_write); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = PyNumber_Remainder(__pyx_k7p, __pyx_v_warn_msg); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
- __pyx_1 = 0;
- __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_1); __pyx_1 = 0;
-
- goto __pyx_L0;
- __pyx_L1:;
- Py_XDECREF(__pyx_1);
- Py_XDECREF(__pyx_2);
- Py_XDECREF(__pyx_3);
- __Pyx_WriteUnraisable("_geos.error_h");
- __pyx_L0:;
- Py_DECREF(__pyx_v_format);
- Py_DECREF(__pyx_v_message);
- Py_DECREF(__pyx_v_warn_msg);
-}
-
-static PyObject *__pyx_f_5_geos_geos_version(void) {
- PyObject *__pyx_r;
- PyObject *__pyx_1 = 0;
- __pyx_1 = PyString_FromString(GEOSversion()); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
- __pyx_r = __pyx_1;
- __pyx_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; Py_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1:;
- Py_XDECREF(__pyx_1);
- __Pyx_AddTraceback("_geos.geos_version");
- __pyx_r = 0;
- __pyx_L0:;
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5_geos_12BaseGeometry_is_valid(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
-static PyObject *__pyx_pf_5_geos_12BaseGeometry_is_valid(PyObject *__pyx_v_self, PyObject *unused) {
- char __pyx_v_valid;
- PyObject *__pyx_r;
- char __pyx_1;
- Py_INCREF(__pyx_v_self);
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":134
- * def is_valid(self):
- * cdef char valid
- * valid = GEOSisValid(self._geom) # <<<<<<<<<<<<<<
- * if valid:
- * return True
- */
- __pyx_v_valid = GEOSisValid(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom);
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":135
- * cdef char valid
- * valid = GEOSisValid(self._geom)
- * if valid: # <<<<<<<<<<<<<<
- * return True
- * else:
- */
- __pyx_1 = __pyx_v_valid;
- if (__pyx_1) {
- Py_INCREF(Py_True);
- __pyx_r = Py_True;
- goto __pyx_L0;
- goto __pyx_L2;
- }
- /*else*/ {
- Py_INCREF(Py_False);
- __pyx_r = Py_False;
- goto __pyx_L0;
- }
- __pyx_L2:;
-
- __pyx_r = Py_None; Py_INCREF(Py_None);
- __pyx_L0:;
- Py_DECREF(__pyx_v_self);
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5_geos_12BaseGeometry_geom_type(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
-static PyObject *__pyx_pf_5_geos_12BaseGeometry_geom_type(PyObject *__pyx_v_self, PyObject *unused) {
- PyObject *__pyx_r;
- PyObject *__pyx_1 = 0;
- Py_INCREF(__pyx_v_self);
- __pyx_1 = PyString_FromString(GEOSGeomType(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; goto __pyx_L1;}
- __pyx_r = __pyx_1;
- __pyx_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; Py_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1:;
- Py_XDECREF(__pyx_1);
- __Pyx_AddTraceback("_geos.BaseGeometry.geom_type");
- __pyx_r = NULL;
- __pyx_L0:;
- Py_DECREF(__pyx_v_self);
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5_geos_12BaseGeometry_within(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/
-static PyObject *__pyx_pf_5_geos_12BaseGeometry_within(PyObject *__pyx_v_self, PyObject *__pyx_v_geom) {
- GEOSGeom *__pyx_v_g1;
- GEOSGeom *__pyx_v_g2;
- char __pyx_v_answer;
- PyObject *__pyx_r;
- char __pyx_1;
- Py_INCREF(__pyx_v_self);
- Py_INCREF(__pyx_v_geom);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_5_geos_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;}
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":146
- * cdef GEOSGeom *g1, *g2
- * cdef char answer
- * g1 = self._geom # <<<<<<<<<<<<<<
- * g2 = geom._geom
- * answer = GEOSWithin(g1, g2)
- */
- __pyx_v_g1 = ((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":147
- * cdef char answer
- * g1 = self._geom
- * g2 = geom._geom # <<<<<<<<<<<<<<
- * answer = GEOSWithin(g1, g2)
- * if answer:
- */
- __pyx_v_g2 = ((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_geom)->_geom;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":148
- * g1 = self._geom
- * g2 = geom._geom
- * answer = GEOSWithin(g1, g2) # <<<<<<<<<<<<<<
- * if answer:
- * return True
- */
- __pyx_v_answer = GEOSWithin(__pyx_v_g1,__pyx_v_g2);
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":149
- * g2 = geom._geom
- * answer = GEOSWithin(g1, g2)
- * if answer: # <<<<<<<<<<<<<<
- * return True
- * else:
- */
- __pyx_1 = __pyx_v_answer;
- if (__pyx_1) {
- Py_INCREF(Py_True);
- __pyx_r = Py_True;
- goto __pyx_L0;
- goto __pyx_L2;
- }
- /*else*/ {
- Py_INCREF(Py_False);
- __pyx_r = Py_False;
- goto __pyx_L0;
- }
- __pyx_L2:;
-
- __pyx_r = Py_None; Py_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1:;
- __Pyx_AddTraceback("_geos.BaseGeometry.within");
- __pyx_r = NULL;
- __pyx_L0:;
- Py_DECREF(__pyx_v_self);
- Py_DECREF(__pyx_v_geom);
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5_geos_12BaseGeometry_intersects(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/
-static PyObject *__pyx_pf_5_geos_12BaseGeometry_intersects(PyObject *__pyx_v_self, PyObject *__pyx_v_geom) {
- GEOSGeom *__pyx_v_g1;
- GEOSGeom *__pyx_v_g2;
- char __pyx_v_answer;
- PyObject *__pyx_r;
- char __pyx_1;
- Py_INCREF(__pyx_v_self);
- Py_INCREF(__pyx_v_geom);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_5_geos_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; goto __pyx_L1;}
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":157
- * cdef GEOSGeom *g1, *g2
- * cdef char answer
- * g1 = self._geom # <<<<<<<<<<<<<<
- * g2 = geom._geom
- * answer = GEOSIntersects(g1, g2)
- */
- __pyx_v_g1 = ((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":158
- * cdef char answer
- * g1 = self._geom
- * g2 = geom._geom # <<<<<<<<<<<<<<
- * answer = GEOSIntersects(g1, g2)
- * if answer:
- */
- __pyx_v_g2 = ((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_geom)->_geom;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":159
- * g1 = self._geom
- * g2 = geom._geom
- * answer = GEOSIntersects(g1, g2) # <<<<<<<<<<<<<<
- * if answer:
- * return True
- */
- __pyx_v_answer = GEOSIntersects(__pyx_v_g1,__pyx_v_g2);
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":160
- * g2 = geom._geom
- * answer = GEOSIntersects(g1, g2)
- * if answer: # <<<<<<<<<<<<<<
- * return True
- * else:
- */
- __pyx_1 = __pyx_v_answer;
- if (__pyx_1) {
- Py_INCREF(Py_True);
- __pyx_r = Py_True;
- goto __pyx_L0;
- goto __pyx_L2;
- }
- /*else*/ {
- Py_INCREF(Py_False);
- __pyx_r = Py_False;
- goto __pyx_L0;
- }
- __pyx_L2:;
-
- __pyx_r = Py_None; Py_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1:;
- __Pyx_AddTraceback("_geos.BaseGeometry.intersects");
- __pyx_r = NULL;
- __pyx_L0:;
- Py_DECREF(__pyx_v_self);
- Py_DECREF(__pyx_v_geom);
- return __pyx_r;
-}
-
-static PyObject *__pyx_n_append;
-static PyObject *__pyx_n_NotImplementedError;
-
-static PyObject *__pyx_k8p;
-
-static PyObject *__pyx_builtin_NotImplementedError;
-
-static char __pyx_k8[] = "intersections of type '%s' not yet implemented";
-
-static PyObject *__pyx_pf_5_geos_12BaseGeometry_intersection(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/
-static PyObject *__pyx_pf_5_geos_12BaseGeometry_intersection(PyObject *__pyx_v_self, PyObject *__pyx_v_geom) {
- GEOSGeom *__pyx_v_g1;
- GEOSGeom *__pyx_v_g2;
- GEOSGeom *__pyx_v_g3;
- GEOSGeom *__pyx_v_gout;
- int __pyx_v_numgeoms;
- int __pyx_v_i;
- int __pyx_v_typeid;
- PyObject *__pyx_v_b;
- PyObject *__pyx_v_p;
- PyObject *__pyx_v_pout;
- PyObject *__pyx_v_type;
- PyObject *__pyx_r;
- int __pyx_1;
- PyObject *__pyx_2 = 0;
- PyObject *__pyx_3 = 0;
- PyObject *__pyx_4 = 0;
- Py_INCREF(__pyx_v_self);
- Py_INCREF(__pyx_v_geom);
- __pyx_v_b = Py_None; Py_INCREF(Py_None);
- __pyx_v_p = Py_None; Py_INCREF(Py_None);
- __pyx_v_pout = Py_None; Py_INCREF(Py_None);
- __pyx_v_type = Py_None; Py_INCREF(Py_None);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_5_geos_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;}
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":169
- * cdef char answer
- * cdef int numgeoms, i, typeid
- * g1 = self._geom # <<<<<<<<<<<<<<
- * g2 = geom._geom
- * g3 = GEOSIntersection(g1, g2)
- */
- __pyx_v_g1 = ((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":170
- * cdef int numgeoms, i, typeid
- * g1 = self._geom
- * g2 = geom._geom # <<<<<<<<<<<<<<
- * g3 = GEOSIntersection(g1, g2)
- * typeid = GEOSGeomTypeId(g3)
- */
- __pyx_v_g2 = ((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_geom)->_geom;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":171
- * g1 = self._geom
- * g2 = geom._geom
- * g3 = GEOSIntersection(g1, g2) # <<<<<<<<<<<<<<
- * typeid = GEOSGeomTypeId(g3)
- * if typeid == GEOS_POLYGON:
- */
- __pyx_v_g3 = GEOSIntersection(__pyx_v_g1,__pyx_v_g2);
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":172
- * g2 = geom._geom
- * g3 = GEOSIntersection(g1, g2)
- * typeid = GEOSGeomTypeId(g3) # <<<<<<<<<<<<<<
- * if typeid == GEOS_POLYGON:
- * b = _get_coords(g3)
- */
- __pyx_v_typeid = GEOSGeomTypeId(__pyx_v_g3);
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":173
- * g3 = GEOSIntersection(g1, g2)
- * typeid = GEOSGeomTypeId(g3)
- * if typeid == GEOS_POLYGON: # <<<<<<<<<<<<<<
- * b = _get_coords(g3)
- * p = Polygon(b)
- */
- __pyx_1 = (__pyx_v_typeid == GEOS_POLYGON);
- if (__pyx_1) {
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":174
- * typeid = GEOSGeomTypeId(g3)
- * if typeid == GEOS_POLYGON:
- * b = _get_coords(g3) # <<<<<<<<<<<<<<
- * p = Polygon(b)
- * pout = [p]
- */
- __pyx_2 = __pyx_f_5_geos__get_coords(__pyx_v_g3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;}
- Py_DECREF(__pyx_v_b);
- __pyx_v_b = __pyx_2;
- __pyx_2 = 0;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":175
- * if typeid == GEOS_POLYGON:
- * b = _get_coords(g3)
- * p = Polygon(b) # <<<<<<<<<<<<<<
- * pout = [p]
- * elif typeid == GEOS_LINESTRING:
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;}
- Py_INCREF(__pyx_v_b);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_b);
- __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_Polygon), __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_v_p);
- __pyx_v_p = __pyx_3;
- __pyx_3 = 0;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":176
- * b = _get_coords(g3)
- * p = Polygon(b)
- * pout = [p] # <<<<<<<<<<<<<<
- * elif typeid == GEOS_LINESTRING:
- * b = _get_coords(g3)
- */
- __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;}
- Py_INCREF(__pyx_v_p);
- PyList_SET_ITEM(__pyx_2, 0, __pyx_v_p);
- Py_DECREF(__pyx_v_pout);
- __pyx_v_pout = __pyx_2;
- __pyx_2 = 0;
- goto __pyx_L2;
- }
- __pyx_1 = (__pyx_v_typeid == GEOS_LINESTRING);
- if (__pyx_1) {
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":178
- * pout = [p]
- * elif typeid == GEOS_LINESTRING:
- * b = _get_coords(g3) # <<<<<<<<<<<<<<
- * p = LineString(b)
- * pout = [p]
- */
- __pyx_3 = __pyx_f_5_geos__get_coords(__pyx_v_g3); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;}
- Py_DECREF(__pyx_v_b);
- __pyx_v_b = __pyx_3;
- __pyx_3 = 0;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":179
- * elif typeid == GEOS_LINESTRING:
- * b = _get_coords(g3)
- * p = LineString(b) # <<<<<<<<<<<<<<
- * pout = [p]
- * elif typeid == GEOS_MULTIPOLYGON:
- */
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;}
- Py_INCREF(__pyx_v_b);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_b);
- __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_LineString), __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_v_p);
- __pyx_v_p = __pyx_3;
- __pyx_3 = 0;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":180
- * b = _get_coords(g3)
- * p = LineString(b)
- * pout = [p] # <<<<<<<<<<<<<<
- * elif typeid == GEOS_MULTIPOLYGON:
- * numgeoms = GEOSGetNumGeometries(g3)
- */
- __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}
- Py_INCREF(__pyx_v_p);
- PyList_SET_ITEM(__pyx_2, 0, __pyx_v_p);
- Py_DECREF(__pyx_v_pout);
- __pyx_v_pout = __pyx_2;
- __pyx_2 = 0;
- goto __pyx_L2;
- }
- __pyx_1 = (__pyx_v_typeid == GEOS_MULTIPOLYGON);
- if (__pyx_1) {
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":182
- * pout = [p]
- * elif typeid == GEOS_MULTIPOLYGON:
- * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<<
- * pout = []
- * for i from 0 <= i < numgeoms:
- */
- __pyx_v_numgeoms = GEOSGetNumGeometries(__pyx_v_g3);
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":183
- * elif typeid == GEOS_MULTIPOLYGON:
- * numgeoms = GEOSGetNumGeometries(g3)
- * pout = [] # <<<<<<<<<<<<<<
- * for i from 0 <= i < numgeoms:
- * gout = GEOSGetGeometryN(g3, i)
- */
- __pyx_3 = PyList_New(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;}
- Py_DECREF(__pyx_v_pout);
- __pyx_v_pout = __pyx_3;
- __pyx_3 = 0;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":184
- * numgeoms = GEOSGetNumGeometries(g3)
- * pout = []
- * for i from 0 <= i < numgeoms: # <<<<<<<<<<<<<<
- * gout = GEOSGetGeometryN(g3, i)
- * b = _get_coords(gout)
- */
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_numgeoms; __pyx_v_i++) {
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":185
- * pout = []
- * for i from 0 <= i < numgeoms:
- * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<<
- * b = _get_coords(gout)
- * p = Polygon(b)
- */
- __pyx_v_gout = GEOSGetGeometryN(__pyx_v_g3,__pyx_v_i);
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":186
- * for i from 0 <= i < numgeoms:
- * gout = GEOSGetGeometryN(g3, i)
- * b = _get_coords(gout) # <<<<<<<<<<<<<<
- * p = Polygon(b)
- * pout.append(p)
- */
- __pyx_2 = __pyx_f_5_geos__get_coords(__pyx_v_gout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
- Py_DECREF(__pyx_v_b);
- __pyx_v_b = __pyx_2;
- __pyx_2 = 0;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":187
- * gout = GEOSGetGeometryN(g3, i)
- * b = _get_coords(gout)
- * p = Polygon(b) # <<<<<<<<<<<<<<
- * pout.append(p)
- * elif typeid == GEOS_MULTILINESTRING:
- */
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;}
- Py_INCREF(__pyx_v_b);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_b);
- __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_Polygon), __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_v_p);
- __pyx_v_p = __pyx_2;
- __pyx_2 = 0;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":188
- * b = _get_coords(gout)
- * p = Polygon(b)
- * pout.append(p) # <<<<<<<<<<<<<<
- * elif typeid == GEOS_MULTILINESTRING:
- * numgeoms = GEOSGetNumGeometries(g3)
- */
- __pyx_3 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;}
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;}
- Py_INCREF(__pyx_v_p);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_p);
- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- }
- goto __pyx_L2;
- }
- __pyx_1 = (__pyx_v_typeid == GEOS_MULTILINESTRING);
- if (__pyx_1) {
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":190
- * pout.append(p)
- * elif typeid == GEOS_MULTILINESTRING:
- * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<<
- * pout = []
- * for i from 0 <= i < numgeoms:
- */
- __pyx_v_numgeoms = GEOSGetNumGeometries(__pyx_v_g3);
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":191
- * elif typeid == GEOS_MULTILINESTRING:
- * numgeoms = GEOSGetNumGeometries(g3)
- * pout = [] # <<<<<<<<<<<<<<
- * for i from 0 <= i < numgeoms:
- * gout = GEOSGetGeometryN(g3, i)
- */
- __pyx_3 = PyList_New(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;}
- Py_DECREF(__pyx_v_pout);
- __pyx_v_pout = __pyx_3;
- __pyx_3 = 0;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":192
- * numgeoms = GEOSGetNumGeometries(g3)
- * pout = []
- * for i from 0 <= i < numgeoms: # <<<<<<<<<<<<<<
- * gout = GEOSGetGeometryN(g3, i)
- * b = _get_coords(gout)
- */
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_numgeoms; __pyx_v_i++) {
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":193
- * pout = []
- * for i from 0 <= i < numgeoms:
- * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<<
- * b = _get_coords(gout)
- * p = LineString(b)
- */
- __pyx_v_gout = GEOSGetGeometryN(__pyx_v_g3,__pyx_v_i);
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":194
- * for i from 0 <= i < numgeoms:
- * gout = GEOSGetGeometryN(g3, i)
- * b = _get_coords(gout) # <<<<<<<<<<<<<<
- * p = LineString(b)
- * pout.append(p)
- */
- __pyx_2 = __pyx_f_5_geos__get_coords(__pyx_v_gout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}
- Py_DECREF(__pyx_v_b);
- __pyx_v_b = __pyx_2;
- __pyx_2 = 0;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":195
- * gout = GEOSGetGeometryN(g3, i)
- * b = _get_coords(gout)
- * p = LineString(b) # <<<<<<<<<<<<<<
- * pout.append(p)
- * else:
- */
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; goto __pyx_L1;}
- Py_INCREF(__pyx_v_b);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_b);
- __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_LineString), __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- Py_DECREF(__pyx_v_p);
- __pyx_v_p = __pyx_3;
- __pyx_3 = 0;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":196
- * b = _get_coords(gout)
- * p = LineString(b)
- * pout.append(p) # <<<<<<<<<<<<<<
- * else:
- * type = PyString_FromString(GEOSGeomType(g3))
- */
- __pyx_2 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
- Py_INCREF(__pyx_v_p);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_p);
- __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- }
- goto __pyx_L2;
- }
- /*else*/ {
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":198
- * pout.append(p)
- * else:
- * type = PyString_FromString(GEOSGeomType(g3)) # <<<<<<<<<<<<<<
- * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type))
- * GEOSGeom_destroy(g3)
- */
- __pyx_2 = PyString_FromString(GEOSGeomType(__pyx_v_g3)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}
- Py_DECREF(__pyx_v_type);
- __pyx_v_type = __pyx_2;
- __pyx_2 = 0;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":199
- * else:
- * type = PyString_FromString(GEOSGeomType(g3))
- * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) # <<<<<<<<<<<<<<
- * GEOSGeom_destroy(g3)
- * return pout
- */
- __pyx_4 = PyNumber_Remainder(__pyx_k8p, __pyx_v_type); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;}
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4);
- __pyx_4 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_builtin_NotImplementedError, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __Pyx_Raise(__pyx_2, 0, 0);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;}
- }
- __pyx_L2:;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":200
- * type = PyString_FromString(GEOSGeomType(g3))
- * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type))
- * GEOSGeom_destroy(g3) # <<<<<<<<<<<<<<
- * return pout
- *
- */
- GEOSGeom_destroy(__pyx_v_g3);
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":201
- * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type))
- * GEOSGeom_destroy(g3)
- * return pout # <<<<<<<<<<<<<<
- *
- * def get_coords(self):
- */
- Py_INCREF(__pyx_v_pout);
- __pyx_r = __pyx_v_pout;
- goto __pyx_L0;
-
- __pyx_r = Py_None; Py_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1:;
- Py_XDECREF(__pyx_2);
- Py_XDECREF(__pyx_3);
- Py_XDECREF(__pyx_4);
- __Pyx_AddTraceback("_geos.BaseGeometry.intersection");
- __pyx_r = NULL;
- __pyx_L0:;
- Py_DECREF(__pyx_v_b);
- Py_DECREF(__pyx_v_p);
- Py_DECREF(__pyx_v_pout);
- Py_DECREF(__pyx_v_type);
- Py_DECREF(__pyx_v_self);
- Py_DECREF(__pyx_v_geom);
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5_geos_12BaseGeometry_get_coords(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
-static PyObject *__pyx_pf_5_geos_12BaseGeometry_get_coords(PyObject *__pyx_v_self, PyObject *unused) {
- PyObject *__pyx_r;
- PyObject *__pyx_1 = 0;
- Py_INCREF(__pyx_v_self);
- __pyx_1 = __pyx_f_5_geos__get_coords(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;}
- __pyx_r = __pyx_1;
- __pyx_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; Py_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1:;
- Py_XDECREF(__pyx_1);
- __Pyx_AddTraceback("_geos.BaseGeometry.get_coords");
- __pyx_r = NULL;
- __pyx_L0:;
- Py_DECREF(__pyx_v_self);
- return __pyx_r;
-}
-
-static void __pyx_pf_5_geos_12BaseGeometry___dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pf_5_geos_12BaseGeometry___dealloc__(PyObject *__pyx_v_self) {
- Py_INCREF(__pyx_v_self);
- GEOSGeom_destroy(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom);
-
- Py_DECREF(__pyx_v_self);
-}
-
-static PyObject *__pyx_n___class__;
-
-static PyObject *__pyx_pf_5_geos_12BaseGeometry___reduce__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
-static char __pyx_doc_5_geos_12BaseGeometry___reduce__[] = "special method that allows geos instance to be pickled";
-static PyObject *__pyx_pf_5_geos_12BaseGeometry___reduce__(PyObject *__pyx_v_self, PyObject *unused) {
- PyObject *__pyx_r;
- PyObject *__pyx_1 = 0;
- PyObject *__pyx_2 = 0;
- PyObject *__pyx_3 = 0;
- Py_INCREF(__pyx_v_self);
- __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___class__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;}
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;}
- Py_INCREF(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->boundary);
- PyTuple_SET_ITEM(__pyx_2, 0, ((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->boundary);
- __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);
- __pyx_1 = 0;
- __pyx_2 = 0;
- __pyx_r = __pyx_3;
- __pyx_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; Py_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1:;
- Py_XDECREF(__pyx_1);
- Py_XDECREF(__pyx_2);
- Py_XDECREF(__pyx_3);
- __Pyx_AddTraceback("_geos.BaseGeometry.__reduce__");
- __pyx_r = NULL;
- __pyx_L0:;
- Py_DECREF(__pyx_v_self);
- return __pyx_r;
-}
-
-static PyObject *__pyx_num_neg_1;
-static PyObject *__pyx_num_0;
-static PyObject *__pyx_num_1;
-
-static PyObject *__pyx_n_copy;
-static PyObject *__pyx_n_shape;
-
-static int __pyx_pf_5_geos_7Polygon___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pf_5_geos_7Polygon___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyArrayObject *__pyx_v_b = 0;
- unsigned int __pyx_v_M;
- unsigned int __pyx_v_m;
- unsigned int __pyx_v_i;
- double __pyx_v_dx;
- double __pyx_v_dy;
- double *__pyx_v_bbuffer;
- GEOSCoordSeq *__pyx_v_cs;
- GEOSGeom *__pyx_v_lr;
- int __pyx_r;
- int __pyx_1;
- PyObject *__pyx_2 = 0;
- PyObject *__pyx_3 = 0;
- PyObject *__pyx_4 = 0;
- unsigned int __pyx_5;
- PyObject *__pyx_6 = 0;
- static char *__pyx_argnames[] = {"b",0};
- if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_b))) return -1;
- Py_INCREF((PyObject *)__pyx_v_self);
- Py_INCREF(__pyx_v_b);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_5_geos_ndarray, 1, "b"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;}
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":225
- * # make sure data is contiguous.
- * # if not, make a local copy.
- * if not PyArray_ISCONTIGUOUS(b): # <<<<<<<<<<<<<<
- * b = b.copy()
- *
- */
- __pyx_1 = (!PyArray_ISCONTIGUOUS(__pyx_v_b));
- if (__pyx_1) {
- __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_b), __pyx_n_copy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
- __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_5_geos_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
- Py_DECREF(((PyObject *)__pyx_v_b));
- __pyx_v_b = ((PyArrayObject *)__pyx_3);
- __pyx_3 = 0;
- goto __pyx_L2;
- }
- __pyx_L2:;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":228
- * b = b.copy()
- *
- * m = b.shape[0] # <<<<<<<<<<<<<<
- *
- * # Add closing coordinates to sequence?
- */
- __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_b), __pyx_n_shape); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;}
- if (PyList_CheckExact(__pyx_2) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_2)) {
- __pyx_4 = PyList_GET_ITEM(__pyx_2, 0); Py_INCREF(__pyx_4);
- } else if (PyTuple_CheckExact(__pyx_2) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_2)) {
- __pyx_4 = PyTuple_GET_ITEM(__pyx_2, 0); Py_INCREF(__pyx_4);
- } else {
- __pyx_3 = PyInt_FromLong(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;}
- __pyx_4 = PyObject_GetItem(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- }
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_v_m = __pyx_5;
-
- /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":231
- *
- * # Add closing coordinates to sequence?
- * if b[-1,0] != b[0,0] or b[-1,1] != b[0,1]: # <<<<<<<<<<<<<<
- * M = m + 1
- * else:
- */
- __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
- Py_INCREF(__pyx_num_neg_1);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_num_neg_1);
- Py_INCREF(__pyx_num_0);
- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_num_0);
- __pyx_4 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
- Py_INCREF(__pyx_num_0);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_num_0);
- Py_INCREF(__pyx_num_0);
- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_num_0);
- __pyx_6 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_3); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_2 = PyObject_RichCompare(__pyx_4, __pyx_6, Py_NE); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- Py_DECREF(__pyx_6); __pyx_6 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
- if (!__pyx_1) {
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
- Py_INCREF(__pyx_num_neg_1);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_num_neg_1);
- Py_INCREF(__pyx_num_1);
- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_num_1);
- __pyx_4 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_6 = PyTuple_New(2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
- Py_INCREF(__pyx_num_0);
- PyTuple_SET_ITEM(__pyx_6, 0, __pyx_num_0);
- Py_INCREF(__pyx_num_1);
- PyTuple_SET_ITEM(__pyx_6, 1, __pyx_num_1);
- __pyx_3 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_6); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
- Py_DECREF(__pyx_6); __pyx_6 = 0;
- __pyx_2 = PyObject_RichCompare(__pyx_4, __pyx_3, Py_NE); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- }
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_...
[truncated message content] |
|
From: <jd...@us...> - 2008-02-13 13:50:33
|
Revision: 4959
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4959&view=rev
Author: jdh2358
Date: 2008-02-13 05:50:29 -0800 (Wed, 13 Feb 2008)
Log Message:
-----------
Applied Erik's right-click backend_bases fix
Modified Paths:
--------------
trunk/matplotlib/examples/ginput_demo.py
trunk/matplotlib/examples/lasso_demo.py
trunk/matplotlib/lib/matplotlib/backend_bases.py
trunk/matplotlib/lib/matplotlib/mlab.py
Modified: trunk/matplotlib/examples/ginput_demo.py
===================================================================
--- trunk/matplotlib/examples/ginput_demo.py 2008-02-13 08:34:53 UTC (rev 4958)
+++ trunk/matplotlib/examples/ginput_demo.py 2008-02-13 13:50:29 UTC (rev 4959)
@@ -2,5 +2,5 @@
t = arange(10)
plot(t, sin(t))
print "Please click"
-ginput(3, verbose=True)
+x = ginput(3, verbose=True)
show()
Modified: trunk/matplotlib/examples/lasso_demo.py
===================================================================
--- trunk/matplotlib/examples/lasso_demo.py 2008-02-13 08:34:53 UTC (rev 4958)
+++ trunk/matplotlib/examples/lasso_demo.py 2008-02-13 13:50:29 UTC (rev 4959)
@@ -37,7 +37,7 @@
facecolors = [d.color for d in data]
self.xys = [(d.x, d.y) for d in data]
-
+ fig = ax.figure
self.collection = RegularPolyCollection(
fig.dpi, 6, sizes=(100,),
facecolors=facecolors,
@@ -47,6 +47,7 @@
ax.add_collection(self.collection)
self.cid = self.canvas.mpl_connect('button_press_event', self.onpress)
+ self.ind = None
def callback(self, verts):
facecolors = self.collection.get_facecolors()
@@ -60,7 +61,7 @@
self.canvas.draw_idle()
self.canvas.widgetlock.release(self.lasso)
del self.lasso
-
+ self.ind = ind
def onpress(self, event):
if self.canvas.widgetlock.locked(): return
if event.inaxes is None: return
@@ -68,10 +69,12 @@
# acquire a lock on the widget drawing
self.canvas.widgetlock(self.lasso)
-data = [Datum(*xy) for xy in rand(100, 2)]
+if 0:
-fig = figure()
-ax = fig.add_subplot(111, xlim=(0,1), ylim=(0,1), autoscale_on=False)
-lman = LassoManager(ax, data)
+ data = [Datum(*xy) for xy in rand(100, 2)]
-show()
+ fig = figure()
+ ax = fig.add_subplot(111, xlim=(0,1), ylim=(0,1), autoscale_on=False)
+ lman = LassoManager(ax, data)
+
+ show()
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-02-13 08:34:53 UTC (rev 4958)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-02-13 13:50:29 UTC (rev 4959)
@@ -1556,11 +1556,11 @@
if a.get_xscale()=='log':
alpha=npy.log(Xmax/Xmin)/npy.log(x1/x0)
rx1=pow(Xmin/x0,alpha)*Xmin
- x2=pow(Xmax/x0,alpha)*Xmin
+ rx2=pow(Xmax/x0,alpha)*Xmin
else:
alpha=(Xmax-Xmin)/(x1-x0)
rx1=alpha*(Xmin-x0)+Xmin
- x2=alpha*(Xmax-x0)+Xmin
+ rx2=alpha*(Xmax-x0)+Xmin
if a.get_yscale()=='log':
alpha=npy.log(Ymax/Ymin)/npy.log(y1/y0)
ry1=pow(Ymin/y0,alpha)*Ymin
Modified: trunk/matplotlib/lib/matplotlib/mlab.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mlab.py 2008-02-13 08:34:53 UTC (rev 4958)
+++ trunk/matplotlib/lib/matplotlib/mlab.py 2008-02-13 13:50:29 UTC (rev 4959)
@@ -1943,7 +1943,13 @@
except NotImplementedError: return False
else: return b
+def safe_isinf(x):
+ 'isnan for arbitrary types'
+ try: b = npy.isinf(x)
+ except NotImplementedError: return False
+ else: return b
+
def rec_append_field(rec, name, arr, dtype=None):
'return a new record array with field name populated with data from array arr'
arr = npy.asarray(arr)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-02-13 08:34:57
|
Revision: 4958
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4958&view=rev
Author: efiring
Date: 2008-02-13 00:34:53 -0800 (Wed, 13 Feb 2008)
Log Message:
-----------
Fixed bugs in pcolorfast and in quadmesh rendering with svg, pdf
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/backends/backend_mixed.py
trunk/matplotlib/lib/matplotlib/image.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-02-13 02:31:45 UTC (rev 4957)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-02-13 08:34:53 UTC (rev 4958)
@@ -5035,7 +5035,8 @@
if (npy.ptp(dx) < 0.01*npy.abs(dx.mean()) and
npy.ptp(dy) < 0.01*npy.abs(dy.mean())):
style = "image"
- style = "pcolorimage"
+ else:
+ style = "pcolorimage"
elif x.ndim == 2 and y.ndim == 2:
style = "quadmesh"
else:
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_mixed.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_mixed.py 2008-02-13 02:31:45 UTC (rev 4957)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_mixed.py 2008-02-13 08:34:53 UTC (rev 4958)
@@ -89,7 +89,7 @@
if w > 0 and h > 0:
image = frombuffer(buffer, w, h, True)
image.is_grayscale = False
-
+ image.flipud_out()
self._renderer.draw_image(l, height - b - h, image, None)
self._raster_renderer = None
self._rasterizing = False
Modified: trunk/matplotlib/lib/matplotlib/image.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/image.py 2008-02-13 02:31:45 UTC (rev 4957)
+++ trunk/matplotlib/lib/matplotlib/image.py 2008-02-13 08:34:53 UTC (rev 4958)
@@ -451,8 +451,8 @@
A = self._rgbacache
vl = self.axes.viewLim
im = _image.pcolor2(self._Ax, self._Ay, A,
- self.axes.bbox.height,
- self.axes.bbox.width,
+ height,
+ width,
(vl.x0, vl.x1, vl.y0, vl.y1),
bg)
im.is_grayscale = self.is_grayscale
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-02-13 02:31:47
|
Revision: 4957
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4957&view=rev
Author: efiring
Date: 2008-02-12 18:31:45 -0800 (Tue, 12 Feb 2008)
Log Message:
-----------
Fix bug in pcolorfast with single argument
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-02-13 02:10:23 UTC (rev 4956)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-02-13 02:31:45 UTC (rev 4957)
@@ -5020,8 +5020,8 @@
nr, nc = C.shape
if len(args) == 1:
style = "image"
- x = [0, nc+1]
- y = [0, nr+1]
+ x = [0, nc]
+ y = [0, nr]
elif len(args) == 3:
x, y = args[:2]
x = npy.asarray(x)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-02-13 02:10:25
|
Revision: 4956
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4956&view=rev
Author: jdh2358
Date: 2008-02-12 18:10:23 -0800 (Tue, 12 Feb 2008)
Log Message:
-----------
committed eriks span selector patch
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/widgets.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-02-13 02:09:06 UTC (rev 4955)
+++ trunk/matplotlib/CHANGELOG 2008-02-13 02:10:23 UTC (rev 4956)
@@ -1,3 +1,5 @@
+2008-02-12 - Applied Erik Tollerud's span selector patch - JDH
+
2008-02-11 Update plotting() doc string to refer to getp/setp. - JKS
2008-02-10 Fixed a problem with square roots in the pdf backend with
Modified: trunk/matplotlib/lib/matplotlib/widgets.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/widgets.py 2008-02-13 02:09:06 UTC (rev 4955)
+++ trunk/matplotlib/lib/matplotlib/widgets.py 2008-02-13 02:10:23 UTC (rev 4956)
@@ -827,16 +827,14 @@
assert direction in ['horizontal', 'vertical'], 'Must choose horizontal or vertical for direction'
self.direction = direction
- self.ax = ax
+ self.ax = None
+ self.canvas = None
self.visible = True
- self.canvas = ax.figure.canvas
- self.canvas.mpl_connect('motion_notify_event', self.onmove)
- self.canvas.mpl_connect('button_press_event', self.press)
- self.canvas.mpl_connect('button_release_event', self.release)
- self.canvas.mpl_connect('draw_event', self.update_background)
+ self.cids=[]
self.rect = None
self.background = None
+ self.pressv = None
self.rectprops = rectprops
self.onselect = onselect
@@ -847,8 +845,23 @@
# Needed when dragging out of axes
self.buttonDown = False
self.prev = (0, 0)
-
- if self.direction == 'horizontal':
+
+ self.new_axes(ax)
+
+
+ def new_axes(self,ax):
+ self.ax = ax
+ if self.canvas is not ax.figure.canvas:
+ for cid in self.cids:
+ self.canvas.mpl_disconnect(cid)
+
+ self.canvas = ax.figure.canvas
+
+ self.cids.append(self.canvas.mpl_connect('motion_notify_event', self.onmove))
+ self.cids.append(self.canvas.mpl_connect('button_press_event', self.press))
+ self.cids.append(self.canvas.mpl_connect('button_release_event', self.release))
+ self.cids.append(self.canvas.mpl_connect('draw_event', self.update_background))
+ if self.direction == 'horizontal':
trans = blended_transform_factory(self.ax.transData, self.ax.transAxes)
w,h = 0,1
else:
@@ -859,9 +872,8 @@
visible=False,
**self.rectprops
)
-
+
if not self.useblit: self.ax.add_patch(self.rect)
- self.pressv = None
def update_background(self, event):
'force an update of the background'
@@ -931,10 +943,10 @@
minv, maxv = v, self.pressv
if minv>maxv: minv, maxv = maxv, minv
if self.direction == 'horizontal':
- self.rect.xy[0] = minv
+ self.rect.set_x(minv)
self.rect.set_width(maxv-minv)
else:
- self.rect.xy[1] = minv
+ self.rect.set_y(minv)
self.rect.set_height(maxv-minv)
if self.onmove_callback is not None:
@@ -1155,8 +1167,8 @@
miny, maxy = self.eventpress.ydata, y # click-y and actual mouse-y
if minx>maxx: minx, maxx = maxx, minx # get them in the right order
if miny>maxy: miny, maxy = maxy, miny
- self.to_draw.xy[0] = minx # set lower left of box
- self.to_draw.xy[1] = miny
+ self.to_draw.set_x(minx) # set lower left of box
+ self.to_draw.set_y(miny)
self.to_draw.set_width(maxx-minx) # set width and height of box
self.to_draw.set_height(maxy-miny)
self.update()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-02-13 02:09:09
|
Revision: 4955
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4955&view=rev
Author: efiring
Date: 2008-02-12 18:09:06 -0800 (Tue, 12 Feb 2008)
Log Message:
-----------
Improve colorbar handling of "hold" state
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/colorbar.py
Modified: trunk/matplotlib/lib/matplotlib/colorbar.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colorbar.py 2008-02-13 01:30:03 UTC (rev 4954)
+++ trunk/matplotlib/lib/matplotlib/colorbar.py 2008-02-13 02:09:06 UTC (rev 4955)
@@ -272,15 +272,20 @@
'''
Draw the colors using pcolor; optionally add separators.
'''
- ## Change to pcolormesh if/when it is fixed to handle alpha
- ## correctly.
+ ## Change to pcolorfast after fixing bugs in some backends...
if self.orientation == 'vertical':
args = (X, Y, C)
else:
args = (npy.transpose(Y), npy.transpose(X), npy.transpose(C))
kw = {'cmap':self.cmap, 'norm':self.norm,
'shading':'flat', 'alpha':self.alpha}
+ # Save, set, and restore hold state to keep pcolor from
+ # clearing the axes. Ordinarily this will not be needed,
+ # since the axes object should already have hold set.
+ _hold = self.ax.ishold()
+ self.ax.hold(True)
col = self.ax.pcolor(*args, **kw)
+ self.ax.hold(_hold)
#self.add_observer(col) # We should observe, not be observed...
self.solids = col
if self.drawedges:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-02-13 01:30:06
|
Revision: 4954
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4954&view=rev
Author: efiring
Date: 2008-02-12 17:30:03 -0800 (Tue, 12 Feb 2008)
Log Message:
-----------
Make colorbar work regardless of "hold" state
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/figure.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-02-12 14:10:41 UTC (rev 4953)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-02-13 01:30:03 UTC (rev 4954)
@@ -748,7 +748,6 @@
def cla(self):
'Clear the current axes'
-
self.xaxis.cla()
self.yaxis.cla()
Modified: trunk/matplotlib/lib/matplotlib/figure.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/figure.py 2008-02-12 14:10:41 UTC (rev 4953)
+++ trunk/matplotlib/lib/matplotlib/figure.py 2008-02-13 01:30:03 UTC (rev 4954)
@@ -98,8 +98,8 @@
class BlockingMouseInput(object):
- """ Class that creates a callable object to retrieve mouse clicks in a
- blocking way.
+ """ Class that creates a callable object to retrieve mouse clicks in a
+ blocking way.
"""
def __init__(self, fig):
self.fig = fig
@@ -123,8 +123,8 @@
elif event.inaxes:
# If it's a valid click, append the coordinates to the list
self.clicks.append((event.xdata, event.ydata))
- if self.verbose:
- print "input %i: %f,%f" % (len(self.clicks),
+ if self.verbose:
+ print "input %i: %f,%f" % (len(self.clicks),
event.xdata, event.ydata)
if self.show_clicks:
self.marks.extend(
@@ -135,7 +135,7 @@
def __call__(self, n=1, timeout=30, verbose=False, show_clicks=True):
- """ Blocking call to retrieve n coordinate pairs through mouse
+ """ Blocking call to retrieve n coordinate pairs through mouse
clicks.
"""
self.verbose = verbose
@@ -147,10 +147,10 @@
assert isinstance(n, int), "Requires an integer argument"
self.n = n
- # Ensure that the figure is shown
+ # Ensure that the figure is shown
self.fig.show()
# connect the click events to the on_click function call
- self.callback = self.fig.canvas.mpl_connect('button_press_event',
+ self.callback = self.fig.canvas.mpl_connect('button_press_event',
self.on_click)
# wait for n clicks
counter = 0
@@ -160,8 +160,8 @@
# check for a timeout
counter += 1
- if timeout > 0 and counter > timeout/0.01:
- print "ginput timeout";
+ if timeout > 0 and counter > timeout/0.01:
+ print "ginput timeout";
break;
# Disconnect the event, clean the figure, and return what we have
@@ -936,6 +936,7 @@
ax = self.gca()
if cax is None:
cax, kw = cbar.make_axes(ax, **kw)
+ cax.hold(True)
cb = cbar.Colorbar(cax, mappable, **kw)
mappable.add_observer(cb)
mappable.set_colorbar(cb, cax)
@@ -973,10 +974,10 @@
def ginput(self, n=1, timeout=30, verbose=False, show_clicks=True):
"""
ginput(self, n=1, timeout=30, verbose=False, show_clicks=True)
-
- Blocking call to interact with the figure.
- This will wait for n clicks from the user and return a list of the
+ Blocking call to interact with the figure.
+
+ This will wait for n clicks from the user and return a list of the
coordinates of each click. If timeout is negative, does not
timeout. If n is negative, accumulate clicks until a middle
click terminates the input. Right clicking cancels last input.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-02-12 14:10:52
|
Revision: 4953
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4953&view=rev
Author: jdh2358
Date: 2008-02-12 06:10:41 -0800 (Tue, 12 Feb 2008)
Log Message:
-----------
applied stefans intro patch
Modified Paths:
--------------
trunk/py4science/doc/rest_basics.txt
trunk/py4science/intro_talk/intro_python_scicomp.lyx
Modified: trunk/py4science/doc/rest_basics.txt
===================================================================
--- trunk/py4science/doc/rest_basics.txt 2008-02-11 19:46:52 UTC (rev 4952)
+++ trunk/py4science/doc/rest_basics.txt 2008-02-12 14:10:41 UTC (rev 4953)
@@ -1,6 +1,6 @@
-_=================================
+=================================
reST (reSTructured Text) basics
-=================================k
+=================================
.. Author: Fernando Perez
.. Contact: Fer...@co...
.. Time-stamp: "2007-08-29 15:50:06 fperez"
Modified: trunk/py4science/intro_talk/intro_python_scicomp.lyx
===================================================================
--- trunk/py4science/intro_talk/intro_python_scicomp.lyx 2008-02-11 19:46:52 UTC (rev 4952)
+++ trunk/py4science/intro_talk/intro_python_scicomp.lyx 2008-02-12 14:10:41 UTC (rev 4953)
@@ -1261,7 +1261,7 @@
\begin_layout Standard
\align center
\begin_inset Graphics
- filename ../../../talks/0708_ncar/fig/Fluidlab5.png
+ filename fig/Fluidlab5.png
lyxscale 50
width 90text%
keepAspectRatio
@@ -1278,7 +1278,7 @@
\begin_layout Standard
\align center
\begin_inset Graphics
- filename ../../../talks/0708_ncar/fig/Fluidlab6.png
+ filename fig/Fluidlab6.png
lyxscale 50
width 90text%
keepAspectRatio
@@ -1313,7 +1313,7 @@
\begin_layout Standard
\align center
\begin_inset Graphics
- filename ../../../talks/0708_ncar/fig/sage-cube5plot-medium.jpg
+ filename fig/sage_notebook-medium.jpg
lyxscale 50
width 90text%
keepAspectRatio
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jo...@us...> - 2008-02-11 19:46:55
|
Revision: 4952
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4952&view=rev
Author: jouni
Date: 2008-02-11 11:46:52 -0800 (Mon, 11 Feb 2008)
Log Message:
-----------
Merged revisions 4951 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint
........
r4951 | jouni | 2008-02-11 21:40:18 +0200 (Mon, 11 Feb 2008) | 1 line
Update plotting() doc string to refer to getp/setp.
........
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/pyplot.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-4946
+ /branches/v0_91_maint:1-4946,4951
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-02-11 19:40:18 UTC (rev 4951)
+++ trunk/matplotlib/CHANGELOG 2008-02-11 19:46:52 UTC (rev 4952)
@@ -1,3 +1,5 @@
+2008-02-11 Update plotting() doc string to refer to getp/setp. - JKS
+
2008-02-10 Fixed a problem with square roots in the pdf backend with
usetex. - JKS
Modified: trunk/matplotlib/lib/matplotlib/pyplot.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/pyplot.py 2008-02-11 19:40:18 UTC (rev 4951)
+++ trunk/matplotlib/lib/matplotlib/pyplot.py 2008-02-11 19:46:52 UTC (rev 4952)
@@ -981,7 +981,7 @@
gca - return the current axes
gcf - return the current figure
gci - get the current image, or None
- get - get a handle graphics property
+ getp - get a handle graphics property
hist - make a histogram
hold - set the hold state on current axes
legend - add a legend to the axes
@@ -997,7 +997,7 @@
rc - control the default params
savefig - save the current figure
scatter - make a scatter plot
- set - set a handle graphics property
+ setp - set a handle graphics property
semilogx - log x axis
semilogy - log y axis
show - show the figures
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jo...@us...> - 2008-02-11 19:40:22
|
Revision: 4951
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4951&view=rev
Author: jouni
Date: 2008-02-11 11:40:18 -0800 (Mon, 11 Feb 2008)
Log Message:
-----------
Update plotting() doc string to refer to getp/setp.
Modified Paths:
--------------
branches/v0_91_maint/CHANGELOG
branches/v0_91_maint/lib/matplotlib/pyplot.py
Modified: branches/v0_91_maint/CHANGELOG
===================================================================
--- branches/v0_91_maint/CHANGELOG 2008-02-10 15:21:56 UTC (rev 4950)
+++ branches/v0_91_maint/CHANGELOG 2008-02-11 19:40:18 UTC (rev 4951)
@@ -1,3 +1,5 @@
+2008-02-11 Update plotting() doc string to refer to getp/setp. - JKS
+
2008-02-01 Fix doubly-included font problem in Postscript backend - MGD
2008-02-01 Fix reference leak in ft2font Glyph objects. - MGD
Modified: branches/v0_91_maint/lib/matplotlib/pyplot.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/pyplot.py 2008-02-10 15:21:56 UTC (rev 4950)
+++ branches/v0_91_maint/lib/matplotlib/pyplot.py 2008-02-11 19:40:18 UTC (rev 4951)
@@ -933,7 +933,7 @@
gca - return the current axes
gcf - return the current figure
gci - get the current image, or None
- get - get a handle graphics property
+ getp - get a handle graphics property
hist - make a histogram
hold - set the hold state on current axes
legend - add a legend to the axes
@@ -949,7 +949,7 @@
rc - control the default params
savefig - save the current figure
scatter - make a scatter plot
- set - set a handle graphics property
+ setp - set a handle graphics property
semilogx - log x axis
semilogy - log y axis
show - show the figures
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jo...@us...> - 2008-02-10 15:22:00
|
Revision: 4950
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4950&view=rev
Author: jouni
Date: 2008-02-10 07:21:56 -0800 (Sun, 10 Feb 2008)
Log Message:
-----------
Fixed a problem with square roots in the pdf backend with usetex.
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-02-08 21:09:33 UTC (rev 4949)
+++ trunk/matplotlib/CHANGELOG 2008-02-10 15:21:56 UTC (rev 4950)
@@ -1,3 +1,6 @@
+2008-02-10 Fixed a problem with square roots in the pdf backend with
+ usetex. - JKS
+
2008-02-08 Fixed minor __str__ bugs so getp(gca()) works. - JKS
2008-02-05 Added getters for title, xlabel, ylabel, as requested
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2008-02-08 21:09:33 UTC (rev 4949)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2008-02-10 15:21:56 UTC (rev 4950)
@@ -35,7 +35,7 @@
from matplotlib.ft2font import FT2Font, FIXED_WIDTH, ITALIC, LOAD_NO_SCALE, \
LOAD_NO_HINTING, KERNING_UNFITTED
from matplotlib.mathtext import MathTextParser
-from matplotlib.transforms import Bbox, BboxBase
+from matplotlib.transforms import Affine2D, Bbox, BboxBase
from matplotlib.path import Path
from matplotlib import ttconv
@@ -1331,14 +1331,6 @@
page = iter(dvi).next()
dvi.close()
- if angle == 0: # avoid rounding errors in common case
- def mytrans(x1, y1):
- return x+x1, y+y1
- else:
- def mytrans(x1, y1, x=x, y=y, a=angle / 180.0 * pi):
- return x + cos(a)*x1 - sin(a)*y1, \
- y + sin(a)*x1 + cos(a)*y1
-
# Gather font information and do some setup for combining
# characters into strings.
oldfont, seq = None, []
@@ -1354,7 +1346,6 @@
seq += [['font', pdfname, dvifont.size]]
oldfont = dvifont
seq += [['text', x1, y1, [chr(glyph)], x1+width]]
- seq += [('end',)]
# Find consecutive text strings with constant x coordinate and
# combine into a sequence of strings and kerns, or just one
@@ -1374,7 +1365,10 @@
continue
i += 1
- # Now do the actual output.
+ # Create a transform to map the dvi contents to the canvas.
+ mytrans = Affine2D().rotate_deg(angle).translate(x, y)
+
+ # Output the text.
self.check_gc(gc, gc._rgb)
self.file.output(Op.begin_text)
curx, cury, oldx, oldy = 0, 0, 0, 0
@@ -1382,7 +1376,7 @@
if elt[0] == 'font':
self.file.output(elt[1], elt[2], Op.selectfont)
elif elt[0] == 'text':
- curx, cury = mytrans(elt[1], elt[2])
+ curx, cury = mytrans.transform((elt[1], elt[2]))
self._setup_textpos(curx, cury, angle, oldx, oldy)
oldx, oldy = curx, cury
if len(elt[3]) == 1:
@@ -1390,20 +1384,20 @@
else:
self.file.output(elt[3], Op.showkern)
else:
- assert elt[0] == 'end'
+ assert False
self.file.output(Op.end_text)
- # Finally output the boxes (used for the variable-length lines
- # in square roots and the like).
+ # Then output the boxes (e.g. variable-length lines of square
+ # roots).
boxgc = self.new_gc()
boxgc.copy_properties(gc)
boxgc.set_linewidth(0)
+ pathops = [Path.MOVETO, Path.LINETO, Path.LINETO, Path.LINETO,
+ Path.CLOSEPOLY]
for x1, y1, h, w in page.boxes:
- (x1, y1), (x2, y2), (x3, y3), (x4, y4) = \
- mytrans(x1, y1), mytrans(x1+w, y1), \
- mytrans(x1+w, y1+h), mytrans(x1, y1+h)
- self.draw_polygon(boxgc, gc._rgb,
- ((x1,y1), (x2,y2), (x3,y3), (x4,y4)))
+ path = Path([[x1, y1], [x1+w, y1], [x1+w, y1+h], [x1, y1+h],
+ [0,0]], pathops)
+ self.draw_path(boxgc, path, mytrans, gc._rgb)
def encode_string(self, s, fonttype):
if fonttype == 3:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jo...@us...> - 2008-02-08 21:09:39
|
Revision: 4949
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4949&view=rev
Author: jouni
Date: 2008-02-08 13:09:33 -0800 (Fri, 08 Feb 2008)
Log Message:
-----------
Fixed minor __str__ bugs so getp(gca()) works.
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/axis.py
trunk/matplotlib/lib/matplotlib/patches.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-02-08 17:56:12 UTC (rev 4948)
+++ trunk/matplotlib/CHANGELOG 2008-02-08 21:09:33 UTC (rev 4949)
@@ -1,3 +1,5 @@
+2008-02-08 Fixed minor __str__ bugs so getp(gca()) works. - JKS
+
2008-02-05 Added getters for title, xlabel, ylabel, as requested
by Brandon Kieth - EF
Modified: trunk/matplotlib/lib/matplotlib/axis.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axis.py 2008-02-08 17:56:12 UTC (rev 4948)
+++ trunk/matplotlib/lib/matplotlib/axis.py 2008-02-08 21:09:33 UTC (rev 4949)
@@ -498,8 +498,8 @@
OFFSETTEXTPAD = 3
def __str__(self):
- return str(self.__class__).split('.')[-1] \
- + "(%d,%d)"%self.axes.transAxes.xy_tup((0,0))
+ return self.__class__.__name__ \
+ + "(%f,%f)"%tuple(self.axes.transAxes.transform_point((0,0)))
def __init__(self, axes, pickradius=15):
"""
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py 2008-02-08 17:56:12 UTC (rev 4948)
+++ trunk/matplotlib/lib/matplotlib/patches.py 2008-02-08 21:09:33 UTC (rev 4949)
@@ -344,8 +344,8 @@
"""
def __str__(self):
- return str(self.__class__).split('.')[-1] \
- + "(%g,%g;%gx%g)" % tuple(self._bbox.bounds)
+ return self.__class__.__name__ \
+ + "(%g,%g;%gx%g)" % (self._x, self._y, self._width, self._height)
def __init__(self, xy, width, height, **kwargs):
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jr...@us...> - 2008-02-08 17:56:18
|
Revision: 4948
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4948&view=rev
Author: jrevans
Date: 2008-02-08 09:56:12 -0800 (Fri, 08 Feb 2008)
Log Message:
-----------
Removed a reference to nx, replaced with numpy.
Modified Paths:
--------------
branches/v0_91_maint/examples/units/units_sample.py
Modified: branches/v0_91_maint/examples/units/units_sample.py
===================================================================
--- branches/v0_91_maint/examples/units/units_sample.py 2008-02-06 14:03:15 UTC (rev 4947)
+++ branches/v0_91_maint/examples/units/units_sample.py 2008-02-08 17:56:12 UTC (rev 4948)
@@ -8,9 +8,10 @@
"""
from basic_units import cm, inch
-from pylab import figure, show, nx
+from pylab import figure, show
+import numpy
-cms = cm *nx.arange(0, 10, 2)
+cms = cm *numpy.arange(0, 10, 2)
fig = figure()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-02-06 14:03:35
|
Revision: 4947
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4947&view=rev
Author: mdboom
Date: 2008-02-06 06:03:15 -0800 (Wed, 06 Feb 2008)
Log Message:
-----------
Merged revisions 4928-4946 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint
........
r4946 | mdboom | 2008-02-06 09:02:11 -0500 (Wed, 06 Feb 2008) | 1 line
Updating changelog
........
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-4927
+ /branches/v0_91_maint:1-4946
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-02-06 14:02:11 UTC (rev 4946)
+++ trunk/matplotlib/CHANGELOG 2008-02-06 14:03:15 UTC (rev 4947)
@@ -12,6 +12,8 @@
2008-02-03 Force dpi=72 in pdf backend to fix picture size bug. - JKS
+2008-02-01 Fix doubly-included font problem in Postscript backend - MGD
+
2008-02-01 Fix reference leak in ft2font Glyph objects. - MGD
2008-01-31 Don't use unicode strings with usetex by default - DSD
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-02-06 14:02:14
|
Revision: 4946
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4946&view=rev
Author: mdboom
Date: 2008-02-06 06:02:11 -0800 (Wed, 06 Feb 2008)
Log Message:
-----------
Updating changelog
Modified Paths:
--------------
branches/v0_91_maint/CHANGELOG
Modified: branches/v0_91_maint/CHANGELOG
===================================================================
--- branches/v0_91_maint/CHANGELOG 2008-02-06 06:30:44 UTC (rev 4945)
+++ branches/v0_91_maint/CHANGELOG 2008-02-06 14:02:11 UTC (rev 4946)
@@ -1,3 +1,5 @@
+2008-02-01 Fix doubly-included font problem in Postscript backend - MGD
+
2008-02-01 Fix reference leak in ft2font Glyph objects. - MGD
2008-01-31 Don't use unicode strings with usetex by default - DSD
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-02-06 06:30:45
|
Revision: 4945
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4945&view=rev
Author: efiring
Date: 2008-02-05 22:30:44 -0800 (Tue, 05 Feb 2008)
Log Message:
-----------
Added getters for title, xlabel, ylabel (Brandon Kieth)
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-02-05 23:31:32 UTC (rev 4944)
+++ trunk/matplotlib/CHANGELOG 2008-02-06 06:30:44 UTC (rev 4945)
@@ -1,3 +1,6 @@
+2008-02-05 Added getters for title, xlabel, ylabel, as requested
+ by Brandon Kieth - EF
+
2008-02-05 Applied Gael's ginput patch and created
examples/ginput_demo.py - JDH
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-02-05 23:31:32 UTC (rev 4944)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-02-06 06:30:44 UTC (rev 4945)
@@ -2225,6 +2225,12 @@
#### Labelling
+ def get_title(self):
+ """
+ Get the title text string.
+ """
+ return self.title.get_text()
+
def set_title(self, label, fontdict=None, **kwargs):
"""
SET_TITLE(label, fontdict=None, **kwargs):
@@ -2250,6 +2256,13 @@
return self.title
set_title.__doc__ = cbook.dedent(set_title.__doc__) % martist.kwdocd
+ def get_xlabel(self):
+ """
+ Get the xlabel text string.
+ """
+ label = self.xaxis.get_label()
+ return label.get_text()
+
def set_xlabel(self, xlabel, fontdict=None, **kwargs):
"""
SET_XLABEL(xlabel, fontdict=None, **kwargs)
@@ -2269,6 +2282,13 @@
return label
set_xlabel.__doc__ = cbook.dedent(set_xlabel.__doc__) % martist.kwdocd
+ def get_ylabel(self):
+ """
+ Get the ylabel text string.
+ """
+ label = self.yaxis.get_label()
+ return label.get_text()
+
def set_ylabel(self, ylabel, fontdict=None, **kwargs):
"""
SET_YLABEL(ylabel, fontdict=None, **kwargs)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pki...@us...> - 2008-02-05 23:31:34
|
Revision: 4944
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4944&view=rev
Author: pkienzle
Date: 2008-02-05 15:31:32 -0800 (Tue, 05 Feb 2008)
Log Message:
-----------
Put output from each backend in a separate directory
Modified Paths:
--------------
trunk/matplotlib/examples/backend_driver.py
Modified: trunk/matplotlib/examples/backend_driver.py
===================================================================
--- trunk/matplotlib/examples/backend_driver.py 2008-02-05 23:17:34 UTC (rev 4943)
+++ trunk/matplotlib/examples/backend_driver.py 2008-02-05 23:31:32 UTC (rev 4944)
@@ -131,6 +131,16 @@
_backend = 'cairo'
else:
_backend = backend
+
+ # Clear the destination directory for the examples
+ path = backend
+ if os.path.exists(path):
+ import glob
+ for fname in os.listdir(path):
+ os.unlink(os.path.join(path,fname))
+ else:
+ os.mkdir(backend)
+
for fname in files:
if fname in exclude:
print '\tSkipping %s, known to fail on backend: %s'%backend
@@ -138,7 +148,7 @@
print ('\tdriving %-40s' % (fname)),
basename, ext = os.path.splitext(fname)
- outfile = basename + '_%s'%backend
+ outfile = os.path.join(path,basename)
tmpfile_name = '_tmp_%s.py' % basename
tmpfile = file(tmpfile_name, 'w')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pki...@us...> - 2008-02-05 23:17:38
|
Revision: 4943
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4943&view=rev
Author: pkienzle
Date: 2008-02-05 15:17:34 -0800 (Tue, 05 Feb 2008)
Log Message:
-----------
Move flush_events to canvas as in other backends; remove Yield loop on gui_repaint; fix showfig callback in FigureManager
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-02-05 21:52:04 UTC (rev 4942)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-02-05 23:17:34 UTC (rev 4943)
@@ -889,6 +889,9 @@
if repaint:
self.gui_repaint()
+ def flush_events(self):
+ wx.Yield()
+
def _get_imagesave_wildcards(self):
'return the wildcard string for the filesave dialog'
default_filetype = self.get_default_filetype()
@@ -921,7 +924,7 @@
drawDC.BeginDrawing()
drawDC.DrawBitmap(self.bitmap, 0, 0)
drawDC.EndDrawing()
- wx.GetApp().Yield()
+ #wx.GetApp().Yield()
filetypes = FigureCanvasBase.filetypes.copy()
filetypes['bmp'] = 'Windows bitmap'
@@ -1301,9 +1304,6 @@
wxapp.Yield()
return True
- def flush_events(self):
- wx.Yield()
-
class FigureManagerWx(FigureManagerBase):
"""
This class contains the FigureCanvas and GUI frame
@@ -1332,9 +1332,9 @@
self.canvas.figure.add_axobserver(notify_axes_change)
def showfig(*args):
- figwin.frame.Show()
- figwin.canvas.realize()
- figwin.canvas.draw()
+ frame.Show()
+ canvas.realize()
+ canvas.draw()
# attach a show method to the figure
self.canvas.figure.show = showfig
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-02-05 21:52:14
|
Revision: 4942
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4942&view=rev
Author: jdh2358
Date: 2008-02-05 13:52:04 -0800 (Tue, 05 Feb 2008)
Log Message:
-----------
added ginput example
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
Added Paths:
-----------
trunk/matplotlib/examples/ginput_demo.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-02-05 21:50:58 UTC (rev 4941)
+++ trunk/matplotlib/CHANGELOG 2008-02-05 21:52:04 UTC (rev 4942)
@@ -1,3 +1,6 @@
+2008-02-05 Applied Gael's ginput patch and created
+ examples/ginput_demo.py - JDH
+
2008-02-03 Expose interpnames, a list of valid interpolation
methods, as an AxesImage class attribute. - EF
Added: trunk/matplotlib/examples/ginput_demo.py
===================================================================
--- trunk/matplotlib/examples/ginput_demo.py (rev 0)
+++ trunk/matplotlib/examples/ginput_demo.py 2008-02-05 21:52:04 UTC (rev 4942)
@@ -0,0 +1,6 @@
+from pylab import arange, plot, sin, ginput, show
+t = arange(10)
+plot(t, sin(t))
+print "Please click"
+ginput(3, verbose=True)
+show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-02-05 21:51:04
|
Revision: 4941
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4941&view=rev
Author: jdh2358
Date: 2008-02-05 13:50:58 -0800 (Tue, 05 Feb 2008)
Log Message:
-----------
applied gael's ginput patch
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backend_bases.py
trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py
trunk/matplotlib/lib/matplotlib/backends/backend_qt.py
trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py
trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py
trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
trunk/matplotlib/lib/matplotlib/figure.py
trunk/matplotlib/lib/matplotlib/pyplot.py
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-02-05 07:54:01 UTC (rev 4940)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-02-05 21:50:58 UTC (rev 4941)
@@ -1151,7 +1151,13 @@
"""
return self.callbacks.disconnect(cid)
+ def flush_events(self):
+ """ Flush the GUI events for the figure. Implemented only for
+ backends with GUIs.
+ """
+ raise NotImplementedError
+
class FigureManagerBase:
"""
Helper class for matlab mode, wraps everything up into a neat bundle
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2008-02-05 07:54:01 UTC (rev 4940)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2008-02-05 21:50:58 UTC (rev 4941)
@@ -386,6 +386,13 @@
def get_default_filetype(self):
return 'png'
+ def flush_events(self):
+ gtk.gdk.threads_enter()
+ while gtk.events_pending():
+ gtk.main_iteration(True)
+ gtk.gdk.flush()
+ gtk.gdk.threads_leave()
+
class FigureManagerGTK(FigureManagerBase):
"""
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt.py 2008-02-05 07:54:01 UTC (rev 4940)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt.py 2008-02-05 21:50:58 UTC (rev 4941)
@@ -175,6 +175,9 @@
return key
+ def flush_events(self):
+ qt.qApp.processEvents()
+
class FigureManagerQT( FigureManagerBase ):
"""
Public attributes
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2008-02-05 07:54:01 UTC (rev 4940)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2008-02-05 21:50:58 UTC (rev 4941)
@@ -13,7 +13,7 @@
from matplotlib.mathtext import MathTextParser
from matplotlib.widgets import SubplotTool
-from PyQt4 import QtCore, QtGui
+from PyQt4 import QtCore, QtGui, Qt
backend_version = "0.9.1"
def fn_name(): return sys._getframe(1).f_code.co_name
@@ -174,6 +174,9 @@
return key
+ def flush_events(self):
+ Qt.qApp.processEvents()
+
class FigureManagerQT( FigureManagerBase ):
"""
Public attributes
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2008-02-05 07:54:01 UTC (rev 4940)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2008-02-05 21:50:58 UTC (rev 4941)
@@ -269,8 +269,9 @@
key = self._get_key(event)
FigureCanvasBase.key_release_event(self, key, guiEvent=event)
+ def flush_events(self):
+ self._master.update()
-
class FigureManagerTkAgg(FigureManagerBase):
"""
Public attributes
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-02-05 07:54:01 UTC (rev 4940)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-02-05 21:50:58 UTC (rev 4941)
@@ -1301,6 +1301,9 @@
wxapp.Yield()
return True
+ def flush_events(self):
+ wx.Yield()
+
class FigureManagerWx(FigureManagerBase):
"""
This class contains the FigureCanvas and GUI frame
Modified: trunk/matplotlib/lib/matplotlib/figure.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/figure.py 2008-02-05 07:54:01 UTC (rev 4940)
+++ trunk/matplotlib/lib/matplotlib/figure.py 2008-02-05 21:50:58 UTC (rev 4941)
@@ -2,6 +2,7 @@
Figure class -- add docstring here!
"""
import numpy as npy
+import time
import artist
from artist import Artist
@@ -96,6 +97,83 @@
setattr(self, s, val)
+class BlockingMouseInput(object):
+ """ Class that creates a callable object to retrieve mouse clicks in a
+ blocking way.
+ """
+ def __init__(self, fig):
+ self.fig = fig
+
+
+ def on_click(self, event):
+ """ Event handler that will be passed to the current figure to
+ retrieve clicks.
+ """
+ if event.button == 3:
+ # If it's a right click, pop the last coordinates.
+ if len(self.clicks) > 0:
+ self.clicks.pop()
+ if self.show_clicks:
+ mark = self.marks.pop()
+ mark.remove()
+ self.fig.canvas.draw()
+ elif event.button == 2 and self.n < 0:
+ # If it's a middle click, and we are in infinite mode, finish
+ self.done = True
+ elif event.inaxes:
+ # If it's a valid click, append the coordinates to the list
+ self.clicks.append((event.xdata, event.ydata))
+ if self.verbose:
+ print "input %i: %f,%f" % (len(self.clicks),
+ event.xdata, event.ydata)
+ if self.show_clicks:
+ self.marks.extend(
+ event.inaxes.plot([event.xdata,], [event.ydata,], 'r+') )
+ self.fig.canvas.draw()
+ if self.n > 0 and len(self.clicks) >= self.n:
+ self.done = True
+
+
+ def __call__(self, n=1, timeout=30, verbose=False, show_clicks=True):
+ """ Blocking call to retrieve n coordinate pairs through mouse
+ clicks.
+ """
+ self.verbose = verbose
+ self.done = False
+ self.clicks = []
+ self.show_clicks = True
+ self.marks = []
+
+ assert isinstance(n, int), "Requires an integer argument"
+ self.n = n
+
+ # Ensure that the figure is shown
+ self.fig.show()
+ # connect the click events to the on_click function call
+ self.callback = self.fig.canvas.mpl_connect('button_press_event',
+ self.on_click)
+ # wait for n clicks
+ counter = 0
+ while not self.done:
+ self.fig.canvas.flush_events()
+ time.sleep(0.01)
+
+ # check for a timeout
+ counter += 1
+ if timeout > 0 and counter > timeout/0.01:
+ print "ginput timeout";
+ break;
+
+ # Disconnect the event, clean the figure, and return what we have
+ self.fig.canvas.mpl_disconnect(self.callback)
+ self.callback = None
+ if self.show_clicks:
+ for mark in self.marks:
+ mark.remove()
+ self.fig.canvas.draw()
+ return self.clicks
+
+
class Figure(Artist):
def __str__(self):
@@ -892,8 +970,24 @@
ax.update_params()
ax.set_position(ax.figbox)
+ def ginput(self, n=1, timeout=30, verbose=False, show_clicks=True):
+ """
+ ginput(self, n=1, timeout=30, verbose=False, show_clicks=True)
+
+ Blocking call to interact with the figure.
+ This will wait for n clicks from the user and return a list of the
+ coordinates of each click. If timeout is negative, does not
+ timeout. If n is negative, accumulate clicks until a middle
+ click terminates the input. Right clicking cancels last input.
+ """
+ blocking_mouse_input = BlockingMouseInput(self)
+ return blocking_mouse_input(n=n, timeout=timeout,
+ verbose=verbose, show_clicks=True)
+
+
+
def figaspect(arg):
"""
Create a figure with specified aspect ratio. If arg is a number,
Modified: trunk/matplotlib/lib/matplotlib/pyplot.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/pyplot.py 2008-02-05 07:54:01 UTC (rev 4940)
+++ trunk/matplotlib/lib/matplotlib/pyplot.py 2008-02-05 21:50:58 UTC (rev 4941)
@@ -272,6 +272,20 @@
if Figure.savefig.__doc__ is not None:
savefig.__doc__ = dedent(Figure.savefig.__doc__)
+def ginput(*args, **kwargs):
+ """
+ Blocking call to interact with the figure.
+
+ This will wait for n clicks from the user and return a list of the
+ coordinates of each click.
+
+ If timeout is negative, does not timeout.
+ """
+ return gcf().ginput(*args, **kwargs)
+if Figure.ginput.__doc__ is not None:
+ ginput.__doc__ = dedent(Figure.ginput.__doc__)
+
+
# Putting things in figures
def figtext(*args, **kwargs):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-02-05 07:54:08
|
Revision: 4940
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4940&view=rev
Author: efiring
Date: 2008-02-04 23:54:01 -0800 (Mon, 04 Feb 2008)
Log Message:
-----------
New example to illustrate log scale for contour levels.
Added Paths:
-----------
trunk/matplotlib/examples/contourf_log.py
Added: trunk/matplotlib/examples/contourf_log.py
===================================================================
--- trunk/matplotlib/examples/contourf_log.py (rev 0)
+++ trunk/matplotlib/examples/contourf_log.py 2008-02-05 07:54:01 UTC (rev 4940)
@@ -0,0 +1,48 @@
+'''
+Demonstrate use of a log color scale in contourf
+'''
+
+from matplotlib import pyplot as P
+import numpy as npy
+from numpy import ma
+from matplotlib import colors, ticker
+from matplotlib.mlab import bivariate_normal
+
+N = 100
+x = npy.linspace(-3.0, 3.0, N)
+y = npy.linspace(-2.0, 2.0, N)
+
+X, Y = npy.meshgrid(x, y)
+
+# A low hump with a spike coming out of the top right.
+# Needs to have z/colour axis on a log scale so we see both hump and spike.
+# linear scale only shows the spike.
+z = (bivariate_normal(X, Y, 0.1, 0.2, 1.0, 1.0)
+ + 0.1 * bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0))
+
+# Put in some negative values (lower left corner) to cause trouble with logs:
+z[:5, :5] = -1
+
+# The following is not strictly essential, but it will eliminate
+# a warning. Comment it out to see the warning.
+z = ma.masked_where(z<= 0, z)
+
+
+# Automatic selection of levels works; setting the
+# log locator tells contourf to use a log scale:
+cs = P.contourf(X, Y, z, locator=ticker.LogLocator())
+
+# Alternatively, you can manually set the levels
+# and the norm:
+#lev_exp = npy.arange(npy.floor(npy.log10(z.min())-1),
+# npy.ceil(npy.log10(z.max())+1))
+#levs = npy.power(10, lev_exp)
+#cs = P.contourf(X, Y, z, levs, norm=colors.LogNorm())
+
+#The 'extend' kwarg does not work yet with a log scale.
+
+cbar = P.colorbar()
+
+P.show()
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-02-05 07:34:41
|
Revision: 4939
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4939&view=rev
Author: efiring
Date: 2008-02-04 23:34:39 -0800 (Mon, 04 Feb 2008)
Log Message:
-----------
Bugfix in contour auto level selection via locator
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/contour.py
Modified: trunk/matplotlib/lib/matplotlib/contour.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/contour.py 2008-02-04 19:53:07 UTC (rev 4938)
+++ trunk/matplotlib/lib/matplotlib/contour.py 2008-02-05 07:34:39 UTC (rev 4939)
@@ -514,12 +514,11 @@
self.locator = ticker.LogLocator()
else:
self.locator = ticker.MaxNLocator(N+1)
- self.locator.create_dummy_axis()
- locator = self.locator
+ self.locator.create_dummy_axis()
zmax = self.zmax
zmin = self.zmin
- locator.set_bounds(zmin, zmax)
- lev = locator()
+ self.locator.set_bounds(zmin, zmax)
+ lev = self.locator()
zmargin = (zmax - zmin) * 0.000001 # so z < (zmax + zmargin)
if zmax >= lev[-1]:
lev[-1] += zmargin
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-02-04 19:53:18
|
Revision: 4938
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4938&view=rev
Author: mdboom
Date: 2008-02-04 11:53:07 -0800 (Mon, 04 Feb 2008)
Log Message:
-----------
Fix Postscript graphics context bug (Thanks Paul Novak for finding this)
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2008-02-04 07:25:08 UTC (rev 4937)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2008-02-04 19:53:07 UTC (rev 4938)
@@ -759,6 +759,15 @@
fill = (fill and rgbFace is not None and
(len(rgbFace) <= 3 or rgbFace[3] != 0.0))
+ if stroke or gc.get_linewidth() > 0.0:
+ self.set_linewidth(gc.get_linewidth())
+ jint = gc.get_joinstyle()
+ self.set_linejoin(jint)
+ cint = gc.get_capstyle()
+ self.set_linecap(cint)
+ self.set_linedash(*gc.get_dashes())
+ self.set_color(*gc.get_rgb()[:3])
+
cliprect = gc.get_clip_rectangle()
if cliprect:
x,y,w,h=cliprect.bounds
@@ -782,14 +791,7 @@
self.set_color(store=0, *rgbFace[:3])
write("fill\ngrestore\n")
- if stroke and gc.get_linewidth() > 0.0:
- self.set_linewidth(gc.get_linewidth())
- jint = gc.get_joinstyle()
- self.set_linejoin(jint)
- cint = gc.get_capstyle()
- self.set_linecap(cint)
- self.set_linedash(*gc.get_dashes())
- self.set_color(*gc.get_rgb()[:3])
+ if stroke or gc.get_linewidth() > 0.0:
write("stroke\n")
else:
write("newpath\n")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-02-04 07:25:14
|
Revision: 4937
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4937&view=rev
Author: efiring
Date: 2008-02-03 23:25:08 -0800 (Sun, 03 Feb 2008)
Log Message:
-----------
Raise ValueError if legend is called with invalid numpoints (Paul Novak)
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/legend.py
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py 2008-02-04 06:50:00 UTC (rev 4936)
+++ trunk/matplotlib/lib/matplotlib/legend.py 2008-02-04 07:25:08 UTC (rev 4937)
@@ -122,6 +122,8 @@
if value is None:
value=rcParams["legend."+name]
setattr(self,name,value)
+ if self.numpoints <= 0:
+ raise ValueError("numpoints must be >= 0; it was %d"% numpoints)
if prop is None:
self.prop=FontProperties(size=rcParams["legend.fontsize"])
else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|