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...> - 2007-11-13 23:11:33
|
Revision: 4261 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4261&view=rev Author: jswhit Date: 2007-11-13 15:11:28 -0800 (Tue, 13 Nov 2007) Log Message: ----------- fix typo Modified Paths: -------------- trunk/toolkits/basemap-testing/README Modified: trunk/toolkits/basemap-testing/README =================================================================== --- trunk/toolkits/basemap-testing/README 2007-11-13 23:03:46 UTC (rev 4260) +++ trunk/toolkits/basemap-testing/README 2007-11-13 23:11:28 UTC (rev 4261) @@ -29,7 +29,7 @@ is included. Everything else (including src/_proj.pyx, src/_geod.pyx, src/_pyproj.pxi, -src/_proj.c and src/_geod.c, src/_geos.c, src/_geos.pyx): +src/_proj.c, src/_geod.c, src/_geos.c, and src/_geos.pyx): copyright (c) 2007 by Jeffrey Whitaker. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-13 23:03:48
|
Revision: 4260 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4260&view=rev Author: jswhit Date: 2007-11-13 15:03:46 -0800 (Tue, 13 Nov 2007) Log Message: ----------- remove obsolete function Modified Paths: -------------- trunk/toolkits/basemap-testing/src/_geos.c trunk/toolkits/basemap-testing/src/_geos.pyx Modified: trunk/toolkits/basemap-testing/src/_geos.c =================================================================== --- trunk/toolkits/basemap-testing/src/_geos.c 2007-11-13 23:02:59 UTC (rev 4259) +++ trunk/toolkits/basemap-testing/src/_geos.c 2007-11-13 23:03:46 UTC (rev 4260) @@ -1,4 +1,4 @@ -/* Generated by Cython 0.9.6.7 on Tue Nov 13 16:02:30 2007 */ +/* Generated by Cython 0.9.6.7 on Tue Nov 13 16:03:26 2007 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -123,7 +123,6 @@ 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__add_geom(struct __pyx_obj_5_geos_BaseGeometry *,GEOSGeom (*))); /*proto*/ static PyObject *(__pyx_f_5_geos__get_coords(GEOSGeom (*))); /*proto*/ @@ -1496,7 +1495,7 @@ * GEOSArea(self._geom, &area) * return area # <<<<<<<<<<<<<< * - * cdef _add_geom(BaseGeometry p, GEOSGeom *geom): + * cdef _get_coords(GEOSGeom *geom): */ __pyx_1 = PyFloat_FromDouble(__pyx_v_area); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; goto __pyx_L1;} __pyx_r = __pyx_1; @@ -1514,100 +1513,6 @@ return __pyx_r; } -static PyObject *__pyx_f_5_geos__add_geom(struct __pyx_obj_5_geos_BaseGeometry *__pyx_v_p,GEOSGeom (*__pyx_v_geom)) { - GEOSCoordSeq (*__pyx_v_cs); - GEOSGeom (*__pyx_v_lr); - unsigned int __pyx_v_M; - PyObject *__pyx_r; - int __pyx_1; - Py_INCREF(__pyx_v_p); - - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":266 - * cdef GEOSGeom *lr - * cdef unsigned int M - * if GEOSGeomTypeId(geom) == GEOS_POLYGON: # <<<<<<<<<<<<<< - * lr = GEOSGetExteriorRing(geom) - * cs = GEOSGeom_getCoordSeq(lr) - */ - __pyx_1 = (GEOSGeomTypeId(__pyx_v_geom) == GEOS_POLYGON); - if (__pyx_1) { - - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":267 - * cdef unsigned int M - * if GEOSGeomTypeId(geom) == GEOS_POLYGON: - * lr = GEOSGetExteriorRing(geom) # <<<<<<<<<<<<<< - * cs = GEOSGeom_getCoordSeq(lr) - * else: - */ - __pyx_v_lr = GEOSGetExteriorRing(__pyx_v_geom); - - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":268 - * if GEOSGeomTypeId(geom) == GEOS_POLYGON: - * lr = GEOSGetExteriorRing(geom) - * cs = GEOSGeom_getCoordSeq(lr) # <<<<<<<<<<<<<< - * else: - * cs = GEOSGeom_getCoordSeq(geom) - */ - __pyx_v_cs = GEOSGeom_getCoordSeq(__pyx_v_lr); - goto __pyx_L2; - } - /*else*/ { - - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":270 - * cs = GEOSGeom_getCoordSeq(lr) - * else: - * cs = GEOSGeom_getCoordSeq(geom) # <<<<<<<<<<<<<< - * GEOSCoordSeq_getSize(cs, &M) - * p._geom = geom - */ - __pyx_v_cs = GEOSGeom_getCoordSeq(__pyx_v_geom); - } - __pyx_L2:; - - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":271 - * else: - * cs = GEOSGeom_getCoordSeq(geom) - * GEOSCoordSeq_getSize(cs, &M) # <<<<<<<<<<<<<< - * p._geom = geom - * p._npts = M - */ - GEOSCoordSeq_getSize(__pyx_v_cs,(&__pyx_v_M)); - - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":272 - * cs = GEOSGeom_getCoordSeq(geom) - * GEOSCoordSeq_getSize(cs, &M) - * p._geom = geom # <<<<<<<<<<<<<< - * p._npts = M - * return p - */ - __pyx_v_p->_geom = __pyx_v_geom; - - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":273 - * GEOSCoordSeq_getSize(cs, &M) - * p._geom = geom - * p._npts = M # <<<<<<<<<<<<<< - * return p - * - */ - __pyx_v_p->_npts = __pyx_v_M; - - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":274 - * p._geom = geom - * p._npts = M - * return p # <<<<<<<<<<<<<< - * - * cdef _get_coords(GEOSGeom *geom): - */ - Py_INCREF(((PyObject *)__pyx_v_p)); - __pyx_r = ((PyObject *)__pyx_v_p); - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - __pyx_L0:; - Py_DECREF(__pyx_v_p); - return __pyx_r; -} - static PyObject *__pyx_num_2; static PyObject *__pyx_n_empty; @@ -1630,7 +1535,7 @@ PyObject *__pyx_5 = 0; __pyx_v_b = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":283 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":269 * cdef ndarray b * cdef double *bbuffer * if GEOSGeomTypeId(geom) == GEOS_POLYGON: # <<<<<<<<<<<<<< @@ -1640,7 +1545,7 @@ __pyx_1 = (GEOSGeomTypeId(__pyx_v_geom) == GEOS_POLYGON); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":284 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":270 * cdef double *bbuffer * if GEOSGeomTypeId(geom) == GEOS_POLYGON: * lr = GEOSGetExteriorRing(geom) # <<<<<<<<<<<<<< @@ -1649,7 +1554,7 @@ */ __pyx_v_lr = GEOSGetExteriorRing(__pyx_v_geom); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":285 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":271 * if GEOSGeomTypeId(geom) == GEOS_POLYGON: * lr = GEOSGetExteriorRing(geom) * cs = GEOSGeom_getCoordSeq(lr) # <<<<<<<<<<<<<< @@ -1661,7 +1566,7 @@ } /*else*/ { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":287 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":273 * cs = GEOSGeom_getCoordSeq(lr) * else: * cs = GEOSGeom_getCoordSeq(geom) # <<<<<<<<<<<<<< @@ -1672,7 +1577,7 @@ } __pyx_L2:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":288 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":274 * else: * cs = GEOSGeom_getCoordSeq(geom) * GEOSCoordSeq_getSize(cs, &M) # <<<<<<<<<<<<<< @@ -1681,39 +1586,39 @@ */ GEOSCoordSeq_getSize(__pyx_v_cs,(&__pyx_v_M)); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":289 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":275 * cs = GEOSGeom_getCoordSeq(geom) * GEOSCoordSeq_getSize(cs, &M) * b = numpy.empty((M,2), numpy.float64) # <<<<<<<<<<<<<< * bbuffer = <double *>b.data * for i from 0 <= i < M: */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyLong_FromUnsignedLong(__pyx_v_M); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} + __pyx_2 = PyLong_FromUnsignedLong(__pyx_v_M); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); Py_INCREF(__pyx_num_2); PyTuple_SET_ITEM(__pyx_4, 1, __pyx_num_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); PyTuple_SET_ITEM(__pyx_2, 1, __pyx_5); __pyx_4 = 0; __pyx_5 = 0; - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_5_geos_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_5_geos_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_b)); __pyx_v_b = ((PyArrayObject *)__pyx_4); __pyx_4 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":290 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":276 * GEOSCoordSeq_getSize(cs, &M) * b = numpy.empty((M,2), numpy.float64) * bbuffer = <double *>b.data # <<<<<<<<<<<<<< @@ -1722,7 +1627,7 @@ */ __pyx_v_bbuffer = ((double (*))__pyx_v_b->data); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":291 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":277 * b = numpy.empty((M,2), numpy.float64) * bbuffer = <double *>b.data * for i from 0 <= i < M: # <<<<<<<<<<<<<< @@ -1731,7 +1636,7 @@ */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_M; __pyx_v_i++) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":292 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":278 * bbuffer = <double *>b.data * for i from 0 <= i < M: * GEOSCoordSeq_getX(cs, i, &dx) # <<<<<<<<<<<<<< @@ -1740,7 +1645,7 @@ */ GEOSCoordSeq_getX(__pyx_v_cs,__pyx_v_i,(&__pyx_v_dx)); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":293 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":279 * for i from 0 <= i < M: * GEOSCoordSeq_getX(cs, i, &dx) * GEOSCoordSeq_getY(cs, i, &dy) # <<<<<<<<<<<<<< @@ -1749,7 +1654,7 @@ */ GEOSCoordSeq_getY(__pyx_v_cs,__pyx_v_i,(&__pyx_v_dy)); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":294 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":280 * GEOSCoordSeq_getX(cs, i, &dx) * GEOSCoordSeq_getY(cs, i, &dy) * bbuffer[2*i] = dx # <<<<<<<<<<<<<< @@ -1758,7 +1663,7 @@ */ (__pyx_v_bbuffer[(2 * __pyx_v_i)]) = __pyx_v_dx; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":295 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":281 * GEOSCoordSeq_getY(cs, i, &dy) * bbuffer[2*i] = dx * bbuffer[2*i+1] = dy # <<<<<<<<<<<<<< @@ -1768,7 +1673,7 @@ (__pyx_v_bbuffer[((2 * __pyx_v_i) + 1)]) = __pyx_v_dy; } - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":296 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":282 * bbuffer[2*i] = dx * bbuffer[2*i+1] = dy * return b # <<<<<<<<<<<<<< @@ -1812,9 +1717,9 @@ 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 = 299; goto __pyx_L1;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_5_geos_ndarray, 1, "b"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;} - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":307 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":293 * # make sure data is contiguous. * # if not, make a local copy. * if not PyArray_ISCONTIGUOUS(b): # <<<<<<<<<<<<<< @@ -1824,17 +1729,17 @@ __pyx_1 = (!PyArray_ISCONTIGUOUS(__pyx_v_b)); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":308 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":294 * # if not, make a local copy. * if not PyArray_ISCONTIGUOUS(b): * b = b.copy() # <<<<<<<<<<<<<< * * M = b.shape[0] */ - __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_b), __pyx_n_copy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; goto __pyx_L1;} - __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_b), __pyx_n_copy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; 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 = 308; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_5_geos_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_b)); __pyx_v_b = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; @@ -1842,29 +1747,29 @@ } __pyx_L2:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":310 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":296 * b = b.copy() * * M = b.shape[0] # <<<<<<<<<<<<<< * self._npts = M * */ - __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_b), __pyx_n_shape); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_b), __pyx_n_shape); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; 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 = 310; goto __pyx_L1;} - __pyx_4 = PyObject_GetItem(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; goto __pyx_L1;} + __pyx_4 = PyObject_GetItem(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; } Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_5 = PyInt_AsLong(__pyx_4); if (unlikely((__pyx_5 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;} + __pyx_5 = PyInt_AsLong(__pyx_4); if (unlikely((__pyx_5 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_v_M = __pyx_5; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":311 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":297 * * M = b.shape[0] * self._npts = M # <<<<<<<<<<<<<< @@ -1873,7 +1778,7 @@ */ ((struct __pyx_obj_5_geos_LineString *)__pyx_v_self)->__pyx_base._npts = __pyx_v_M; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":314 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":300 * * # Create a coordinate sequence * cs = GEOSCoordSeq_create(M, 2) # <<<<<<<<<<<<<< @@ -1882,7 +1787,7 @@ */ __pyx_v_cs = GEOSCoordSeq_create(__pyx_v_M,2); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":317 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":303 * * # add to coordinate sequence * bbuffer = <double *>b.data # <<<<<<<<<<<<<< @@ -1891,7 +1796,7 @@ */ __pyx_v_bbuffer = ((double (*))__pyx_v_b->data); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":318 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":304 * # add to coordinate sequence * bbuffer = <double *>b.data * for i from 0 <= i < M: # <<<<<<<<<<<<<< @@ -1900,7 +1805,7 @@ */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_M; __pyx_v_i++) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":319 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":305 * bbuffer = <double *>b.data * for i from 0 <= i < M: * dx = bbuffer[2*i] # <<<<<<<<<<<<<< @@ -1909,7 +1814,7 @@ */ __pyx_v_dx = (__pyx_v_bbuffer[(2 * __pyx_v_i)]); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":320 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":306 * for i from 0 <= i < M: * dx = bbuffer[2*i] * dy = bbuffer[2*i+1] # <<<<<<<<<<<<<< @@ -1918,7 +1823,7 @@ */ __pyx_v_dy = (__pyx_v_bbuffer[((2 * __pyx_v_i) + 1)]); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":323 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":309 * # Because of a bug in the GEOS C API, * # always set X before Y * GEOSCoordSeq_setX(cs, i, dx) # <<<<<<<<<<<<<< @@ -1927,7 +1832,7 @@ */ GEOSCoordSeq_setX(__pyx_v_cs,__pyx_v_i,__pyx_v_dx); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":324 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":310 * # always set X before Y * GEOSCoordSeq_setX(cs, i, dx) * GEOSCoordSeq_setY(cs, i, dy) # <<<<<<<<<<<<<< @@ -1937,7 +1842,7 @@ GEOSCoordSeq_setY(__pyx_v_cs,__pyx_v_i,__pyx_v_dy); } - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":327 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":313 * * # create LineString * self._geom = GEOSGeom_createLineString(cs) # <<<<<<<<<<<<<< @@ -1946,7 +1851,7 @@ */ ((struct __pyx_obj_5_geos_LineString *)__pyx_v_self)->__pyx_base._geom = GEOSGeom_createLineString(__pyx_v_cs); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":328 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":314 * # create LineString * self._geom = GEOSGeom_createLineString(cs) * self.boundary = b # <<<<<<<<<<<<<< @@ -1986,7 +1891,7 @@ Py_INCREF((PyObject *)__pyx_v_self); Py_INCREF(__pyx_v_b); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":336 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":322 * cdef GEOSCoordSeq *cs * # Create a coordinate sequence * cs = GEOSCoordSeq_create(1, 2) # <<<<<<<<<<<<<< @@ -1995,7 +1900,7 @@ */ __pyx_v_cs = GEOSCoordSeq_create(1,2); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":337 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":323 * # Create a coordinate sequence * cs = GEOSCoordSeq_create(1, 2) * dx = b[0]; dy = b[1] # <<<<<<<<<<<<<< @@ -2007,15 +1912,15 @@ } else if (PyTuple_CheckExact(__pyx_v_b) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_v_b)) { __pyx_2 = PyTuple_GET_ITEM(__pyx_v_b, 0); Py_INCREF(__pyx_2); } else { - __pyx_1 = PyInt_FromLong(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;} - __pyx_2 = PyObject_GetItem(__pyx_v_b, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_v_b, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; } - __pyx_3 = PyFloat_AsDouble(__pyx_2); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;} + __pyx_3 = PyFloat_AsDouble(__pyx_2); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_v_dx = __pyx_3; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":337 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":323 * # Create a coordinate sequence * cs = GEOSCoordSeq_create(1, 2) * dx = b[0]; dy = b[1] # <<<<<<<<<<<<<< @@ -2027,15 +1932,15 @@ } else if (PyTuple_CheckExact(__pyx_v_b) && 0 <= 1 && 1 < PyTuple_GET_SIZE(__pyx_v_b)) { __pyx_2 = PyTuple_GET_ITEM(__pyx_v_b, 1); Py_INCREF(__pyx_2); } else { - __pyx_1 = PyInt_FromLong(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;} - __pyx_2 = PyObject_GetItem(__pyx_v_b, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_v_b, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; } - __pyx_3 = PyFloat_AsDouble(__pyx_2); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;} + __pyx_3 = PyFloat_AsDouble(__pyx_2); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_v_dy = __pyx_3; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":338 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":324 * cs = GEOSCoordSeq_create(1, 2) * dx = b[0]; dy = b[1] * GEOSCoordSeq_setX(cs, 0, dx) # <<<<<<<<<<<<<< @@ -2044,7 +1949,7 @@ */ GEOSCoordSeq_setX(__pyx_v_cs,0,__pyx_v_dx); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":339 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":325 * dx = b[0]; dy = b[1] * GEOSCoordSeq_setX(cs, 0, dx) * GEOSCoordSeq_setY(cs, 0, dy) # <<<<<<<<<<<<<< @@ -2053,7 +1958,7 @@ */ GEOSCoordSeq_setY(__pyx_v_cs,0,__pyx_v_dy); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":340 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":326 * GEOSCoordSeq_setX(cs, 0, dx) * GEOSCoordSeq_setY(cs, 0, dy) * self._geom = GEOSGeom_createPoint(cs) # <<<<<<<<<<<<<< @@ -2062,7 +1967,7 @@ */ ((struct __pyx_obj_5_geos_Point *)__pyx_v_self)->__pyx_base._geom = GEOSGeom_createPoint(__pyx_v_cs); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":341 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":327 * GEOSCoordSeq_setY(cs, 0, dy) * self._geom = GEOSGeom_createPoint(cs) * self._npts = 1 # <<<<<<<<<<<<<< @@ -2070,7 +1975,7 @@ */ ((struct __pyx_obj_5_geos_Point *)__pyx_v_self)->__pyx_base._npts = 1; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":342 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":328 * self._geom = GEOSGeom_createPoint(cs) * self._npts = 1 * self.boundary = b # <<<<<<<<<<<<<< @@ -2786,13 +2691,13 @@ if (PyObject_SetAttrString(__pyx_m, "Polygon", (PyObject *)&__pyx_type_5_geos_Polygon) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; goto __pyx_L1;} __pyx_ptype_5_geos_Polygon = &__pyx_type_5_geos_Polygon; __pyx_type_5_geos_LineString.tp_base = __pyx_ptype_5_geos_BaseGeometry; - if (PyType_Ready(&__pyx_type_5_geos_LineString) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; goto __pyx_L1;} - if (PyObject_SetAttrString(__pyx_m, "LineString", (PyObject *)&__pyx_type_5_geos_LineString) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; goto __pyx_L1;} + if (PyType_Ready(&__pyx_type_5_geos_LineString) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "LineString", (PyObject *)&__pyx_type_5_geos_LineString) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;} __pyx_ptype_5_geos_LineString = &__pyx_type_5_geos_LineString; __pyx_type_5_geos_Point.tp_base = __pyx_ptype_5_geos_BaseGeometry; __pyx_type_5_geos_Point.tp_free = _PyObject_GC_Del; - if (PyType_Ready(&__pyx_type_5_geos_Point) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; goto __pyx_L1;} - if (PyObject_SetAttrString(__pyx_m, "Point", (PyObject *)&__pyx_type_5_geos_Point) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; goto __pyx_L1;} + if (PyType_Ready(&__pyx_type_5_geos_Point) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "Point", (PyObject *)&__pyx_type_5_geos_Point) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; goto __pyx_L1;} __pyx_ptype_5_geos_Point = &__pyx_type_5_geos_Point; /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":1 @@ -2841,7 +2746,7 @@ */ initGEOS(__pyx_f_5_geos_notice_h,__pyx_f_5_geos_error_h); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":332 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":318 * cdef class Point(BaseGeometry): * cdef public x,y * def __init__(self, b): # <<<<<<<<<<<<<< Modified: trunk/toolkits/basemap-testing/src/_geos.pyx =================================================================== --- trunk/toolkits/basemap-testing/src/_geos.pyx 2007-11-13 23:02:59 UTC (rev 4259) +++ trunk/toolkits/basemap-testing/src/_geos.pyx 2007-11-13 23:03:46 UTC (rev 4260) @@ -259,20 +259,6 @@ GEOSArea(self._geom, &area) return area -cdef _add_geom(BaseGeometry p, GEOSGeom *geom): - cdef GEOSCoordSeq *cs - cdef GEOSGeom *lr - cdef unsigned int M - if GEOSGeomTypeId(geom) == GEOS_POLYGON: - lr = GEOSGetExteriorRing(geom) - cs = GEOSGeom_getCoordSeq(lr) - else: - cs = GEOSGeom_getCoordSeq(geom) - GEOSCoordSeq_getSize(cs, &M) - p._geom = geom - p._npts = M - return p - cdef _get_coords(GEOSGeom *geom): cdef GEOSCoordSeq *cs cdef GEOSGeom *lr This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-13 23:03:00
|
Revision: 4259 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4259&view=rev Author: jswhit Date: 2007-11-13 15:02:59 -0800 (Tue, 13 Nov 2007) Log Message: ----------- more fixes for pickling Modified Paths: -------------- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py trunk/toolkits/basemap-testing/src/_geos.c trunk/toolkits/basemap-testing/src/_geos.pyx Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py =================================================================== --- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-13 22:26:02 UTC (rev 4258) +++ trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-13 23:02:59 UTC (rev 4259) @@ -772,7 +772,7 @@ maptran = pyproj.Proj(proj='stere',lon_0=lon_0,lat_0=lat_0) # boundary polygon for orthographic projection # in stereographic coorindates. - b = self._boundarypolyll.get_coords() + b = self._boundarypolyll.boundary blons = b[:,0]; blats = b[:,1] b[:,0], b[:,1] = maptran(blons, blats) boundarypolyxy = _geos.Polygon(b) @@ -854,7 +854,7 @@ # which have a 'boundary' attribute. # otherwise, use 'coords' attribute # to extract coordinates. - b = psub.get_coords() + b = psub.boundary blons = b[:,0]; blats = b[:,1] # transformation from lat/lon to # map projection coordinates. @@ -904,7 +904,7 @@ pass # iterate over geometries in intersection. for psub in geoms: - b = psub.get_coords() + b = psub.boundary # if projection == 'ortho', # transform polygon from stereographic # to orthographic coordinates. Modified: trunk/toolkits/basemap-testing/src/_geos.c =================================================================== --- trunk/toolkits/basemap-testing/src/_geos.c 2007-11-13 22:26:02 UTC (rev 4258) +++ trunk/toolkits/basemap-testing/src/_geos.c 2007-11-13 23:02:59 UTC (rev 4259) @@ -1,4 +1,4 @@ -/* Generated by Cython 0.9.6.7 on Tue Nov 13 15:19:22 2007 */ +/* Generated by Cython 0.9.6.7 on Tue Nov 13 16:02:30 2007 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -77,10 +77,10 @@ static void __Pyx_WriteUnraisable(char *name); /*proto*/ -static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ - static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*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*/ @@ -121,9 +121,6 @@ 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 PyArrayObject *__pyx_k4; -static PyArrayObject *__pyx_k5; -static PyObject *__pyx_k6; 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__add_geom(struct __pyx_obj_5_geos_BaseGeometry *,GEOSGeom (*))); /*proto*/ @@ -153,9 +150,9 @@ static PyObject *__pyx_n_stdout; static PyObject *__pyx_n_write; -static PyObject *__pyx_k7p; +static PyObject *__pyx_k4p; -static char (__pyx_k7[]) = "GEOS_NOTICE: %s\n"; +static char (__pyx_k4[]) = "GEOS_NOTICE: %s\n"; static void __pyx_f_5_geos_notice_h(char (*__pyx_v_fmt),char (*__pyx_v_msg)) { PyObject *__pyx_v_format; @@ -255,7 +252,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_write); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyNumber_Remainder(__pyx_k7p, __pyx_v_warn_msg); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} + __pyx_2 = PyNumber_Remainder(__pyx_k4p, __pyx_v_warn_msg); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); __pyx_2 = 0; @@ -278,9 +275,9 @@ static PyObject *__pyx_n_stderr; -static PyObject *__pyx_k8p; +static PyObject *__pyx_k5p; -static char (__pyx_k8[]) = "GEOS_ERROR: %s\n"; +static char (__pyx_k5[]) = "GEOS_ERROR: %s\n"; static void __pyx_f_5_geos_error_h(char (*__pyx_v_fmt),char (*__pyx_v_msg)) { PyObject *__pyx_v_format; @@ -380,7 +377,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_write); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyNumber_Remainder(__pyx_k8p, __pyx_v_warn_msg); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} + __pyx_2 = PyNumber_Remainder(__pyx_k5p, __pyx_v_warn_msg); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); __pyx_2 = 0; @@ -664,11 +661,11 @@ static PyObject *__pyx_n_append; static PyObject *__pyx_n_NotImplementedError; -static PyObject *__pyx_k9p; +static PyObject *__pyx_k6p; static PyObject *__pyx_builtin_NotImplementedError; -static char (__pyx_k9[]) = "intersections of type '%s' not yet implemented"; +static char (__pyx_k6[]) = "intersections of type '%s' not yet implemented"; static PyObject *__pyx_f_py_5_geos_12BaseGeometry_intersection(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/ static PyObject *__pyx_f_py_5_geos_12BaseGeometry_intersection(PyObject *__pyx_v_self, PyObject *__pyx_v_geom) { @@ -679,8 +676,10 @@ 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; @@ -688,8 +687,10 @@ 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 = 158; goto __pyx_L1;} /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":162 @@ -724,7 +725,7 @@ * g3 = GEOSIntersection(g1, g2) * typeid = GEOSGeomTypeId(g3) # <<<<<<<<<<<<<< * if typeid == GEOS_POLYGON: - * p = Polygon() # create an empty Polygon instance + * b = _get_coords(g3) */ __pyx_v_typeid = GEOSGeomTypeId(__pyx_v_g3); @@ -732,8 +733,8 @@ * g3 = GEOSIntersection(g1, g2) * typeid = GEOSGeomTypeId(g3) * if typeid == GEOS_POLYGON: # <<<<<<<<<<<<<< - * p = Polygon() # create an empty Polygon instance - * p = _add_geom(p,g3) # add geometry to it. + * b = _get_coords(g3) + * p = Polygon(b) */ __pyx_1 = (__pyx_v_typeid == GEOS_POLYGON); if (__pyx_1) { @@ -741,36 +742,39 @@ /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":167 * typeid = GEOSGeomTypeId(g3) * if typeid == GEOS_POLYGON: - * p = Polygon() # create an empty Polygon instance # <<<<<<<<<<<<<< - * p = _add_geom(p,g3) # add geometry to it. - * # above should be faster than this .. + * b = _get_coords(g3) # <<<<<<<<<<<<<< + * p = Polygon(b) + * pout = [p] */ - __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_Polygon), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;} - Py_DECREF(__pyx_v_p); - __pyx_v_p = __pyx_2; + __pyx_2 = __pyx_f_5_geos__get_coords(__pyx_v_g3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;} + Py_DECREF(__pyx_v_b); + __pyx_v_b = __pyx_2; __pyx_2 = 0; /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":168 * if typeid == GEOS_POLYGON: - * p = Polygon() # create an empty Polygon instance - * p = _add_geom(p,g3) # add geometry to it. # <<<<<<<<<<<<<< - * # above should be faster than this .. - * #b = _get_coords(g3) + * b = _get_coords(g3) + * p = Polygon(b) # <<<<<<<<<<<<<< + * pout = [p] + * elif typeid == GEOS_LINESTRING: */ - if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_5_geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; goto __pyx_L1;} - __pyx_2 = __pyx_f_5_geos__add_geom(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_p),__pyx_v_g3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; 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 = 168; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_p); - __pyx_v_p = __pyx_2; - __pyx_2 = 0; + __pyx_v_p = __pyx_3; + __pyx_3 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":172 - * #b = _get_coords(g3) - * #p = Polygon(b) - * pout = [p] # return a list with a single element # <<<<<<<<<<<<<< + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":169 + * b = _get_coords(g3) + * p = Polygon(b) + * pout = [p] # <<<<<<<<<<<<<< * elif typeid == GEOS_LINESTRING: - * p = LineString() # create an empty LineString instance + * b = _get_coords(g3) */ - __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;} + __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;} Py_INCREF(__pyx_v_p); PyList_SET_ITEM(__pyx_2, 0, __pyx_v_p); Py_DECREF(__pyx_v_pout); @@ -781,51 +785,54 @@ __pyx_1 = (__pyx_v_typeid == GEOS_LINESTRING); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":174 - * pout = [p] # return a list with a single element + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":171 + * pout = [p] * elif typeid == GEOS_LINESTRING: - * p = LineString() # create an empty LineString instance # <<<<<<<<<<<<<< - * p = _add_geom(p,g3) # add geometry to it. - * return [p] + * b = _get_coords(g3) # <<<<<<<<<<<<<< + * p = LineString(b) + * pout = [p] */ - __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_LineString), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} - Py_DECREF(__pyx_v_p); - __pyx_v_p = __pyx_2; - __pyx_2 = 0; + __pyx_3 = __pyx_f_5_geos__get_coords(__pyx_v_g3); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L1;} + Py_DECREF(__pyx_v_b); + __pyx_v_b = __pyx_3; + __pyx_3 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":175 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":172 * elif typeid == GEOS_LINESTRING: - * p = LineString() # create an empty LineString instance - * p = _add_geom(p,g3) # add geometry to it. # <<<<<<<<<<<<<< - * return [p] + * b = _get_coords(g3) + * p = LineString(b) # <<<<<<<<<<<<<< + * pout = [p] * elif typeid == GEOS_MULTIPOLYGON: */ - if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_5_geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} - __pyx_2 = __pyx_f_5_geos__add_geom(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_p),__pyx_v_g3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; 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 = 172; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_p); - __pyx_v_p = __pyx_2; - __pyx_2 = 0; + __pyx_v_p = __pyx_3; + __pyx_3 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":176 - * p = LineString() # create an empty LineString instance - * p = _add_geom(p,g3) # add geometry to it. - * return [p] # <<<<<<<<<<<<<< + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":173 + * 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 = 176; goto __pyx_L1;} + __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;} Py_INCREF(__pyx_v_p); PyList_SET_ITEM(__pyx_2, 0, __pyx_v_p); - __pyx_r = __pyx_2; + Py_DECREF(__pyx_v_pout); + __pyx_v_pout = __pyx_2; __pyx_2 = 0; - goto __pyx_L0; goto __pyx_L2; } __pyx_1 = (__pyx_v_typeid == GEOS_MULTIPOLYGON); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":178 - * return [p] + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":175 + * pout = [p] * elif typeid == GEOS_MULTIPOLYGON: * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<< * pout = [] @@ -833,75 +840,78 @@ */ __pyx_v_numgeoms = GEOSGetNumGeometries(__pyx_v_g3); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":179 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":176 * elif typeid == GEOS_MULTIPOLYGON: * numgeoms = GEOSGetNumGeometries(g3) * pout = [] # <<<<<<<<<<<<<< * for i from 0 <= i < numgeoms: * gout = GEOSGetGeometryN(g3, i) */ - __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;} + __pyx_3 = PyList_New(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;} Py_DECREF(__pyx_v_pout); - __pyx_v_pout = __pyx_2; - __pyx_2 = 0; + __pyx_v_pout = __pyx_3; + __pyx_3 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":180 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":177 * numgeoms = GEOSGetNumGeometries(g3) * pout = [] * for i from 0 <= i < numgeoms: # <<<<<<<<<<<<<< * gout = GEOSGetGeometryN(g3, i) - * p = Polygon() # create an empty Polygon instance + * b = _get_coords(gout) */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_numgeoms; __pyx_v_i++) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":181 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":178 * pout = [] * for i from 0 <= i < numgeoms: * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<< - * p = Polygon() # create an empty Polygon instance - * p = _add_geom(p,gout) # add geometry to it. + * b = _get_coords(gout) + * p = Polygon(b) */ __pyx_v_gout = GEOSGetGeometryN(__pyx_v_g3,__pyx_v_i); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":182 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":179 * for i from 0 <= i < numgeoms: * gout = GEOSGetGeometryN(g3, i) - * p = Polygon() # create an empty Polygon instance # <<<<<<<<<<<<<< - * p = _add_geom(p,gout) # add geometry to it. + * b = _get_coords(gout) # <<<<<<<<<<<<<< + * p = Polygon(b) * pout.append(p) */ - __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_Polygon), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;} - Py_DECREF(__pyx_v_p); - __pyx_v_p = __pyx_2; + __pyx_2 = __pyx_f_5_geos__get_coords(__pyx_v_gout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;} + Py_DECREF(__pyx_v_b); + __pyx_v_b = __pyx_2; __pyx_2 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":183 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":180 * gout = GEOSGetGeometryN(g3, i) - * p = Polygon() # create an empty Polygon instance - * p = _add_geom(p,gout) # add geometry to it. # <<<<<<<<<<<<<< + * b = _get_coords(gout) + * p = Polygon(b) # <<<<<<<<<<<<<< * pout.append(p) * elif typeid == GEOS_MULTILINESTRING: */ - if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_5_geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;} - __pyx_2 = __pyx_f_5_geos__add_geom(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_p),__pyx_v_gout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; 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 = 180; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_v_p); __pyx_v_p = __pyx_2; __pyx_2 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":184 - * p = Polygon() # create an empty Polygon instance - * p = _add_geom(p,gout) # add geometry to it. + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":181 + * b = _get_coords(gout) + * p = Polygon(b) * pout.append(p) # <<<<<<<<<<<<<< * elif typeid == GEOS_MULTILINESTRING: * numgeoms = GEOSGetNumGeometries(g3) */ - __pyx_2 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} Py_INCREF(__pyx_v_p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; + 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 = 181; 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; @@ -909,7 +919,7 @@ __pyx_1 = (__pyx_v_typeid == GEOS_MULTILINESTRING); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":186 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":183 * pout.append(p) * elif typeid == GEOS_MULTILINESTRING: * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<< @@ -918,102 +928,117 @@ */ __pyx_v_numgeoms = GEOSGetNumGeometries(__pyx_v_g3); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":187 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":184 * elif typeid == GEOS_MULTILINESTRING: * numgeoms = GEOSGetNumGeometries(g3) * pout = [] # <<<<<<<<<<<<<< * for i from 0 <= i < numgeoms: * gout = GEOSGetGeometryN(g3, i) */ - __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;} + __pyx_3 = PyList_New(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;} Py_DECREF(__pyx_v_pout); - __pyx_v_pout = __pyx_2; - __pyx_2 = 0; + __pyx_v_pout = __pyx_3; + __pyx_3 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":188 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":185 * numgeoms = GEOSGetNumGeometries(g3) * pout = [] * for i from 0 <= i < numgeoms: # <<<<<<<<<<<<<< * gout = GEOSGetGeometryN(g3, i) - * p = LineString() # create an LineString instance + * b = _get_coords(gout) */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_numgeoms; __pyx_v_i++) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":189 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":186 * pout = [] * for i from 0 <= i < numgeoms: * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<< - * p = LineString() # create an LineString instance - * p = _add_geom(p,gout) # add geometry to it. + * b = _get_coords(gout) + * p = LineString(b) */ __pyx_v_gout = GEOSGetGeometryN(__pyx_v_g3,__pyx_v_i); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":190 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":187 * for i from 0 <= i < numgeoms: * gout = GEOSGetGeometryN(g3, i) - * p = LineString() # create an LineString instance # <<<<<<<<<<<<<< - * p = _add_geom(p,gout) # add geometry to it. + * b = _get_coords(gout) # <<<<<<<<<<<<<< + * p = LineString(b) * pout.append(p) */ - __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_LineString), 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L1;} - Py_DECREF(__pyx_v_p); - __pyx_v_p = __pyx_3; - __pyx_3 = 0; + __pyx_2 = __pyx_f_5_geos__get_coords(__pyx_v_gout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;} + Py_DECREF(__pyx_v_b); + __pyx_v_b = __pyx_2; + __pyx_2 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":191 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":188 * gout = GEOSGetGeometryN(g3, i) - * p = LineString() # create an LineString instance - * p = _add_geom(p,gout) # add geometry to it. # <<<<<<<<<<<<<< + * b = _get_coords(gout) + * p = LineString(b) # <<<<<<<<<<<<<< * pout.append(p) * else: */ - if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_5_geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;} - __pyx_4 = __pyx_f_5_geos__add_geom(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_p),__pyx_v_gout); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; 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 = 188; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_v_p); - __pyx_v_p = __pyx_4; - __pyx_4 = 0; + __pyx_v_p = __pyx_3; + __pyx_3 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":192 - * p = LineString() # create an LineString instance - * p = _add_geom(p,gout) # add geometry to it. + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":189 + * b = _get_coords(gout) + * p = LineString(b) * pout.append(p) # <<<<<<<<<<<<<< * else: - * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) + * 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 = 192; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; goto __pyx_L1;} Py_INCREF(__pyx_v_p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} + 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 = 189; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; } goto __pyx_L2; } /*else*/ { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":194 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":191 * pout.append(p) * else: + * type = PyString_FromString(GEOSGeomType(g3)) # <<<<<<<<<<<<<< + * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) + * return pout + */ + __pyx_2 = PyString_FromString(GEOSGeomType(__pyx_v_g3)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;} + Py_DECREF(__pyx_v_type); + __pyx_v_type = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":192 + * else: + * type = PyString_FromString(GEOSGeomType(g3)) * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) # <<<<<<<<<<<<<< * return pout * */ - __pyx_2 = PyNumber_Remainder(__pyx_k9p, ((PyObject*)&PyType_Type)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); - __pyx_2 = 0; - __pyx_4 = PyObject_CallObject(__pyx_builtin_NotImplementedError, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} + __pyx_4 = PyNumber_Remainder(__pyx_k6p, __pyx_v_type); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; 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 = 192; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} } __pyx_L2:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":195 - * else: + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":193 + * type = PyString_FromString(GEOSGeomType(g3)) * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) * return pout # <<<<<<<<<<<<<< * @@ -1032,8 +1057,10 @@ __Pyx_AddTraceback("_geos.BaseGeometry.intersection"); __pyx_r = 0; __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; @@ -1045,14 +1072,14 @@ PyObject *__pyx_1 = 0; Py_INCREF(__pyx_v_self); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":198 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":196 * * def get_coords(self): * return _get_coords(self._geom) # <<<<<<<<<<<<<< * * def __dealloc__(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 = 198; goto __pyx_L1;} + __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 = 196; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -1073,7 +1100,7 @@ static void __pyx_f_py_5_geos_12BaseGeometry___dealloc__(PyObject *__pyx_v_self) { Py_INCREF(__pyx_v_self); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":202 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":200 * def __dealloc__(self): * """destroy GEOS geometry""" * GEOSGeom_destroy(self._geom) # <<<<<<<<<<<<<< @@ -1096,18 +1123,18 @@ PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":206 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":204 * def __reduce__(self): * """special method that allows geos instance to be pickled""" * return (self.__class__,(self.boundary,)) # <<<<<<<<<<<<<< * * cdef class Polygon(BaseGeometry): */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___class__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___class__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; 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 = 206; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2); __pyx_1 = 0; @@ -1155,37 +1182,13 @@ unsigned int __pyx_5; PyObject *__pyx_6 = 0; static char *__pyx_argnames[] = {"b",0}; - __pyx_v_b = __pyx_k4; - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_b))) return -1; + 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 = 210; goto __pyx_L1;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_5_geos_ndarray, 1, "b"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;} - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":218 - * - * # just return an empty class - * if b is None: # <<<<<<<<<<<<<< - * return - * - */ - __pyx_1 = (((PyObject *)__pyx_v_b) == Py_None); - if (__pyx_1) { - - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":219 - * # just return an empty class - * if b is None: - * return # <<<<<<<<<<<<<< - * + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":217 * # make sure data is contiguous. - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L2; - } - __pyx_L2:; - - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":223 - * # make sure data is contiguous. * # if not, make a local copy. * if not PyArray_ISCONTIGUOUS(b): # <<<<<<<<<<<<<< * b = b.copy() @@ -1194,96 +1197,96 @@ __pyx_1 = (!PyArray_ISCONTIGUOUS(__pyx_v_b)); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":224 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":218 * # if not, make a local copy. * if not PyArray_ISCONTIGUOUS(b): * b = b.copy() # <<<<<<<<<<<<<< * * m = b.shape[0] */ - __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_b), __pyx_n_copy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;} - __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_b), __pyx_n_copy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; 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 = 224; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_5_geos_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_b)); __pyx_v_b = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; - goto __pyx_L3; + goto __pyx_L2; } - __pyx_L3:; + __pyx_L2:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":226 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":220 * 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 = 226; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_b), __pyx_n_shape); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; 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 = 226; goto __pyx_L1;} - __pyx_4 = PyObject_GetItem(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} + __pyx_4 = PyObject_GetItem(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; 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 = 226; goto __pyx_L1;} + __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_v_m = __pyx_5; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":229 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":223 * * # 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 = 229; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; 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 = 229; goto __pyx_L1;} + __pyx_4 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; 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 = 229; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; 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 = 229; goto __pyx_L1;} + __pyx_6 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_3); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; 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 = 229; goto __pyx_L1;} + __pyx_2 = PyObject_RichCompare(__pyx_4, __pyx_6, Py_NE); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; 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 = 229; goto __pyx_L1;} + __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; 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 = 229; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; 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 = 229; goto __pyx_L1;} + __pyx_4 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; 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 = 229; goto __pyx_L1;} + __pyx_6 = PyTuple_New(2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; 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 = 229; goto __pyx_L1;} + __pyx_3 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_6); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; 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 = 229; goto __pyx_L1;} + __pyx_2 = PyObject_RichCompare(__pyx_4, __pyx_3, Py_NE); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; 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_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":230 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":224 * # Add closing coordinates to sequence? * if b[-1,0] != b[0,0] or b[-1,1] != b[0,1]: * M = m + 1 # <<<<<<<<<<<<<< @@ -1291,11 +1294,11 @@ * M = m */ __pyx_v_M = (__pyx_v_m + 1); - goto __pyx_L4; + goto __pyx_L3; } /*else*/ { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":232 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":226 * M = m + 1 * else: * M = m # <<<<<<<<<<<<<< @@ -1304,9 +1307,9 @@ */ __pyx_v_M = __pyx_v_m; } - __pyx_L4:; + __pyx_L3:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":233 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":227 * else: * M = m * self._npts = M # <<<<<<<<<<<<<< @@ -1315,7 +1318,7 @@ */ ((struct __pyx_obj_5_geos_Polygon *)__pyx_v_self)->__pyx_base._npts = __pyx_v_M; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":236 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":230 * * # Create a coordinate sequence * cs = GEOSCoordSeq_create(M, 2) # <<<<<<<<<<<<<< @@ -1324,7 +1327,7 @@ */ __pyx_v_cs = GEOSCoordSeq_create(__pyx_v_M,2); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":239 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":233 * * # add to coordinate sequence * bbuffer = <double *>b.data # <<<<<<<<<<<<<< @@ -1333,7 +1336,7 @@ */ __pyx_v_bbuffer = ((double (*))__pyx_v_b->data); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":240 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":234 * # add to coordinate sequence * bbuffer = <double *>b.data * for i from 0 <= i < m: # <<<<<<<<<<<<<< @@ -1342,7 +1345,7 @@ */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_m; __pyx_v_i++) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":241 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":235 * bbuffer = <double *>b.data * for i from 0 <= i < m: * dx = bbuffer[2*i] # <<<<<<<<<<<<<< @@ -1351,7 +1354,7 @@ */ __pyx_v_dx = (__pyx_v_bbuffer[(2 * __pyx_v_i)]); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":242 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":236 * for i from 0 <= i < m: * dx = bbuffer[2*i] * dy = bbuffer[2*i+1] # <<<<<<<<<<<<<< @@ -1360,7 +1363,7 @@ */ __pyx_v_dy = (__pyx_v_bbuffer[((2 * __pyx_v_i) + 1)]); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":245 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":239 * # Because of a bug in the GEOS C API, * # always set X before Y * GEOSCoordSeq_setX(cs, i, dx) # <<<<<<<<<<<<<< @@ -1369,7 +1372,7 @@ */ GEOSCoordSeq_setX(__pyx_v_cs,__pyx_v_i,__pyx_v_dx); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":246 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":240 * # always set X before Y * GEOSCoordSeq_setX(cs, i, dx) * GEOSCoordSeq_setY(cs, i, dy) # <<<<<<<<<<<<<< @@ -1379,7 +1382,7 @@ GEOSCoordSeq_setY(__pyx_v_cs,__pyx_v_i,__pyx_v_dy); } - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":249 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":243 * * # Add closing coordinates to sequence? * if M > m: # <<<<<<<<<<<<<< @@ -1389,7 +1392,7 @@ __pyx_1 = (__pyx_v_M > __pyx_v_m); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":250 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":244 * # Add closing coordinates to sequence? * if M > m: * dx = bbuffer[0] # <<<<<<<<<<<<<< @@ -1398,7 +1401,7 @@ */ __pyx_v_dx = (__pyx_v_bbuffer[0]); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":251 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":245 * if M > m: * dx = bbuffer[0] * dy = bbuffer[1] # <<<<<<<<<<<<<< @@ -1407,7 +1410,7 @@ */ __pyx_v_dy = (__pyx_v_bbuffer[1]); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":252 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":246 * dx = bbuffer[0] * dy = bbuffer[1] * GEOSCoordSeq_setX(cs, M-1, dx) # <<<<<<<<<<<<<< @@ -1416,7 +1419,7 @@ */ GEOSCoordSeq_setX(__pyx_v_cs,(__pyx_v_M - 1),__pyx_v_dx); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":253 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":247 * dy = bbuffer[1] * GEOSCoordSeq_setX(cs, M-1, dx) * GEOSCoordSeq_setY(cs, M-1, dy) # <<<<<<<<<<<<<< @@ -1424,11 +1427,11 @@ * # create LinearRing */ GEOSCoordSeq_setY(__pyx_v_cs,(__pyx_v_M - 1),__pyx_v_dy); - goto __pyx_L7; + goto __pyx_L6; } - __pyx_L7:; + __pyx_L6:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":256 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":250 * * # create LinearRing * lr = GEOSGeom_createLinearRing(cs) # <<<<<<<<<<<<<< @@ -1437,7 +1440,7 @@ */ __pyx_v_lr = GEOSGeom_createLinearRing(__pyx_v_cs); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":259 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":253 * * # create Polygon from LinearRing (assuming no holes) * self._geom = GEOSGeom_createPolygon(lr,NULL,0) # <<<<<<<<<<<<<< @@ -1446,7 +1449,7 @@ */ ((struct __pyx_obj_5_geos_Polygon *)__pyx_v_self)->__pyx_base._geom = GEOSGeom_createPolygon(__pyx_v_lr,NULL,0); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":260 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":254 * # create Polygon from LinearRing (assuming no holes) * self._geom = GEOSGeom_createPolygon(lr,NULL,0) * self.boundary = b # <<<<<<<<<<<<<< @@ -1479,7 +1482,7 @@ PyObject *__pyx_1 = 0; Py_INCREF((PyObject *)__pyx_v_self); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":265 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":259 * def area(self): * cdef double area * GEOSArea(self._geom, &area) # <<<<<<<<<<<<<< @@ -1488,14 +1491,14 @@ */ GEOSArea(((struct __pyx_obj_5_geos_Polygon *)__pyx_v_self)->__pyx_base._geom,(&__pyx_v_area)); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":266 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":260 * cdef double area * GEOSArea(self._geom, &area) * return area # <<<<<<<<<<<<<< * * cdef _add_geom(BaseGeometry p, GEOSGeom *geom): */ - __pyx_1 = PyFloat_FromDouble(__pyx_v_area); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; goto __pyx_L1;} + __pyx_1 = PyFloat_FromDouble(__pyx_v_area); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -1519,7 +1522,7 @@ int __pyx_1; Py_INCREF(__pyx_v_p); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":272 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":266 * cdef GEOSGeom *lr * cdef unsigned int M * if GEOSGeomTypeId(geom) == GEOS_POLYGON: # <<<<<<<<<<<<<< @@ -1529,7 +1532,7 @@ __pyx_1 = (GEOSGeomTypeId(__pyx_v_geom) == GEOS_POLYGON); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":273 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":267 * cdef unsigned int M * if GEOSGeomTypeId(geom) == GEOS_POLYGON: * lr = GEOSGetExteriorRing(geom) # <<<<<<<<<<<<<< @@ -1538,7 +1541,7 @@ */ __pyx_v_lr = GEOSGetExteriorRing(__pyx_v_geom); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":274 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":268 * if GEOSGeomTypeId(geom) == GEOS_POLYGON: * lr = GEOSGetExteriorRing(geom) * cs = GEOSGeom_getCoordSeq(lr) # <<<<<<<<<<<<<< @@ -1550,7 +1553,7 @@ } /*else*/ { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":276 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":270 * cs = GEOSGeom_getCoordSeq(lr) * else: * cs = GEOSGeom_getCoordSeq(geom) # <<<<<<<<<<<<<< @@ -1561,7 +1564,7 @@ } __pyx_L2:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":277 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":271 * else: * cs = GEOSGeom_getCoordSeq(geom) * GEOSCoordSeq_getSize(cs, &M) # <<<<<<<<<<<<<< @@ -1570,7 +1573,7 @@ */ GEOSCoordSeq_getSize(__pyx_v_cs,(&__pyx_v_M)); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":278 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":272 * cs = GEOSGeom_getCoordSeq(geom) * GEOSCoordSeq_getSize(cs, &M) * p._geom = geom # <<<<<<<<<<<<<< @@ -1579,7 +1582,7 @@ */ __pyx_v_p->_geom = __pyx_v_geom; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":279 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":273 * GEOSCoordSeq_getSize(cs, &M) * p._geom = geom * p._npts = M # <<<<<<<<<<<<<< @@ -1588,7 +1591,7 @@ */ __pyx_v_p->_npts = __pyx_v_M; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":280 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":274 * p._geom = geom * p._npts = M * return p # <<<<<<<<<<<<<< @@ -1627,7 +1630,7 @@ PyObject *__pyx_5 = 0; __pyx_v_b = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":289 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":283 * cdef ndarray b * cdef double *bbuffer * if GEOSGeomTypeId(geom) == GEOS_POLYGON: # <<<<<<<<<<<<<< @@ -1637,7 +1640,7 @@ __pyx_1 = (GEOSGeomTypeId(__pyx_v_geom) == GEOS_POLYGON); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":290 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":284 * cdef double *bbuffer * if GEOSGeomTypeId(geom) == GEOS_POLYGON: * lr = GEOSGetExteriorRing(geom) # <<<<<<<<<<<<<< @@ -1646,7 +1649,7 @@ */ __pyx_v_lr = GEOSGetExteriorRing(__pyx_v_geom); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":291 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":285 * if GEOSGeomTypeId(geom) == GEOS_POLYGON: * lr = GEOSGetExteriorRing(geom) * cs = GEOSGeom_getCoordSeq(lr) # <<<<<<<<<<<<<< @@ -1658,7 +1661,7 @@ } /*else*/ { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":293 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":287 * cs = GEOSGeom_getCoordSeq(lr) * else: * cs = GEOSGeom_getCoordSeq(geom) # <<<<<<<<<<<<<< @@ -1669,7 +1672,7 @@ } __pyx_L2:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":294 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":288 * else: * cs = GEOSGeom_getCoordSeq(geom) * GEOSCoordSeq_getSize(cs, &M) # <<<<<<<<<<<<<< @@ -1678,39 +1681,39 @@ */ GEOSCoordSeq_getSize(__pyx_v_cs,(&__pyx_v_M)); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":295 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":289 * cs = GEOSGeom_getCoordSeq(geom) * GEOSCoordSeq_getSize(cs, &M) * b = numpy.empty((M,2), numpy.float64) # <<<<<<<<<<<<<< * bbuffer = <double *>b.data * for i from 0 <= i < M: */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyLong_FromUnsignedLong(__pyx_v_M); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;} + __pyx_2 = PyLong_FromUnsignedLong(__pyx_v_M); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); Py_INCREF(__pyx_num_2); PyTuple_SET_ITEM(__pyx_4, 1, __pyx_num_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); PyTuple_SET_ITEM(__pyx_2, 1, __pyx_5); __pyx_4 = 0; __pyx_5 = 0; - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_5_geos_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_5_geos_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_b)); __pyx_v_b = ((PyArrayObject *)__pyx_4); __pyx_4 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":296 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":290 * GEOSCoordSeq_getSize(cs, &M) * b = numpy.empty((M,2), numpy.float64) * bbuffer = <doub... [truncated message content] |
From: <js...@us...> - 2007-11-13 22:26:06
|
Revision: 4258 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4258&view=rev Author: jswhit Date: 2007-11-13 14:26:02 -0800 (Tue, 13 Nov 2007) Log Message: ----------- update Requirements Modified Paths: -------------- trunk/toolkits/basemap-testing/README Modified: trunk/toolkits/basemap-testing/README =================================================================== --- trunk/toolkits/basemap-testing/README 2007-11-13 22:23:33 UTC (rev 4257) +++ trunk/toolkits/basemap-testing/README 2007-11-13 22:26:02 UTC (rev 4258) @@ -5,8 +5,6 @@ **Requirements** -python 2.4 or higher. - matplotlib 0.90 (or higher) numpy 1.0 (or higher) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-13 22:23:35
|
Revision: 4257 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4257&view=rev Author: jswhit Date: 2007-11-13 14:23:33 -0800 (Tue, 13 Nov 2007) Log Message: ----------- fixes so Basemap instance can be pickled again Modified Paths: -------------- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py trunk/toolkits/basemap-testing/setup.py Added Paths: ----------- trunk/toolkits/basemap-testing/src/_geos.c trunk/toolkits/basemap-testing/src/_geos.pyx Removed Paths: ------------- trunk/toolkits/basemap-testing/src/geos.c trunk/toolkits/basemap-testing/src/geos.pyx Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py =================================================================== --- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-13 21:29:33 UTC (rev 4256) +++ trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-13 22:23:33 UTC (rev 4257) @@ -14,9 +14,7 @@ from numpy import linspace, squeeze, ma from matplotlib.cbook import popd, is_scalar from shapelib import ShapeFile -from geos import Polygon as PolygonShape -from geos import LineString as LineShape -from geos import Point as PointShape +import _geos # basemap data files now installed in lib/matplotlib/toolkits/basemap/data basemap_datadir = os.sep.join([os.path.dirname(__file__), 'data']) @@ -31,7 +29,7 @@ transverse mercator, miller cylindrical, lambert conformal conic, azimuthal equidistant, equidistant conic, lambert azimuthal equal area, albers equal area conic, gnomonic, orthographic, sinusoidal, mollweide, - geostationary, robinson, cassini-soldner or stereographic). + _geostationary, robinson, cassini-soldner or stereographic). Doesn't actually draw anything, but sets up the map projection class and creates the coastline, lake river and political boundary data structures in native map projection coordinates. @@ -42,7 +40,7 @@ projection - map projection ('cyl','merc','mill','lcc','eqdc','aea', 'laea', 'nplaea', 'splaea', 'tmerc', 'omerc', 'cass', 'gnom', 'poly', 'sinu', 'moll', 'ortho', 'robin', 'aeqd', 'npaeqd', 'spaeqd', 'stere', - 'geos', 'npstere' or 'spstere') + '_geos', 'npstere' or 'spstere') (projections prefixed with 'np' or 'sp' are special case polar-centric versions of the parent projection) aspect - map aspect ratio (size of y dimension / size of x dimension). @@ -112,7 +110,7 @@ 'cass' - cassini-soldner (transverse cylindrical equidistant), 'poly' - polyconic, 'omerc' - oblique mercator, 'ortho' - orthographic, 'sinu' - sinusoidal, 'moll' - mollweide, 'robin' - robinson, - 'geos' - geostationary, and 'gnom' - gnomonic are currently available. + '_geos' - _geostationary, and 'gnom' - gnomonic are currently available. Default is 'cyl'. The map projection region can either be specified by setting these keywords: @@ -135,9 +133,9 @@ either they are computed internally, or entire globe is always plotted). For the cylindrical projections ('cyl','merc' and 'mill'), the default is to use llcrnrlon=-180,llcrnrlat=-90, urcrnrlon=180 and urcrnrlat=90). For all other - projections except 'ortho' and 'geos', either the lat/lon values of the + projections except 'ortho' and '_geos', either the lat/lon values of the corners or width and height must be specified by the user. - For 'ortho' and 'geos', the lat/lon values of the corners may be specified, + For 'ortho' and '_geos', the lat/lon values of the corners may be specified, but if they are not, the entire globe is plotted. resolution - resolution of boundary database to use. Can be 'c' (crude), @@ -210,7 +208,7 @@ on the north or south pole. The longitude lon_0 is at 6-o'clock, and the latitude circle boundinglat is tangent to the edge of the map at lon_0. satellite_height - height of satellite (in m) above equator - - only relevant for geostationary projections ('geos'). + only relevant for _geostationary projections ('_geos'). """ @@ -504,7 +502,7 @@ # FIXME: won't work for points exactly on equator?? if npy.abs(lat_0) < 1.e-2: lat_0 = 1.e-2 projparams['lat_0'] = lat_0 - elif projection == 'geos': + elif projection == '_geos': if lon_0 is None and satellite_height is None: raise ValueError, 'must specify lon_0 and satellite_height for Geostationary basemap' if width is not None or height is not None: @@ -593,7 +591,7 @@ 'splaea' - lambert azimuthal, special case centered on south pole, 'cass' - cassini-soldner (transverse cylindrical equidistant), 'poly' - polyconic, 'omerc' - oblique mercator, 'ortho' - orthographic, - 'geos' - geostationary, 'sinu' - sinusoidal, 'moll' - mollweide, + '_geos' - _geostationary, 'sinu' - sinusoidal, 'moll' - mollweide, 'robin' - robinson, or 'gnom' - gnomonic. You tried '%s'""" % projection # initialize proj4 @@ -608,7 +606,7 @@ atts = ['rmajor','rminor','esq','flattening','ellipsoid','projparams'] for att in atts: self.__dict__[att] = proj.__dict__[att] - # these only exist for geostationary projection. + # these only exist for _geostationary projection. if hasattr(proj,'_width'): self.__dict__['_width'] = proj.__dict__['_width'] if hasattr(proj,'_height'): @@ -647,7 +645,7 @@ if projection in ['mill','cyl','merc']: self.latmin = self.llcrnrlat self.latmax = self.urcrnrlat - elif projection in ['ortho','geos','moll','robin','sinu']: + elif projection in ['ortho','_geos','moll','robin','sinu']: self.latmin = -90. self.latmax = 90. else: @@ -748,12 +746,12 @@ polygon_types = [] # coastlines are polygons, other boundaries are line segments. if name == 'gshhs': - Shape = PolygonShape + Shape = _geos.Polygon else: - Shape = LineShape + Shape = _geos.LineString # see if map projection region polygon contains a pole. - NPole = PointShape(self(0.,90.)) - SPole = PointShape(self(0.,-90.)) + NPole = _geos.Point(self(0.,90.)) + SPole = _geos.Point(self(0.,-90.)) boundarypolyxy = self._boundarypolyxy boundarypolyll = self._boundarypolyll hasNP = NPole.within(boundarypolyxy) @@ -761,7 +759,7 @@ 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 ['tmerc','cass','omerc','merc','mill','cyl','robin','moll','sinu','_geos']: raise ValueError('%s projection cannot cross pole'%(self.projection)) # make sure orthographic projection has containsPole=True @@ -777,7 +775,7 @@ b = self._boundarypolyll.get_coords() blons = b[:,0]; blats = b[:,1] b[:,0], b[:,1] = maptran(blons, blats) - boundarypolyxy = PolygonShape(b) + boundarypolyxy = _geos.Polygon(b) for line in bdatmetafile: linesplit = line.split() area = float(linesplit[1]) @@ -824,7 +822,7 @@ lats.append(-90.) b = npy.empty((len(lons),2),npy.float64) b[:,0] = lons; b[:,1] = lats - poly = PolygonShape(b) + poly = _geos.Polygon(b) antart = True else: poly = Shape(b) @@ -934,7 +932,7 @@ nx = 100 ny = 100 maptran = self - if self.projection in ['ortho','geos']: + if self.projection in ['ortho','_geos']: # circular region. thetas = linspace(0.,2.*npy.pi,2*nx*ny)[:-1] if self.projection == 'ortho': @@ -947,7 +945,7 @@ y = rminor*npy.sin(thetas) + rminor b = npy.empty((len(x),2),npy.float64) b[:,0]=x; b[:,1]=y - boundaryxy = PolygonShape(b) + boundaryxy = _geos.Polygon(b) # compute proj instance for full disk, if necessary. if not self._fulldisk: projparms = self.projparams @@ -986,7 +984,7 @@ x, y = maptran(lons,lats) b = npy.empty((len(x),2),npy.float64) b[:,0]=x; b[:,1]=y - boundaryxy = PolygonShape(b) + boundaryxy = _geos.Polygon(b) else: # all other projections are rectangular. # left side (x = xmin, ymin <= y <= ymax) yy = linspace(self.ymin, self.ymax, ny)[:-1] @@ -1007,7 +1005,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 = PolygonShape(b) + boundaryxy = _geos.Polygon(b) if self.projection in ['mill','merc','cyl']: # make sure map boundary doesn't quite include pole. if self.urcrnrlat > 89.9999: @@ -1023,7 +1021,7 @@ x, y = self(lons, lats) b = npy.empty((len(x),2),npy.float64) b[:,0]=x; b[:,1]=y - boundaryxy = PolygonShape(b) + boundaryxy = _geos.Polygon(b) else: if self.projection not in ['moll','robin','sinu']: lons, lats = maptran(x,y,inverse=True) @@ -1041,7 +1039,7 @@ n = n + 1 b = npy.empty((len(lons),2),npy.float64) b[:,0]=lons; b[:,1]=lats - boundaryll = PolygonShape(b) + boundaryll = _geos.Polygon(b) return boundaryll, boundaryxy @@ -1067,7 +1065,7 @@ circle.set_edgecolor(color) circle.set_linewidth(linewidth) circle.set_clip_on(False) - elif self.projection == 'geos' and self._fulldisk: # elliptical region + elif self.projection == '_geos' and self._fulldisk: # elliptical region # define an Ellipse patch, add it to axes instance. ellps = Ellipse((self._width,self._height),2.*self._width,2.*self._height) ax.add_patch(ellps) @@ -1509,8 +1507,8 @@ l.set_zorder(zorder) ax.add_line(l) # draw labels for parallels - # parallels not labelled for fulldisk orthographic or geostationary - if self.projection in ['ortho','geos'] and max(labels): + # parallels not labelled for fulldisk orthographic or _geostationary + if self.projection in ['ortho','_geos'] and max(labels): if self._fulldisk: print 'Warning: Cannot label parallels on full-disk Orthographic or Geostationary basemap' labels = [0,0,0,0] @@ -1716,11 +1714,11 @@ ax.add_line(l) # draw labels for meridians. # meridians not labelled for sinusoidal, mollweide, or - # or full-disk orthographic/geostationary. + # or full-disk orthographic/_geostationary. if self.projection in ['sinu','moll'] and max(labels): print 'Warning: Cannot label meridians on Sinusoidal or Mollweide basemap' labels = [0,0,0,0] - if self.projection in ['ortho','geos'] and max(labels): + if self.projection in ['ortho','_geos'] and max(labels): if self._fulldisk: print 'Warning: Cannot label meridians on full-disk Geostationary or Orthographic basemap' labels = [0,0,0,0] @@ -2074,7 +2072,7 @@ # turn off axes frame for non-rectangular projections. if self.projection in ['moll','robin','sinu']: ax.set_frame_on(False) - if self.projection in ['ortho','geos'] and self._fulldisk: + if self.projection in ['ortho','_geos'] and self._fulldisk: ax.set_frame_on(False) # make sure aspect ratio of map preserved. # plot is re-centered in bounding rectangle. Modified: trunk/toolkits/basemap-testing/setup.py =================================================================== --- trunk/toolkits/basemap-testing/setup.py 2007-11-13 21:29:33 UTC (rev 4256) +++ trunk/toolkits/basemap-testing/setup.py 2007-11-13 22:23:33 UTC (rev 4257) @@ -37,16 +37,19 @@ geos_include_dirs=[os.path.join(GEOS_dir,'include'),numpy.get_include()] geos_library_dirs=[os.path.join(GEOS_dir,'lib')] +# proj4 and geos extensions. 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','_geos.c')) packages = ['matplotlib.toolkits.basemap'] package_dirs = {'':'lib'} extensions = [Extension("matplotlib.toolkits.basemap._proj",deps+['src/_proj.c'],include_dirs = ['src'],)] extensions.append(Extension("matplotlib.toolkits.basemap._geod",deps+['src/_geod.c'],include_dirs = ['src'],)) -extensions.append(Extension("matplotlib.toolkits.basemap.geos",deps+['src/geos.c'],library_dirs=geos_library_dirs,include_dirs=geos_include_dirs,runtime_library_dirs=geos_library_dirs,libraries=['geos_c'])) +# for some reason, pickling won't work if this extension is installed +# as "matplotlib.toolkits.basemap._geos" +extensions.append(Extension("_geos",deps+['src/_geos.c'],library_dirs=geos_library_dirs,include_dirs=geos_include_dirs,runtime_library_dirs=geos_library_dirs,libraries=['geos_c'])) # install shapelib and dbflib. packages = packages + ['shapelib','dbflib'] Added: trunk/toolkits/basemap-testing/src/_geos.c =================================================================== --- trunk/toolkits/basemap-testing/src/_geos.c (rev 0) +++ trunk/toolkits/basemap-testing/src/_geos.c 2007-11-13 22:23:33 UTC (rev 4257) @@ -0,0 +1,3230 @@ +/* Generated by Cython 0.9.6.7 on Tue Nov 13 15:19:22 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 +#ifdef __cplusplus +#define __PYX_EXTERN_C extern "C" +#else +#define __PYX_EXTERN_C extern +#endif +__PYX_EXTERN_C double pow(double, double); +#include "numpy/arrayobject.h" +#include "geos_c.h" + + +#ifdef __GNUC__ +#define INLINE __inline__ +#elif _WIN32 +#define INLINE __inline +#else +#define INLINE +#endif + +typedef struct {const char *s; const void **p;} __Pyx_CApiTabEntry; /*proto*/ +typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/ +typedef struct {PyObject **p; char *s; long n; int is_unicode;} __Pyx_StringTabEntry; /*proto*/ + +#define __pyx_PyIndex_AsSsize_t(b) PyInt_AsSsize_t(PyNumber_Index(b)) + +#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); +} + + +#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_GetExcValue(void); /*proto*/ + +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ + +static void __Pyx_WriteUnraisable(char *name); /*proto*/ + +static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*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 void __Pyx_AddTraceback(char *funcname); /*proto*/ + +/* 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 PyArrayObject *__pyx_k4; +static PyArrayObject *__pyx_k5; +static PyObject *__pyx_k6; +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__add_geom(struct __pyx_obj_5_geos_BaseGeometry *,GEOSGeom (*))); /*proto*/ +static PyObject *(__pyx_f_5_geos__get_coords(GEOSGeom (*))); /*proto*/ + + +/* Implementation of _geos */ + +static char (__pyx_k3[]) = "0.1"; + +static PyObject *__pyx_n_sys; +static PyObject *__pyx_n_numpy; +static PyObject *__pyx_n___version__; +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_k3p; + +static PyObject *__pyx_n_stdout; +static PyObject *__pyx_n_write; + +static PyObject *__pyx_k7p; + +static char (__pyx_k7[]) = "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); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":100 + * + * 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 = 100; goto __pyx_L1;} + Py_DECREF(__pyx_v_format); + __pyx_v_format = __pyx_1; + __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":101 + * 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 = 101; goto __pyx_L1;} + Py_DECREF(__pyx_v_message); + __pyx_v_message = __pyx_1; + __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":102 + * format = PyString_FromString(fmt) + * message = PyString_FromString(msg) + * try: # <<<<<<<<<<<<<< + * warn_msg = format % message + * except: + */ + /*try:*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":103 + * message = PyString_FromString(msg) + * try: + * warn_msg = format % message # <<<<<<<<<<<<<< + * except: + * warn_msg = format + */ + __pyx_1 = PyNumber_Remainder(__pyx_v_format, __pyx_v_message); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; 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; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":104 + * try: + * warn_msg = format % message + * except: # <<<<<<<<<<<<<< + * warn_msg = format + * sys.stdout.write('GEOS_NOTICE: %s\n' % warn_msg) + */ + /*except:*/ { + __Pyx_AddTraceback("_geos.notice_h"); + __pyx_1 = __Pyx_GetExcValue(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":105 + * warn_msg = format % message + * except: + * warn_msg = format # <<<<<<<<<<<<<< + * sys.stdout.write('GEOS_NOTICE: %s\n' % warn_msg) + * + */ + Py_INCREF(__pyx_v_format); + Py_DECREF(__pyx_v_warn_msg); + __pyx_v_warn_msg = __pyx_v_format; + goto __pyx_L3; + } + __pyx_L3:; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":106 + * 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 = 106; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_stdout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_write); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyNumber_Remainder(__pyx_k7p, __pyx_v_warn_msg); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 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_k8p; + +static char (__pyx_k8[]) = "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); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":109 + * + * 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 = 109; goto __pyx_L1;} + Py_DECREF(__pyx_v_format); + __pyx_v_format = __pyx_1; + __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":110 + * 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 = 110; goto __pyx_L1;} + Py_DECREF(__pyx_v_message); + __pyx_v_message = __pyx_1; + __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":111 + * format = PyString_FromString(fmt) + * message = PyString_FromString(msg) + * try: # <<<<<<<<<<<<<< + * warn_msg = format % message + * except: + */ + /*try:*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":112 + * message = PyString_FromString(msg) + * try: + * warn_msg = format % message # <<<<<<<<<<<<<< + * except: + * warn_msg = format + */ + __pyx_1 = PyNumber_Remainder(__pyx_v_format, __pyx_v_message); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; 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; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":113 + * try: + * warn_msg = format % message + * except: # <<<<<<<<<<<<<< + * warn_msg = format + * sys.stderr.write('GEOS_ERROR: %s\n' % warn_msg) + */ + /*except:*/ { + __Pyx_AddTraceback("_geos.error_h"); + __pyx_1 = __Pyx_GetExcValue(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":114 + * warn_msg = format % message + * except: + * warn_msg = format # <<<<<<<<<<<<<< + * sys.stderr.write('GEOS_ERROR: %s\n' % warn_msg) + * + */ + Py_INCREF(__pyx_v_format); + Py_DECREF(__pyx_v_warn_msg); + __pyx_v_warn_msg = __pyx_v_format; + goto __pyx_L3; + } + __pyx_L3:; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":115 + * except: + * warn_msg = format + * sys.stderr.write('GEOS_ERROR: %s\n' % warn_msg) # <<<<<<<<<<<<<< + * + * # intialize GEOS (parameters are notice and error function callbacks). + */ + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_stderr); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_write); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyNumber_Remainder(__pyx_k8p, __pyx_v_warn_msg); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 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_py_5_geos_12BaseGeometry_is_valid(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static PyObject *__pyx_f_py_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); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":127 + * 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); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":128 + * cdef char valid + * valid = GEOSisValid(self._geom) + * if valid: # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_1 = __pyx_v_valid; + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":129 + * valid = GEOSisValid(self._geom) + * if valid: + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + Py_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + goto __pyx_L2; + } + /*else*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":131 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * def geom_type(self): + */ + 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_f_py_5_geos_12BaseGeometry_geom_type(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static PyObject *__pyx_f_py_5_geos_12BaseGeometry_geom_type(PyObject *__pyx_v_self, PyObject *unused) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":134 + * + * def geom_type(self): + * return PyString_FromString(GEOSGeomType(self._geom)) # <<<<<<<<<<<<<< + * + * def within(self, BaseGeometry geom): + */ + __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 = 134; 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 = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_py_5_geos_12BaseGeometry_within(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/ +static PyObject *__pyx_f_py_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 = 136; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":139 + * 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; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":140 + * 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; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":141 + * g1 = self._geom + * g2 = geom._geom + * answer = GEOSWithin(g1, g2) # <<<<<<<<<<<<<< + * if answer: + * return True + */ + __pyx_v_answer = GEOSWithin(__pyx_v_g1,__pyx_v_g2); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":142 + * g2 = geom._geom + * answer = GEOSWithin(g1, g2) + * if answer: # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_1 = __pyx_v_answer; + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":143 + * answer = GEOSWithin(g1, g2) + * if answer: + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + Py_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + goto __pyx_L2; + } + /*else*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":145 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * def intersects(self, BaseGeometry geom): + */ + 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 = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_geom); + return __pyx_r; +} + +static PyObject *__pyx_f_py_5_geos_12BaseGeometry_intersects(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/ +static PyObject *__pyx_f_py_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 = 147; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":150 + * 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; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":151 + * 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; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":152 + * g1 = self._geom + * g2 = geom._geom + * answer = GEOSIntersects(g1, g2) # <<<<<<<<<<<<<< + * if answer: + * return True + */ + __pyx_v_answer = GEOSIntersects(__pyx_v_g1,__pyx_v_g2); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":153 + * g2 = geom._geom + * answer = GEOSIntersects(g1, g2) + * if answer: # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_1 = __pyx_v_answer; + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":154 + * answer = GEOSIntersects(g1, g2) + * if answer: + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + Py_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + goto __pyx_L2; + } + /*else*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":156 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * def intersection(self, BaseGeometry geom): + */ + 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 = 0; + __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_k9p; + +static PyObject *__pyx_builtin_NotImplementedError; + +static char (__pyx_k9[]) = "intersections of type '%s' not yet implemented"; + +static PyObject *__pyx_f_py_5_geos_12BaseGeometry_intersection(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/ +static PyObject *__pyx_f_py_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_p; + PyObject *__pyx_v_pout; + 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_p = Py_None; Py_INCREF(Py_None); + __pyx_v_pout = 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 = 158; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":162 + * 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; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":163 + * 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; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":164 + * 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); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":165 + * g2 = geom._geom + * g3 = GEOSIntersection(g1, g2) + * typeid = GEOSGeomTypeId(g3) # <<<<<<<<<<<<<< + * if typeid == GEOS_POLYGON: + * p = Polygon() # create an empty Polygon instance + */ + __pyx_v_typeid = GEOSGeomTypeId(__pyx_v_g3); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":166 + * g3 = GEOSIntersection(g1, g2) + * typeid = GEOSGeomTypeId(g3) + * if typeid == GEOS_POLYGON: # <<<<<<<<<<<<<< + * p = Polygon() # create an empty Polygon instance + * p = _add_geom(p,g3) # add geometry to it. + */ + __pyx_1 = (__pyx_v_typeid == GEOS_POLYGON); + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":167 + * typeid = GEOSGeomTypeId(g3) + * if typeid == GEOS_POLYGON: + * p = Polygon() # create an empty Polygon instance # <<<<<<<<<<<<<< + * p = _add_geom(p,g3) # add geometry to it. + * # above should be faster than this .. + */ + __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_Polygon), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":168 + * if typeid == GEOS_POLYGON: + * p = Polygon() # create an empty Polygon instance + * p = _add_geom(p,g3) # add geometry to it. # <<<<<<<<<<<<<< + * # above should be faster than this .. + * #b = _get_coords(g3) + */ + if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_5_geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; goto __pyx_L1;} + __pyx_2 = __pyx_f_5_geos__add_geom(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_p),__pyx_v_g3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":172 + * #b = _get_coords(g3) + * #p = Polygon(b) + * pout = [p] # return a list with a single element # <<<<<<<<<<<<<< + * elif typeid == GEOS_LINESTRING: + * p = LineString() # create an empty LineString instance + */ + __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; 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) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":174 + * pout = [p] # return a list with a single element + * elif typeid == GEOS_LINESTRING: + * p = LineString() # create an empty LineString instance # <<<<<<<<<<<<<< + * p = _add_geom(p,g3) # add geometry to it. + * return [p] + */ + __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_LineString), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":175 + * elif typeid == GEOS_LINESTRING: + * p = LineString() # create an empty LineString instance + * p = _add_geom(p,g3) # add geometry to it. # <<<<<<<<<<<<<< + * return [p] + * elif typeid == GEOS_MULTIPOLYGON: + */ + if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_5_geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} + __pyx_2 = __pyx_f_5_geos__add_geom(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_p),__pyx_v_g3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":176 + * p = LineString() # create an empty LineString instance + * p = _add_geom(p,g3) # add geometry to it. + * return [p] # <<<<<<<<<<<<<< + * elif typeid == GEOS_MULTIPOLYGON: + * numgeoms = GEOSGetNumGeometries(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); + __pyx_r = __pyx_2; + __pyx_2 = 0; + goto __pyx_L0; + goto __pyx_L2; + } + __pyx_1 = (__pyx_v_typeid == GEOS_MULTIPOLYGON); + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":178 + * return [p] + * elif typeid == GEOS_MULTIPOLYGON: + * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<< + * pout = [] + * for i from 0 <= i < numgeoms: + */ + __pyx_v_numgeoms = GEOSGetNumGeometries(__pyx_v_g3); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":179 + * elif typeid == GEOS_MULTIPOLYGON: + * numgeoms = GEOSGetNumGeometries(g3) + * pout = [] # <<<<<<<<<<<<<< + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) + */ + __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;} + Py_DECREF(__pyx_v_pout); + __pyx_v_pout = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":180 + * numgeoms = GEOSGetNumGeometries(g3) + * pout = [] + * for i from 0 <= i < numgeoms: # <<<<<<<<<<<<<< + * gout = GEOSGetGeometryN(g3, i) + * p = Polygon() # create an empty Polygon instance + */ + for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_numgeoms; __pyx_v_i++) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":181 + * pout = [] + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<< + * p = Polygon() # create an empty Polygon instance + * p = _add_geom(p,gout) # add geometry to it. + */ + __pyx_v_gout = GEOSGetGeometryN(__pyx_v_g3,__pyx_v_i); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":182 + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) + * p = Polygon() # create an empty Polygon instance # <<<<<<<<<<<<<< + * p = _add_geom(p,gout) # add geometry to it. + * pout.append(p) + */ + __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_Polygon), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":183 + * gout = GEOSGetGeometryN(g3, i) + * p = Polygon() # create an empty Polygon instance + * p = _add_geom(p,gout) # add geometry to it. # <<<<<<<<<<<<<< + * pout.append(p) + * elif typeid == GEOS_MULTILINESTRING: + */ + if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_5_geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;} + __pyx_2 = __pyx_f_5_geos__add_geom(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_p),__pyx_v_gout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":184 + * p = Polygon() # create an empty Polygon instance + * p = _add_geom(p,gout) # add geometry to it. + * pout.append(p) # <<<<<<<<<<<<<< + * elif typeid == GEOS_MULTILINESTRING: + * numgeoms = GEOSGetNumGeometries(g3) + */ + __pyx_2 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;} + Py_INCREF(__pyx_v_p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + } + goto __pyx_L2; + } + __pyx_1 = (__pyx_v_typeid == GEOS_MULTILINESTRING); + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":186 + * pout.append(p) + * elif typeid == GEOS_MULTILINESTRING: + * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<< + * pout = [] + * for i from 0 <= i < numgeoms: + */ + __pyx_v_numgeoms = GEOSGetNumGeometries(__pyx_v_g3); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":187 + * elif typeid == GEOS_MULTILINESTRING: + * numgeoms = GEOSGetNumGeometries(g3) + * pout = [] # <<<<<<<<<<<<<< + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) + */ + __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;} + Py_DECREF(__pyx_v_pout); + __pyx_v_pout = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":188 + * numgeoms = GEOSGetNumGeometries(g3) + * pout = [] + * for i from 0 <= i < numgeoms: # <<<<<<<<<<<<<< + * gout = GEOSGetGeometryN(g3, i) + * p = LineString() # create an LineString instance + */ + for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_numgeoms; __pyx_v_i++) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":189 + * pout = [] + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<< + * p = LineString() # create an LineString instance + * p = _add_geom(p,gout) # add geometry to it. + */ + __pyx_v_gout = GEOSGetGeometryN(__pyx_v_g3,__pyx_v_i); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":190 + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) + * p = LineString() # create an LineString instance # <<<<<<<<<<<<<< + * p = _add_geom(p,gout) # add geometry to it. + * pout.append(p) + */ + __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_LineString), 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_3; + __pyx_3 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":191 + * gout = GEOSGetGeometryN(g3, i) + * p = LineString() # create an LineString instance + * p = _add_geom(p,gout) # add geometry to it. # <<<<<<<<<<<<<< + * pout.append(p) + * else: + */ + if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_5_geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;} + __pyx_4 = __pyx_f_5_geos__add_geom(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_p),__pyx_v_gout); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_4; + __pyx_4 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":192 + * p = LineString() # create an LineString instance + * p = _add_geom(p,gout) # add geometry to it. + * pout.append(p) # <<<<<<<<<<<<<< + * else: + * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) + */ + __pyx_2 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} + Py_INCREF(__pyx_v_p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + } + goto __pyx_L2; + } + /*else*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":194 + * pout.append(p) + * else: + * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) # <<<<<<<<<<<<<< + * return pout + * + */ + __pyx_2 = PyNumber_Remainder(__pyx_k9p, ((PyObject*)&PyType_Type)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_4 = PyObject_CallObject(__pyx_builtin_NotImplementedError, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} + } + __pyx_L2:; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":195 + * else: + * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) + * 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 = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_p); + Py_DECREF(__pyx_v_pout); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_geom); + return __pyx_r; +} + +static PyObject *__pyx_f_py_5_geos_12BaseGeometry_get_coords(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static PyObject *__pyx_f_py_5_geos_12BaseGeometry_get_coords(PyObject *__pyx_v_self, PyObject *unused) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":198 + * + * def get_coords(self): + * return _get_coords(self._geom) # <<<<<<<<<<<<<< + * + * def __dealloc__(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 = 198; 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 = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static void __pyx_f_py_5_geos_12BaseGeometry___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_5_geos_12BaseGeometry___dealloc__[] = "destroy GEOS geometry"; +static void __pyx_f_py_5_geos_12BaseGeometry___dealloc__(PyObject *__pyx_v_self) { + Py_INCREF(__pyx_v_self); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":202 + * def __dealloc__(self): + * """destroy GEOS geometry""" + * GEOSGeom_destroy(self._geom) # <<<<<<<<<<<<<< + * + * def __reduce__(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_f_py_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_f_py_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); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":206 + * def __reduce__(self): + * """special method that allows geos instance to be pickled""" + * return (self.__class__,(self.boundary,)) # <<<<<<<<<<<<<< + * + * cdef class Polygon(BaseGeometry): + */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___class__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; 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 = 206; 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 = 0; + __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_f_py_5_geos_7Polygon___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_f_py_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}; + __pyx_v_b = __pyx_k4; + 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 = 210; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":218 + * + * # just return an empty class + * if b is None: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_1 = (((PyObject *)__pyx_v_b) == Py_None); + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":219 + * # just return an empty class + * if b is None: + * return # <<<<<<<<<<<<<< + * + * # make sure data is contiguous. + */ + __pyx_r = 0; + goto __pyx_L0; + goto __pyx_L2; + } + __pyx_L2:; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":223 + * # 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) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":224 + * # if not, make a local copy. + * if not PyArray_ISCONTIGUOUS(b): + * b = b.copy() # <<<<<<<<<<<<<< ... [truncated message content] |
From: <js...@us...> - 2007-11-13 21:29:35
|
Revision: 4256 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4256&view=rev Author: jswhit Date: 2007-11-13 13:29:33 -0800 (Tue, 13 Nov 2007) Log Message: ----------- plug memory leaks Modified Paths: -------------- trunk/toolkits/basemap-testing/src/geos.c trunk/toolkits/basemap-testing/src/geos.pyx Modified: trunk/toolkits/basemap-testing/src/geos.c =================================================================== --- trunk/toolkits/basemap-testing/src/geos.c 2007-11-13 21:13:04 UTC (rev 4255) +++ trunk/toolkits/basemap-testing/src/geos.c 2007-11-13 21:29:33 UTC (rev 4256) @@ -1,4 +1,4 @@ -/* Generated by Cython 0.9.6.7 on Tue Nov 13 13:39:59 2007 */ +/* Generated by Cython 0.9.6.7 on Tue Nov 13 14:28:16 2007 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -142,6 +142,8 @@ 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; @@ -165,31 +167,31 @@ __pyx_v_message = Py_None; Py_INCREF(Py_None); __pyx_v_warn_msg = Py_None; Py_INCREF(Py_None); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":99 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":100 * * 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 = 99; goto __pyx_L1;} + __pyx_1 = PyString_FromString(__pyx_v_fmt); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; goto __pyx_L1;} Py_DECREF(__pyx_v_format); __pyx_v_format = __pyx_1; __pyx_1 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":100 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":101 * 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 = 100; goto __pyx_L1;} + __pyx_1 = PyString_FromString(__pyx_v_msg); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; goto __pyx_L1;} Py_DECREF(__pyx_v_message); __pyx_v_message = __pyx_1; __pyx_1 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":101 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":102 * format = PyString_FromString(fmt) * message = PyString_FromString(msg) * try: # <<<<<<<<<<<<<< @@ -198,14 +200,14 @@ */ /*try:*/ { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":102 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":103 * message = PyString_FromString(msg) * try: * warn_msg = format % message # <<<<<<<<<<<<<< * except: * warn_msg = format */ - __pyx_1 = PyNumber_Remainder(__pyx_v_format, __pyx_v_message); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L2;} + __pyx_1 = PyNumber_Remainder(__pyx_v_format, __pyx_v_message); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; goto __pyx_L2;} Py_DECREF(__pyx_v_warn_msg); __pyx_v_warn_msg = __pyx_1; __pyx_1 = 0; @@ -214,7 +216,7 @@ __pyx_L2:; Py_XDECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":103 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":104 * try: * warn_msg = format % message * except: # <<<<<<<<<<<<<< @@ -223,10 +225,10 @@ */ /*except:*/ { __Pyx_AddTraceback("geos.notice_h"); - __pyx_1 = __Pyx_GetExcValue(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; goto __pyx_L1;} + __pyx_1 = __Pyx_GetExcValue(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":104 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":105 * warn_msg = format % message * except: * warn_msg = format # <<<<<<<<<<<<<< @@ -240,23 +242,23 @@ } __pyx_L3:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":105 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":106 * 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 = 105; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_stdout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_stdout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_write); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_write); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyNumber_Remainder(__pyx_k7p, __pyx_v_warn_msg); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} + __pyx_2 = PyNumber_Remainder(__pyx_k7p, __pyx_v_warn_msg); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -290,31 +292,31 @@ __pyx_v_message = Py_None; Py_INCREF(Py_None); __pyx_v_warn_msg = Py_None; Py_INCREF(Py_None); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":108 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":109 * * 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 = 108; goto __pyx_L1;} + __pyx_1 = PyString_FromString(__pyx_v_fmt); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; goto __pyx_L1;} Py_DECREF(__pyx_v_format); __pyx_v_format = __pyx_1; __pyx_1 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":109 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":110 * 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 = 109; goto __pyx_L1;} + __pyx_1 = PyString_FromString(__pyx_v_msg); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; goto __pyx_L1;} Py_DECREF(__pyx_v_message); __pyx_v_message = __pyx_1; __pyx_1 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":110 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":111 * format = PyString_FromString(fmt) * message = PyString_FromString(msg) * try: # <<<<<<<<<<<<<< @@ -323,14 +325,14 @@ */ /*try:*/ { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":111 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":112 * message = PyString_FromString(msg) * try: * warn_msg = format % message # <<<<<<<<<<<<<< * except: * warn_msg = format */ - __pyx_1 = PyNumber_Remainder(__pyx_v_format, __pyx_v_message); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; goto __pyx_L2;} + __pyx_1 = PyNumber_Remainder(__pyx_v_format, __pyx_v_message); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L2;} Py_DECREF(__pyx_v_warn_msg); __pyx_v_warn_msg = __pyx_1; __pyx_1 = 0; @@ -339,7 +341,7 @@ __pyx_L2:; Py_XDECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":112 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":113 * try: * warn_msg = format % message * except: # <<<<<<<<<<<<<< @@ -348,10 +350,10 @@ */ /*except:*/ { __Pyx_AddTraceback("geos.error_h"); - __pyx_1 = __Pyx_GetExcValue(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;} + __pyx_1 = __Pyx_GetExcValue(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":113 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":114 * warn_msg = format % message * except: * warn_msg = format # <<<<<<<<<<<<<< @@ -365,23 +367,23 @@ } __pyx_L3:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":114 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":115 * except: * warn_msg = format * sys.stderr.write('GEOS_ERROR: %s\n' % warn_msg) # <<<<<<<<<<<<<< * - * # The initGEOS routine should be called first, however, that routine takes + * # intialize GEOS (parameters are notice and error function callbacks). */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_stderr); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_stderr); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_write); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_write); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyNumber_Remainder(__pyx_k8p, __pyx_v_warn_msg); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} + __pyx_2 = PyNumber_Remainder(__pyx_k8p, __pyx_v_warn_msg); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -405,7 +407,7 @@ char __pyx_1; Py_INCREF(__pyx_v_self); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":129 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":126 * def is_valid(self): * cdef char valid * valid = GEOSisValid(self._geom) # <<<<<<<<<<<<<< @@ -414,7 +416,7 @@ */ __pyx_v_valid = GEOSisValid(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_self)->_geom); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":130 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":127 * cdef char valid * valid = GEOSisValid(self._geom) * if valid: # <<<<<<<<<<<<<< @@ -424,7 +426,7 @@ __pyx_1 = __pyx_v_valid; if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":131 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":128 * valid = GEOSisValid(self._geom) * if valid: * return True # <<<<<<<<<<<<<< @@ -438,7 +440,7 @@ } /*else*/ { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":133 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":130 * return True * else: * return False # <<<<<<<<<<<<<< @@ -463,14 +465,14 @@ PyObject *__pyx_1 = 0; Py_INCREF(__pyx_v_self); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":136 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":133 * * def geom_type(self): * return PyString_FromString(GEOSGeomType(self._geom)) # <<<<<<<<<<<<<< * * def within(self, BaseGeometry geom): */ - __pyx_1 = PyString_FromString(GEOSGeomType(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_self)->_geom)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L1;} + __pyx_1 = PyString_FromString(GEOSGeomType(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_self)->_geom)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -495,9 +497,9 @@ char __pyx_1; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_geom); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_4geos_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; goto __pyx_L1;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_4geos_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; goto __pyx_L1;} - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":141 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":138 * cdef GEOSGeom *g1, *g2 * cdef char answer * g1 = self._geom # <<<<<<<<<<<<<< @@ -506,7 +508,7 @@ */ __pyx_v_g1 = ((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_self)->_geom; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":142 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":139 * cdef char answer * g1 = self._geom * g2 = geom._geom # <<<<<<<<<<<<<< @@ -515,7 +517,7 @@ */ __pyx_v_g2 = ((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_geom)->_geom; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":143 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":140 * g1 = self._geom * g2 = geom._geom * answer = GEOSWithin(g1, g2) # <<<<<<<<<<<<<< @@ -524,7 +526,7 @@ */ __pyx_v_answer = GEOSWithin(__pyx_v_g1,__pyx_v_g2); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":144 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":141 * g2 = geom._geom * answer = GEOSWithin(g1, g2) * if answer: # <<<<<<<<<<<<<< @@ -534,7 +536,7 @@ __pyx_1 = __pyx_v_answer; if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":145 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":142 * answer = GEOSWithin(g1, g2) * if answer: * return True # <<<<<<<<<<<<<< @@ -548,7 +550,7 @@ } /*else*/ { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":147 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":144 * return True * else: * return False # <<<<<<<<<<<<<< @@ -581,9 +583,9 @@ char __pyx_1; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_geom); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_4geos_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_4geos_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L1;} - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":152 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":149 * cdef GEOSGeom *g1, *g2 * cdef char answer * g1 = self._geom # <<<<<<<<<<<<<< @@ -592,7 +594,7 @@ */ __pyx_v_g1 = ((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_self)->_geom; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":153 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":150 * cdef char answer * g1 = self._geom * g2 = geom._geom # <<<<<<<<<<<<<< @@ -601,7 +603,7 @@ */ __pyx_v_g2 = ((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_geom)->_geom; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":154 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":151 * g1 = self._geom * g2 = geom._geom * answer = GEOSIntersects(g1, g2) # <<<<<<<<<<<<<< @@ -610,7 +612,7 @@ */ __pyx_v_answer = GEOSIntersects(__pyx_v_g1,__pyx_v_g2); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":155 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":152 * g2 = geom._geom * answer = GEOSIntersects(g1, g2) * if answer: # <<<<<<<<<<<<<< @@ -620,7 +622,7 @@ __pyx_1 = __pyx_v_answer; if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":156 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":153 * answer = GEOSIntersects(g1, g2) * if answer: * return True # <<<<<<<<<<<<<< @@ -634,7 +636,7 @@ } /*else*/ { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":158 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":155 * return True * else: * return False # <<<<<<<<<<<<<< @@ -687,9 +689,9 @@ Py_INCREF(__pyx_v_geom); __pyx_v_p = Py_None; Py_INCREF(Py_None); __pyx_v_pout = Py_None; Py_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_4geos_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_4geos_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; goto __pyx_L1;} - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":164 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":161 * cdef char answer * cdef int numgeoms, i, typeid * g1 = self._geom # <<<<<<<<<<<<<< @@ -698,7 +700,7 @@ */ __pyx_v_g1 = ((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_self)->_geom; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":165 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":162 * cdef int numgeoms, i, typeid * g1 = self._geom * g2 = geom._geom # <<<<<<<<<<<<<< @@ -707,7 +709,7 @@ */ __pyx_v_g2 = ((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_geom)->_geom; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":166 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":163 * g1 = self._geom * g2 = geom._geom * g3 = GEOSIntersection(g1, g2) # <<<<<<<<<<<<<< @@ -716,7 +718,7 @@ */ __pyx_v_g3 = GEOSIntersection(__pyx_v_g1,__pyx_v_g2); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":167 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":164 * g2 = geom._geom * g3 = GEOSIntersection(g1, g2) * typeid = GEOSGeomTypeId(g3) # <<<<<<<<<<<<<< @@ -725,7 +727,7 @@ */ __pyx_v_typeid = GEOSGeomTypeId(__pyx_v_g3); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":168 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":165 * g3 = GEOSIntersection(g1, g2) * typeid = GEOSGeomTypeId(g3) * if typeid == GEOS_POLYGON: # <<<<<<<<<<<<<< @@ -735,39 +737,39 @@ __pyx_1 = (__pyx_v_typeid == GEOS_POLYGON); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":169 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":166 * typeid = GEOSGeomTypeId(g3) * if typeid == GEOS_POLYGON: * p = Polygon() # create an empty Polygon instance # <<<<<<<<<<<<<< * p = _add_geom(p,g3) # add geometry to it. * # above should be faster than this .. */ - __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4geos_Polygon), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4geos_Polygon), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;} Py_DECREF(__pyx_v_p); __pyx_v_p = __pyx_2; __pyx_2 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":170 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":167 * if typeid == GEOS_POLYGON: * p = Polygon() # create an empty Polygon instance * p = _add_geom(p,g3) # add geometry to it. # <<<<<<<<<<<<<< * # above should be faster than this .. * #b = _get_coords(g3) */ - if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_4geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; goto __pyx_L1;} - __pyx_2 = __pyx_f_4geos__add_geom(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_p),__pyx_v_g3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_4geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;} + __pyx_2 = __pyx_f_4geos__add_geom(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_p),__pyx_v_g3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;} Py_DECREF(__pyx_v_p); __pyx_v_p = __pyx_2; __pyx_2 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":174 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":171 * #b = _get_coords(g3) * #p = Polygon(b) * pout = [p] # return a list with a single element # <<<<<<<<<<<<<< * elif typeid == GEOS_LINESTRING: - * p = LineString() + * p = LineString() # create an empty LineString instance */ - __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} + __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L1;} Py_INCREF(__pyx_v_p); PyList_SET_ITEM(__pyx_2, 0, __pyx_v_p); Py_DECREF(__pyx_v_pout); @@ -778,39 +780,39 @@ __pyx_1 = (__pyx_v_typeid == GEOS_LINESTRING); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":176 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":173 * pout = [p] # return a list with a single element * elif typeid == GEOS_LINESTRING: - * p = LineString() # <<<<<<<<<<<<<< - * p = _add_geom(p,g3) + * p = LineString() # create an empty LineString instance # <<<<<<<<<<<<<< + * p = _add_geom(p,g3) # add geometry to it. * return [p] */ - __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4geos_LineString), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4geos_LineString), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;} Py_DECREF(__pyx_v_p); __pyx_v_p = __pyx_2; __pyx_2 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":177 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":174 * elif typeid == GEOS_LINESTRING: - * p = LineString() - * p = _add_geom(p,g3) # <<<<<<<<<<<<<< + * p = LineString() # create an empty LineString instance + * p = _add_geom(p,g3) # add geometry to it. # <<<<<<<<<<<<<< * return [p] * elif typeid == GEOS_MULTIPOLYGON: */ - if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_4geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L1;} - __pyx_2 = __pyx_f_4geos__add_geom(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_p),__pyx_v_g3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_4geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} + __pyx_2 = __pyx_f_4geos__add_geom(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_p),__pyx_v_g3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} Py_DECREF(__pyx_v_p); __pyx_v_p = __pyx_2; __pyx_2 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":178 - * p = LineString() - * p = _add_geom(p,g3) + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":175 + * p = LineString() # create an empty LineString instance + * p = _add_geom(p,g3) # add geometry to it. * return [p] # <<<<<<<<<<<<<< * elif typeid == GEOS_MULTIPOLYGON: * numgeoms = GEOSGetNumGeometries(g3) */ - __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;} + __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} Py_INCREF(__pyx_v_p); PyList_SET_ITEM(__pyx_2, 0, __pyx_v_p); __pyx_r = __pyx_2; @@ -821,7 +823,7 @@ __pyx_1 = (__pyx_v_typeid == GEOS_MULTIPOLYGON); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":180 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":177 * return [p] * elif typeid == GEOS_MULTIPOLYGON: * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<< @@ -830,19 +832,19 @@ */ __pyx_v_numgeoms = GEOSGetNumGeometries(__pyx_v_g3); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":181 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":178 * elif typeid == GEOS_MULTIPOLYGON: * numgeoms = GEOSGetNumGeometries(g3) * pout = [] # <<<<<<<<<<<<<< * for i from 0 <= i < numgeoms: * gout = GEOSGetGeometryN(g3, i) */ - __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} + __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;} Py_DECREF(__pyx_v_pout); __pyx_v_pout = __pyx_2; __pyx_2 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":182 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":179 * numgeoms = GEOSGetNumGeometries(g3) * pout = [] * for i from 0 <= i < numgeoms: # <<<<<<<<<<<<<< @@ -851,7 +853,7 @@ */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_numgeoms; __pyx_v_i++) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":183 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":180 * pout = [] * for i from 0 <= i < numgeoms: * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<< @@ -860,43 +862,43 @@ */ __pyx_v_gout = GEOSGetGeometryN(__pyx_v_g3,__pyx_v_i); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":184 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":181 * for i from 0 <= i < numgeoms: * gout = GEOSGetGeometryN(g3, i) * p = Polygon() # create an empty Polygon instance # <<<<<<<<<<<<<< * p = _add_geom(p,gout) # add geometry to it. * pout.append(p) */ - __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4geos_Polygon), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4geos_Polygon), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} Py_DECREF(__pyx_v_p); __pyx_v_p = __pyx_2; __pyx_2 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":185 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":182 * gout = GEOSGetGeometryN(g3, i) * p = Polygon() # create an empty Polygon instance * p = _add_geom(p,gout) # add geometry to it. # <<<<<<<<<<<<<< * pout.append(p) * elif typeid == GEOS_MULTILINESTRING: */ - if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_4geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;} - __pyx_2 = __pyx_f_4geos__add_geom(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_p),__pyx_v_gout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_4geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;} + __pyx_2 = __pyx_f_4geos__add_geom(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_p),__pyx_v_gout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;} Py_DECREF(__pyx_v_p); __pyx_v_p = __pyx_2; __pyx_2 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":186 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":183 * p = Polygon() # create an empty Polygon instance * p = _add_geom(p,gout) # add geometry to it. * pout.append(p) # <<<<<<<<<<<<<< * elif typeid == GEOS_MULTILINESTRING: * numgeoms = GEOSGetNumGeometries(g3) */ - __pyx_2 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;} Py_INCREF(__pyx_v_p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -906,7 +908,7 @@ __pyx_1 = (__pyx_v_typeid == GEOS_MULTILINESTRING); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":188 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":185 * pout.append(p) * elif typeid == GEOS_MULTILINESTRING: * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<< @@ -915,73 +917,73 @@ */ __pyx_v_numgeoms = GEOSGetNumGeometries(__pyx_v_g3); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":189 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":186 * elif typeid == GEOS_MULTILINESTRING: * numgeoms = GEOSGetNumGeometries(g3) * pout = [] # <<<<<<<<<<<<<< * for i from 0 <= i < numgeoms: * gout = GEOSGetGeometryN(g3, i) */ - __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; goto __pyx_L1;} + __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} Py_DECREF(__pyx_v_pout); __pyx_v_pout = __pyx_2; __pyx_2 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":190 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":187 * numgeoms = GEOSGetNumGeometries(g3) * pout = [] * for i from 0 <= i < numgeoms: # <<<<<<<<<<<<<< * gout = GEOSGetGeometryN(g3, i) - * p = LineString() # create an empty Polygon instance + * p = LineString() # create an LineString instance */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_numgeoms; __pyx_v_i++) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":191 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":188 * pout = [] * for i from 0 <= i < numgeoms: * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<< - * p = LineString() # create an empty Polygon instance + * p = LineString() # create an LineString instance * p = _add_geom(p,gout) # add geometry to it. */ __pyx_v_gout = GEOSGetGeometryN(__pyx_v_g3,__pyx_v_i); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":192 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":189 * for i from 0 <= i < numgeoms: * gout = GEOSGetGeometryN(g3, i) - * p = LineString() # create an empty Polygon instance # <<<<<<<<<<<<<< + * p = LineString() # create an LineString instance # <<<<<<<<<<<<<< * p = _add_geom(p,gout) # add geometry to it. * pout.append(p) */ - __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_4geos_LineString), 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_4geos_LineString), 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; goto __pyx_L1;} Py_DECREF(__pyx_v_p); __pyx_v_p = __pyx_3; __pyx_3 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":193 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":190 * gout = GEOSGetGeometryN(g3, i) - * p = LineString() # create an empty Polygon instance + * p = LineString() # create an LineString instance * p = _add_geom(p,gout) # add geometry to it. # <<<<<<<<<<<<<< * pout.append(p) * else: */ - if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_4geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;} - __pyx_4 = __pyx_f_4geos__add_geom(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_p),__pyx_v_gout); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_4geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L1;} + __pyx_4 = __pyx_f_4geos__add_geom(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_p),__pyx_v_gout); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L1;} Py_DECREF(__pyx_v_p); __pyx_v_p = __pyx_4; __pyx_4 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":194 - * p = LineString() # create an empty Polygon instance + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":191 + * p = LineString() # create an LineString instance * p = _add_geom(p,gout) # add geometry to it. * pout.append(p) # <<<<<<<<<<<<<< * else: * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) */ - __pyx_2 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;} Py_INCREF(__pyx_v_p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -990,26 +992,26 @@ } /*else*/ { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":196 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":193 * pout.append(p) * else: * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) # <<<<<<<<<<<<<< * return pout * */ - __pyx_2 = PyNumber_Remainder(__pyx_k9p, ((PyObject*)&PyType_Type)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} + __pyx_2 = PyNumber_Remainder(__pyx_k9p, ((PyObject*)&PyType_Type)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); __pyx_2 = 0; - __pyx_4 = PyObject_CallObject(__pyx_builtin_NotImplementedError, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_builtin_NotImplementedError, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __Pyx_Raise(__pyx_4, 0, 0); Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;} } __pyx_L2:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":197 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":194 * else: * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) * return pout # <<<<<<<<<<<<<< @@ -1042,14 +1044,14 @@ PyObject *__pyx_1 = 0; Py_INCREF(__pyx_v_self); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":200 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":197 * * def get_coords(self): * return _get_coords(self._geom) # <<<<<<<<<<<<<< - * - * cdef class Polygon(BaseGeometry): + * + * def __dealloc__(self): */ - __pyx_1 = __pyx_f_4geos__get_coords(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_self)->_geom); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; goto __pyx_L1;} + __pyx_1 = __pyx_f_4geos__get_coords(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_self)->_geom); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -1065,6 +1067,70 @@ return __pyx_r; } +static void __pyx_f_py_4geos_12BaseGeometry___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_4geos_12BaseGeometry___dealloc__[] = "destroy GEOS geometry"; +static void __pyx_f_py_4geos_12BaseGeometry___dealloc__(PyObject *__pyx_v_self) { + Py_INCREF(__pyx_v_self); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":201 + * def __dealloc__(self): + * """destroy GEOS geometry""" + * GEOSGeom_destroy(self._geom) # <<<<<<<<<<<<<< + * + * def __reduce__(self): + */ + GEOSGeom_destroy(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_self)->_geom); + + Py_DECREF(__pyx_v_self); +} + +static PyObject *__pyx_n___class__; + +static PyObject *__pyx_f_py_4geos_12BaseGeometry___reduce__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static char __pyx_doc_4geos_12BaseGeometry___reduce__[] = "special method that allows geos instance to be pickled"; +static PyObject *__pyx_f_py_4geos_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); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":205 + * def __reduce__(self): + * """special method that allows geos instance to be pickled""" + * return (self.__class__,(self.get_coords(),)) # <<<<<<<<<<<<<< + * + * cdef class Polygon(BaseGeometry): + */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___class__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_coords); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; 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 = 0; + __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; @@ -1095,9 +1161,9 @@ 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_4geos_ndarray, 1, "b"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_4geos_ndarray, 1, "b"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; goto __pyx_L1;} - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":214 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":217 * * # just return an empty class * if b is None: # <<<<<<<<<<<<<< @@ -1107,7 +1173,7 @@ __pyx_1 = (((PyObject *)__pyx_v_b) == Py_None); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":215 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":218 * # just return an empty class * if b is None: * return # <<<<<<<<<<<<<< @@ -1120,7 +1186,7 @@ } __pyx_L2:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":219 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":222 * # make sure data is contiguous. * # if not, make a local copy. * if not PyArray_ISCONTIGUOUS(b): # <<<<<<<<<<<<<< @@ -1130,17 +1196,17 @@ __pyx_1 = (!PyArray_ISCONTIGUOUS(__pyx_v_b)); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":220 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":223 * # if not, make a local copy. * if not PyArray_ISCONTIGUOUS(b): * b = b.copy() # <<<<<<<<<<<<<< * * m = b.shape[0] */ - __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_b), __pyx_n_copy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} - __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_b), __pyx_n_copy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4geos_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4geos_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_b)); __pyx_v_b = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; @@ -1148,78 +1214,78 @@ } __pyx_L3:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":222 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":225 * 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 = 222; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_b), __pyx_n_shape); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; 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 = 222; goto __pyx_L1;} - __pyx_4 = PyObject_GetItem(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + __pyx_4 = PyObject_GetItem(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; 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 = 222; goto __pyx_L1;} + __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_v_m = __pyx_5; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":225 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":228 * * # 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 = 225; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; 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 = 225; goto __pyx_L1;} + __pyx_4 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; 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 = 225; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; 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 = 225; goto __pyx_L1;} + __pyx_6 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_3); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; 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 = 225; goto __pyx_L1;} + __pyx_2 = PyObject_RichCompare(__pyx_4, __pyx_6, Py_NE); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; 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 = 225; goto __pyx_L1;} + __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; 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 = 225; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; 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 = 225; goto __pyx_L1;} + __pyx_4 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; 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 = 225; goto __pyx_L1;} + __pyx_6 = PyTuple_New(2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; 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 = 225; goto __pyx_L1;} + __pyx_3 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_6); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; 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 = 225; goto __pyx_L1;} + __pyx_2 = PyObject_RichCompare(__pyx_4, __pyx_3, Py_NE); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; 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_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":226 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":229 * # Add closing coordinates to sequence? * if b[-1,0] != b[0,0] or b[-1,1] != b[0,1]: * M = m + 1 # <<<<<<<<<<<<<< @@ -1231,7 +1297,7 @@ } /*else*/ { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":228 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":231 * M = m + 1 * else: * M = m # <<<<<<<<<<<<<< @@ -1242,7 +1308,7 @@ } __pyx_L4:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":229 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":232 * else: * M = m * self._npts = M # <<<<<<<<<<<<<< @@ -1251,7 +1317,7 @@ */ ((struct __pyx_obj_4geos_Polygon *)__pyx_v_self)->__pyx_base._npts = __pyx_v_M; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":232 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":235 * * # Create a coordinate sequence * cs = GEOSCoordSeq_create(M, 2) # <<<<<<<<<<<<<< @@ -1260,7 +1326,7 @@ */ __pyx_v_cs = GEOSCoordSeq_create(__pyx_v_M,2); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":235 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":238 * * # add to coordinate sequence * bbuffer = <double *>b.data # <<<<<<<<<<<<<< @@ -1269,7 +1335,7 @@ */ __pyx_v_bbuffer = ((double (*))__pyx_v_b->data); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":236 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":239 * # add to coordinate sequence * bbuffer = <double *>b.data * for i from 0 <= i < m: # <<<<<<<<<<<<<< @@ -1278,7 +1344,7 @@ */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_m; __pyx_v_i++) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":237 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":240 * bbuffer = <double *>b.data * for i from 0 <= i < m: * dx = bbuffer[2*i] # <<<<<<<<<<<<<< @@ -1287,7 +1353,7 @@ */ __pyx_v_dx = (__pyx_v_bbuffer[(2 * __pyx_v_i)]); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":238 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":241 * for i from 0 <= i < m: * dx = bbuffer[2*i] * dy = bbuffer[2*i+1] # <<<<<<<<<<<<<< @@ -1296,7 +1362,7 @@ */ __pyx_v_dy = (__pyx_v_bbuffer[((2 * __pyx_v_i) + 1)]); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":241 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":244 * # Because of a bug in the GEOS C API, * # always set X before Y * GEOSCoordSeq_setX(cs, i, dx) # <<<<<<<<<<<<<< @@ -1305,7 +1371,7 @@ */ GEOSCoordSeq_setX(__pyx_v_cs,__pyx_v_i,__pyx_v_dx); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":242 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":245 * # always set X before Y * GEOSCoordSeq_setX(cs, i, dx) * GEOSCoordSeq_setY(cs, i, dy) # <<<<<<<<<<<<<< @@ -1315,7 +1381,7 @@ GEOSCoordSeq_setY(__pyx_v_cs,__pyx_v_i,__pyx_v_dy); } - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":245 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":248 * * # Add closing coordinates to sequence? * if M > m: # <<<<<<<<<<<<<< @@ -1325,7 +1391,7 @@ __pyx_1 = (__pyx_v_M > __pyx_v_m); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":246 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":249 * # Add closing coordinates to sequence? * if M > m: * dx = bbuffer[0] # <<<<<<<<<<<<<< @@ -1334,7 +1400,7 @@ */ __pyx_v_dx = (__pyx_v_bbuffer[0]); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx"... [truncated message content] |
From: <js...@us...> - 2007-11-13 21:13:09
|
Revision: 4255 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4255&view=rev Author: jswhit Date: 2007-11-13 13:13:04 -0800 (Tue, 13 Nov 2007) Log Message: ----------- include hires.py example Modified Paths: -------------- trunk/toolkits/basemap-testing/MANIFEST.in Modified: trunk/toolkits/basemap-testing/MANIFEST.in =================================================================== --- trunk/toolkits/basemap-testing/MANIFEST.in 2007-11-13 21:04:59 UTC (rev 4254) +++ trunk/toolkits/basemap-testing/MANIFEST.in 2007-11-13 21:13:04 UTC (rev 4255) @@ -11,6 +11,7 @@ include setupegg.py include src/* include examples/simpletest.py +include examples/hires.py include examples/simpletest_oo.py include examples/randompoints.py include examples/test.py @@ -76,3 +77,4 @@ include lib/matplotlib/toolkits/basemap/data/*_c.dat include lib/matplotlib/toolkits/basemap/data/*_l.dat include lib/matplotlib/toolkits/basemap/data/*_i.dat +include lib/matplotlib/toolkits/basemap/data/*_h.dat This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-13 21:05:04
|
Revision: 4254 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4254&view=rev Author: jswhit Date: 2007-11-13 13:04:59 -0800 (Tue, 13 Nov 2007) Log Message: ----------- remove docstring reference to Shapely Modified Paths: -------------- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py =================================================================== --- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-13 20:55:29 UTC (rev 4253) +++ trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-13 21:04:59 UTC (rev 4254) @@ -893,7 +893,7 @@ polygons.append(zip(bx,by)) polygon_types.append(type) continue - # create a Shapely geometry object. + # create a GEOS geometry object. poly = Shape(b) # if geometry instersects map projection # region, and doesn't have any invalid points, process it. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-13 20:55:34
|
Revision: 4253 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4253&view=rev Author: jswhit Date: 2007-11-13 12:55:29 -0800 (Tue, 13 Nov 2007) Log Message: ----------- now use custom libgeos pyrex wrapper, Shapely no longer needed. Modified Paths: -------------- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py =================================================================== --- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-13 20:52:54 UTC (rev 4252) +++ trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-13 20:55:29 UTC (rev 4253) @@ -14,9 +14,9 @@ from numpy import linspace, squeeze, ma from matplotlib.cbook import popd, is_scalar from shapelib import ShapeFile -from shapely.geometry import Polygon as PolygonShape -from shapely.geometry import LineString as LineShape -from shapely.geometry import Point as PointShape +from geos import Polygon as PolygonShape +from geos import LineString as LineShape +from geos import Point as PointShape # basemap data files now installed in lib/matplotlib/toolkits/basemap/data basemap_datadir = os.sep.join([os.path.dirname(__file__), 'data']) @@ -774,9 +774,10 @@ maptran = pyproj.Proj(proj='stere',lon_0=lon_0,lat_0=lat_0) # boundary polygon for orthographic projection # in stereographic coorindates. - b = npy.asarray(self._boundarypolyll.boundary) + b = self._boundarypolyll.get_coords() blons = b[:,0]; blats = b[:,1] - boundarypolyxy = PolygonShape(zip(*maptran(blons,blats))) + b[:,0], b[:,1] = maptran(blons, blats) + boundarypolyxy = PolygonShape(b) for line in bdatmetafile: linesplit = line.split() area = float(linesplit[1]) @@ -821,14 +822,13 @@ lats.insert(0,-90.) lons.append(lonend) lats.append(-90.) - poly = PolygonShape(zip(lons,lats)) - antart = True b = npy.empty((len(lons),2),npy.float64) b[:,0] = lons; b[:,1] = lats + poly = PolygonShape(b) + antart = True else: + poly = Shape(b) antart = False - # create Shapely geometry from lons/lons array. - poly = Shape(b) # create duplicate polygons shifted by -360 and +360 # (so as to properly treat polygons that cross # Greenwich meridian). @@ -847,25 +847,16 @@ # if geometry intersection calculation fails, # just move on. try: - poly = poly.intersection(boundarypolyll) + geoms = poly.intersection(boundarypolyll) except: pass - # create iterable object with geometries - # that intersect map region. - if hasattr(poly,'geoms'): - geoms = poly.geoms - else: - geoms = [poly] # iterate over geometries in intersection. for psub in geoms: # only coastlines are polygons, # which have a 'boundary' attribute. # otherwise, use 'coords' attribute # to extract coordinates. - if name == 'gshhs': - b = npy.asarray(psub.boundary) - else: - b = npy.asarray(psub.coords) + b = psub.get_coords() blons = b[:,0]; blats = b[:,1] # transformation from lat/lon to # map projection coordinates. @@ -906,25 +897,16 @@ poly = Shape(b) # if geometry instersects map projection # region, and doesn't have any invalid points, process it. - if goodmask.all() and boundarypolyxy.intersects(poly): + if goodmask.all() and poly.intersects(boundarypolyxy): # if geometry intersection calculation fails, # just move on. try: - poly = boundarypolyxy.intersection(poly) + geoms = poly.intersection(boundarypolyxy) except: pass - # create iterable object with geometries - # that intersect map region. - if hasattr(poly,'geoms'): - geoms = poly.geoms - else: - geoms = [poly] # iterate over geometries in intersection. for psub in geoms: - if name == 'gshhs': - b = npy.asarray(psub.boundary) - else: - b = npy.asarray(psub.coords) + b = psub.get_coords() # if projection == 'ortho', # transform polygon from stereographic # to orthographic coordinates. @@ -932,7 +914,7 @@ # if coastline polygon covers more than 99% # of map region for fulldisk projection, # it's probably bogus, so skip it. - areafrac = psub.area/boundarypolyxy.area + areafrac = psub.area()/boundarypolyxy.area() if name == 'gshhs' and\ self._fulldisk and\ areafrac > 0.99: continue @@ -963,7 +945,9 @@ rmajor = self._width x = rmajor*npy.cos(thetas) + rmajor y = rminor*npy.sin(thetas) + rminor - boundaryxy = PolygonShape(zip(x,y)) + b = npy.empty((len(x),2),npy.float64) + b[:,0]=x; b[:,1]=y + boundaryxy = PolygonShape(b) # compute proj instance for full disk, if necessary. if not self._fulldisk: projparms = self.projparams @@ -1000,7 +984,9 @@ lons = npy.array(lons1+lons2+lons3+lons4,npy.float64) lats = npy.array(lats1+lats2+lats3+lats4,npy.float64) x, y = maptran(lons,lats) - boundaryxy = PolygonShape(zip(x,y)) + b = npy.empty((len(x),2),npy.float64) + b[:,0]=x; b[:,1]=y + boundaryxy = PolygonShape(b) else: # all other projections are rectangular. # left side (x = xmin, ymin <= y <= ymax) yy = linspace(self.ymin, self.ymax, ny)[:-1] @@ -1018,10 +1004,10 @@ y = y + len(xx)*[self.ymin] x = npy.array(x,npy.float64) y = npy.array(y,npy.float64) - boundaryxy = PolygonShape([(self.xmin,self.ymin),\ - (self.xmin,self.ymax),\ - (self.xmax,self.ymax),\ - (self.xmax,self.ymin)]) + 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 = PolygonShape(b) if self.projection in ['mill','merc','cyl']: # make sure map boundary doesn't quite include pole. if self.urcrnrlat > 89.9999: @@ -1035,7 +1021,9 @@ lons = [self.llcrnrlon, self.llcrnrlon, self.urcrnrlon, self.urcrnrlon] lats = [llcrnrlat, urcrnrlat, urcrnrlat, llcrnrlat] x, y = self(lons, lats) - boundaryxy = PolygonShape(zip(x,y)) + b = npy.empty((len(x),2),npy.float64) + b[:,0]=x; b[:,1]=y + boundaryxy = PolygonShape(b) else: if self.projection not in ['moll','robin','sinu']: lons, lats = maptran(x,y,inverse=True) @@ -1051,7 +1039,9 @@ lons[n] = lon lonprev = lon n = n + 1 - boundaryll = PolygonShape(zip(lons,lats)) + b = npy.empty((len(lons),2),npy.float64) + b[:,0]=lons; b[:,1]=lats + boundaryll = PolygonShape(b) return boundaryll, boundaryxy This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-13 20:53:07
|
Revision: 4252 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4252&view=rev Author: jswhit Date: 2007-11-13 12:52:54 -0800 (Tue, 13 Nov 2007) Log Message: ----------- obsolete Removed Paths: ------------- trunk/toolkits/basemap-testing/LICENSE_shapely trunk/toolkits/basemap-testing/lib/shapely/ Deleted: trunk/toolkits/basemap-testing/LICENSE_shapely =================================================================== --- trunk/toolkits/basemap-testing/LICENSE_shapely 2007-11-13 20:52:18 UTC (rev 4251) +++ trunk/toolkits/basemap-testing/LICENSE_shapely 2007-11-13 20:52:54 UTC (rev 4252) @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - <one line to give the library's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - <signature of Ty Coon>, 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-13 20:52:32
|
Revision: 4251 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4251&view=rev Author: jswhit Date: 2007-11-13 12:52:18 -0800 (Tue, 13 Nov 2007) Log Message: ----------- Add new custom pyrex wrapper of libgeos - Shapely no longer needed. Modified Paths: -------------- trunk/toolkits/basemap-testing/README trunk/toolkits/basemap-testing/setup.py Added Paths: ----------- trunk/toolkits/basemap-testing/src/geos.c trunk/toolkits/basemap-testing/src/geos.pyx Modified: trunk/toolkits/basemap-testing/README =================================================================== --- trunk/toolkits/basemap-testing/README 2007-11-13 20:37:11 UTC (rev 4250) +++ trunk/toolkits/basemap-testing/README 2007-11-13 20:52:18 UTC (rev 4251) @@ -13,10 +13,6 @@ libgoes_c version 2.2.3, available from http://geos.refractions.net/. -ctypes (which comes with python >= 2.5, -but can be installed separately for python 2.4 from -http:/python.org/pypi/ctypes). - **Copyright** source code from proj.4 (http://proj.maptools.org) is included in the @@ -25,10 +21,6 @@ pyshapelib by Bernhard Herzog is included in the 'pyshapelib' directory under the terms given in LICENSE_pyshapelib. -The Shapely module (http://trac.gispython.org/projects/PCL/wiki/Shapely) by -Sean Gillies is included in the 'lib/shapely' directory under the terms -given in LICENSE_shapely. - the coastline, lake, river and political boundary data are extracted from datasets provided with the Generic Mapping Tools (http://gmt.soest.hawaii.edu) @@ -39,7 +31,7 @@ is included. Everything else (including src/_proj.pyx, src/_geod.pyx, src/_pyproj.pxi, -src/_proj.c and src/_geod.c): +src/_proj.c and src/_geod.c, src/_geos.c, src/_geos.pyx): copyright (c) 2007 by Jeffrey Whitaker. Modified: trunk/toolkits/basemap-testing/setup.py =================================================================== --- trunk/toolkits/basemap-testing/setup.py 2007-11-13 20:37:11 UTC (rev 4250) +++ trunk/toolkits/basemap-testing/setup.py 2007-11-13 20:52:18 UTC (rev 4251) @@ -1,10 +1,18 @@ import sys, glob, os major, minor1, minor2, s, tmp = sys.version_info -if major==2 and minor1<4: - raise SystemExit(""" -python 2.4 or higher required""") +if major==2 and minor1<=3: + # setuptools monkeypatches distutils.core.Distribution to support + # package_data + try: import setuptools + except ImportError: + raise SystemExit("""\ +matplotlib requires setuptools for installation. Please download +http://peak.telecommunity.com/dist/ez_setup.py and run it (as su if +you are doing a system wide install) to install the proper version of +setuptools for your system""") from distutils.core import Extension from distutils.util import convert_path +import numpy def dbf_macros(): """Return the macros to define when compiling the dbflib wrapper. @@ -23,14 +31,22 @@ else: return [("HAVE_UPDATE_HEADER", "0")] +GEOS_dir = os.environ.get('GEOS_DIR') +if GEOS_dir is None: + raise KeyError, 'please specify the location of geos library and headers with GEOS_DIR environment variable' +geos_include_dirs=[os.path.join(GEOS_dir,'include'),numpy.get_include()] +geos_library_dirs=[os.path.join(GEOS_dir,'lib')] + 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')) packages = ['matplotlib.toolkits.basemap'] package_dirs = {'':'lib'} extensions = [Extension("matplotlib.toolkits.basemap._proj",deps+['src/_proj.c'],include_dirs = ['src'],)] extensions.append(Extension("matplotlib.toolkits.basemap._geod",deps+['src/_geod.c'],include_dirs = ['src'],)) +extensions.append(Extension("matplotlib.toolkits.basemap.geos",deps+['src/geos.c'],library_dirs=geos_library_dirs,include_dirs=geos_include_dirs,runtime_library_dirs=geos_library_dirs,libraries=['geos_c'])) # install shapelib and dbflib. packages = packages + ['shapelib','dbflib'] @@ -61,32 +77,6 @@ additional_params = {} from distutils.core import setup -# check for ctypes -try: from ctypes.util import find_library -except ImportError: havectypes = False -else: havectypes = True -if not havectypes: - raise SystemExit(""" -basemap requires ctypes, which comes with python 2.5. If you are -running python 2.4, please install ctypes from -http://pypi.python.org/pypi/ctypes""") - -# check for libgeos_c -sys.path.append('lib/shapely') -from find_geoslib import find_geoslib -lgeos = find_geoslib() -sys.path.remove('lib/shapely') - -# check for shapely -try: import shapely -except ImportError: haveshapely = False -else: haveshapely = True -if not haveshapely: - packages.append('shapely') - packages.append('shapely.geometry') - package_dirs['shapely'] = os.path.join('lib','shapely') - - # Specify all the required mpl data pyproj_datafiles = ['data/epsg', 'data/esri', 'data/esri.extra', 'data/GL27', 'data/nad.lst', 'data/nad27', 'data/nad83', 'data/ntv2_out.dist', 'data/other.extra', 'data/pj_out27.dist', 'data/pj_out83.dist', 'data/proj_def.dat', 'data/README', 'data/td_out.dist', 'data/test27', 'data/test83', 'data/testntv2', 'data/testvarious', 'data/world'] boundaryfiles = [] Added: trunk/toolkits/basemap-testing/src/geos.c =================================================================== --- trunk/toolkits/basemap-testing/src/geos.c (rev 0) +++ trunk/toolkits/basemap-testing/src/geos.c 2007-11-13 20:52:18 UTC (rev 4251) @@ -0,0 +1,3104 @@ +/* Generated by Cython 0.9.6.7 on Tue Nov 13 13:39:59 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 +#ifdef __cplusplus +#define __PYX_EXTERN_C extern "C" +#else +#define __PYX_EXTERN_C extern +#endif +__PYX_EXTERN_C double pow(double, double); +#include "numpy/arrayobject.h" +#include "geos_c.h" + + +#ifdef __GNUC__ +#define INLINE __inline__ +#elif _WIN32 +#define INLINE __inline +#else +#define INLINE +#endif + +typedef struct {const char *s; const void **p;} __Pyx_CApiTabEntry; /*proto*/ +typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/ +typedef struct {PyObject **p; char *s; long n; int is_unicode;} __Pyx_StringTabEntry; /*proto*/ + +#define __pyx_PyIndex_AsSsize_t(b) PyInt_AsSsize_t(PyNumber_Index(b)) + +#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); +} + + +#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_GetExcValue(void); /*proto*/ + +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ + +static void __Pyx_WriteUnraisable(char *name); /*proto*/ + +static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*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 void __Pyx_AddTraceback(char *funcname); /*proto*/ + +/* Declarations from geos */ + + +struct __pyx_obj_4geos_BaseGeometry { + PyObject_HEAD + GEOSGeom (*_geom); + unsigned int _npts; +}; + + +struct __pyx_obj_4geos_Polygon { + struct __pyx_obj_4geos_BaseGeometry __pyx_base; +}; + + +struct __pyx_obj_4geos_LineString { + struct __pyx_obj_4geos_BaseGeometry __pyx_base; +}; + + +struct __pyx_obj_4geos_Point { + struct __pyx_obj_4geos_BaseGeometry __pyx_base; + PyObject *x; + PyObject *y; +}; + +static PyTypeObject *__pyx_ptype_4geos_ndarray = 0; +static PyTypeObject *__pyx_ptype_4geos_BaseGeometry = 0; +static PyTypeObject *__pyx_ptype_4geos_Polygon = 0; +static PyTypeObject *__pyx_ptype_4geos_LineString = 0; +static PyTypeObject *__pyx_ptype_4geos_Point = 0; +static PyArrayObject *__pyx_k4; +static PyArrayObject *__pyx_k5; +static PyObject *__pyx_k6; +static void (__pyx_f_4geos_notice_h(char (*),char (*))); /*proto*/ +static void (__pyx_f_4geos_error_h(char (*),char (*))); /*proto*/ +static PyObject *(__pyx_f_4geos__add_geom(struct __pyx_obj_4geos_BaseGeometry *,GEOSGeom (*))); /*proto*/ +static PyObject *(__pyx_f_4geos__get_coords(GEOSGeom (*))); /*proto*/ + + +/* Implementation of geos */ + +static char (__pyx_k3[]) = "0.1"; + +static PyObject *__pyx_n_sys; +static PyObject *__pyx_n_numpy; +static PyObject *__pyx_n___version__; +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___init__; +static PyObject *__pyx_n_area; + +static PyObject *__pyx_k3p; + +static PyObject *__pyx_n_stdout; +static PyObject *__pyx_n_write; + +static PyObject *__pyx_k7p; + +static char (__pyx_k7[]) = "GEOS_NOTICE: %s\n"; + +static void __pyx_f_4geos_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); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":99 + * + * 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 = 99; goto __pyx_L1;} + Py_DECREF(__pyx_v_format); + __pyx_v_format = __pyx_1; + __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":100 + * 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 = 100; goto __pyx_L1;} + Py_DECREF(__pyx_v_message); + __pyx_v_message = __pyx_1; + __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":101 + * format = PyString_FromString(fmt) + * message = PyString_FromString(msg) + * try: # <<<<<<<<<<<<<< + * warn_msg = format % message + * except: + */ + /*try:*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":102 + * message = PyString_FromString(msg) + * try: + * warn_msg = format % message # <<<<<<<<<<<<<< + * except: + * warn_msg = format + */ + __pyx_1 = PyNumber_Remainder(__pyx_v_format, __pyx_v_message); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; 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; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":103 + * try: + * warn_msg = format % message + * except: # <<<<<<<<<<<<<< + * warn_msg = format + * sys.stdout.write('GEOS_NOTICE: %s\n' % warn_msg) + */ + /*except:*/ { + __Pyx_AddTraceback("geos.notice_h"); + __pyx_1 = __Pyx_GetExcValue(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":104 + * warn_msg = format % message + * except: + * warn_msg = format # <<<<<<<<<<<<<< + * sys.stdout.write('GEOS_NOTICE: %s\n' % warn_msg) + * + */ + Py_INCREF(__pyx_v_format); + Py_DECREF(__pyx_v_warn_msg); + __pyx_v_warn_msg = __pyx_v_format; + goto __pyx_L3; + } + __pyx_L3:; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":105 + * 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 = 105; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_stdout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_write); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyNumber_Remainder(__pyx_k7p, __pyx_v_warn_msg); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 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_k8p; + +static char (__pyx_k8[]) = "GEOS_ERROR: %s\n"; + +static void __pyx_f_4geos_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); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":108 + * + * 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 = 108; goto __pyx_L1;} + Py_DECREF(__pyx_v_format); + __pyx_v_format = __pyx_1; + __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":109 + * 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 = 109; goto __pyx_L1;} + Py_DECREF(__pyx_v_message); + __pyx_v_message = __pyx_1; + __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":110 + * format = PyString_FromString(fmt) + * message = PyString_FromString(msg) + * try: # <<<<<<<<<<<<<< + * warn_msg = format % message + * except: + */ + /*try:*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":111 + * message = PyString_FromString(msg) + * try: + * warn_msg = format % message # <<<<<<<<<<<<<< + * except: + * warn_msg = format + */ + __pyx_1 = PyNumber_Remainder(__pyx_v_format, __pyx_v_message); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; 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; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":112 + * try: + * warn_msg = format % message + * except: # <<<<<<<<<<<<<< + * warn_msg = format + * sys.stderr.write('GEOS_ERROR: %s\n' % warn_msg) + */ + /*except:*/ { + __Pyx_AddTraceback("geos.error_h"); + __pyx_1 = __Pyx_GetExcValue(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":113 + * warn_msg = format % message + * except: + * warn_msg = format # <<<<<<<<<<<<<< + * sys.stderr.write('GEOS_ERROR: %s\n' % warn_msg) + * + */ + Py_INCREF(__pyx_v_format); + Py_DECREF(__pyx_v_warn_msg); + __pyx_v_warn_msg = __pyx_v_format; + goto __pyx_L3; + } + __pyx_L3:; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":114 + * except: + * warn_msg = format + * sys.stderr.write('GEOS_ERROR: %s\n' % warn_msg) # <<<<<<<<<<<<<< + * + * # The initGEOS routine should be called first, however, that routine takes + */ + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_stderr); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_write); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyNumber_Remainder(__pyx_k8p, __pyx_v_warn_msg); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 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_py_4geos_12BaseGeometry_is_valid(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static PyObject *__pyx_f_py_4geos_12BaseGeometry_is_valid(PyObject *__pyx_v_self, PyObject *unused) { + char __pyx_v_valid; + PyObject *__pyx_r; + char __pyx_1; + Py_INCREF(__pyx_v_self); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":129 + * def is_valid(self): + * cdef char valid + * valid = GEOSisValid(self._geom) # <<<<<<<<<<<<<< + * if valid: + * return True + */ + __pyx_v_valid = GEOSisValid(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_self)->_geom); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":130 + * cdef char valid + * valid = GEOSisValid(self._geom) + * if valid: # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_1 = __pyx_v_valid; + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":131 + * valid = GEOSisValid(self._geom) + * if valid: + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + Py_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + goto __pyx_L2; + } + /*else*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":133 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * def geom_type(self): + */ + 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_f_py_4geos_12BaseGeometry_geom_type(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static PyObject *__pyx_f_py_4geos_12BaseGeometry_geom_type(PyObject *__pyx_v_self, PyObject *unused) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":136 + * + * def geom_type(self): + * return PyString_FromString(GEOSGeomType(self._geom)) # <<<<<<<<<<<<<< + * + * def within(self, BaseGeometry geom): + */ + __pyx_1 = PyString_FromString(GEOSGeomType(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_self)->_geom)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; 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 = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_py_4geos_12BaseGeometry_within(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/ +static PyObject *__pyx_f_py_4geos_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_4geos_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":141 + * cdef GEOSGeom *g1, *g2 + * cdef char answer + * g1 = self._geom # <<<<<<<<<<<<<< + * g2 = geom._geom + * answer = GEOSWithin(g1, g2) + */ + __pyx_v_g1 = ((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_self)->_geom; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":142 + * cdef char answer + * g1 = self._geom + * g2 = geom._geom # <<<<<<<<<<<<<< + * answer = GEOSWithin(g1, g2) + * if answer: + */ + __pyx_v_g2 = ((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_geom)->_geom; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":143 + * g1 = self._geom + * g2 = geom._geom + * answer = GEOSWithin(g1, g2) # <<<<<<<<<<<<<< + * if answer: + * return True + */ + __pyx_v_answer = GEOSWithin(__pyx_v_g1,__pyx_v_g2); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":144 + * g2 = geom._geom + * answer = GEOSWithin(g1, g2) + * if answer: # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_1 = __pyx_v_answer; + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":145 + * answer = GEOSWithin(g1, g2) + * if answer: + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + Py_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + goto __pyx_L2; + } + /*else*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":147 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * def intersects(self, BaseGeometry geom): + */ + 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 = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_geom); + return __pyx_r; +} + +static PyObject *__pyx_f_py_4geos_12BaseGeometry_intersects(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/ +static PyObject *__pyx_f_py_4geos_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_4geos_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":152 + * cdef GEOSGeom *g1, *g2 + * cdef char answer + * g1 = self._geom # <<<<<<<<<<<<<< + * g2 = geom._geom + * answer = GEOSIntersects(g1, g2) + */ + __pyx_v_g1 = ((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_self)->_geom; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":153 + * cdef char answer + * g1 = self._geom + * g2 = geom._geom # <<<<<<<<<<<<<< + * answer = GEOSIntersects(g1, g2) + * if answer: + */ + __pyx_v_g2 = ((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_geom)->_geom; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":154 + * g1 = self._geom + * g2 = geom._geom + * answer = GEOSIntersects(g1, g2) # <<<<<<<<<<<<<< + * if answer: + * return True + */ + __pyx_v_answer = GEOSIntersects(__pyx_v_g1,__pyx_v_g2); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":155 + * g2 = geom._geom + * answer = GEOSIntersects(g1, g2) + * if answer: # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_1 = __pyx_v_answer; + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":156 + * answer = GEOSIntersects(g1, g2) + * if answer: + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + Py_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + goto __pyx_L2; + } + /*else*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":158 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * def intersection(self, BaseGeometry geom): + */ + 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 = 0; + __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_k9p; + +static PyObject *__pyx_builtin_NotImplementedError; + +static char (__pyx_k9[]) = "intersections of type '%s' not yet implemented"; + +static PyObject *__pyx_f_py_4geos_12BaseGeometry_intersection(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/ +static PyObject *__pyx_f_py_4geos_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_p; + PyObject *__pyx_v_pout; + 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_p = Py_None; Py_INCREF(Py_None); + __pyx_v_pout = Py_None; Py_INCREF(Py_None); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_4geos_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":164 + * cdef char answer + * cdef int numgeoms, i, typeid + * g1 = self._geom # <<<<<<<<<<<<<< + * g2 = geom._geom + * g3 = GEOSIntersection(g1, g2) + */ + __pyx_v_g1 = ((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_self)->_geom; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":165 + * cdef int numgeoms, i, typeid + * g1 = self._geom + * g2 = geom._geom # <<<<<<<<<<<<<< + * g3 = GEOSIntersection(g1, g2) + * typeid = GEOSGeomTypeId(g3) + */ + __pyx_v_g2 = ((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_geom)->_geom; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":166 + * 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); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":167 + * g2 = geom._geom + * g3 = GEOSIntersection(g1, g2) + * typeid = GEOSGeomTypeId(g3) # <<<<<<<<<<<<<< + * if typeid == GEOS_POLYGON: + * p = Polygon() # create an empty Polygon instance + */ + __pyx_v_typeid = GEOSGeomTypeId(__pyx_v_g3); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":168 + * g3 = GEOSIntersection(g1, g2) + * typeid = GEOSGeomTypeId(g3) + * if typeid == GEOS_POLYGON: # <<<<<<<<<<<<<< + * p = Polygon() # create an empty Polygon instance + * p = _add_geom(p,g3) # add geometry to it. + */ + __pyx_1 = (__pyx_v_typeid == GEOS_POLYGON); + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":169 + * typeid = GEOSGeomTypeId(g3) + * if typeid == GEOS_POLYGON: + * p = Polygon() # create an empty Polygon instance # <<<<<<<<<<<<<< + * p = _add_geom(p,g3) # add geometry to it. + * # above should be faster than this .. + */ + __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4geos_Polygon), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":170 + * if typeid == GEOS_POLYGON: + * p = Polygon() # create an empty Polygon instance + * p = _add_geom(p,g3) # add geometry to it. # <<<<<<<<<<<<<< + * # above should be faster than this .. + * #b = _get_coords(g3) + */ + if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_4geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; goto __pyx_L1;} + __pyx_2 = __pyx_f_4geos__add_geom(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_p),__pyx_v_g3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":174 + * #b = _get_coords(g3) + * #p = Polygon(b) + * pout = [p] # return a list with a single element # <<<<<<<<<<<<<< + * elif typeid == GEOS_LINESTRING: + * p = LineString() + */ + __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; 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) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":176 + * pout = [p] # return a list with a single element + * elif typeid == GEOS_LINESTRING: + * p = LineString() # <<<<<<<<<<<<<< + * p = _add_geom(p,g3) + * return [p] + */ + __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4geos_LineString), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":177 + * elif typeid == GEOS_LINESTRING: + * p = LineString() + * p = _add_geom(p,g3) # <<<<<<<<<<<<<< + * return [p] + * elif typeid == GEOS_MULTIPOLYGON: + */ + if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_4geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L1;} + __pyx_2 = __pyx_f_4geos__add_geom(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_p),__pyx_v_g3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":178 + * p = LineString() + * p = _add_geom(p,g3) + * return [p] # <<<<<<<<<<<<<< + * elif typeid == GEOS_MULTIPOLYGON: + * numgeoms = GEOSGetNumGeometries(g3) + */ + __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;} + Py_INCREF(__pyx_v_p); + PyList_SET_ITEM(__pyx_2, 0, __pyx_v_p); + __pyx_r = __pyx_2; + __pyx_2 = 0; + goto __pyx_L0; + goto __pyx_L2; + } + __pyx_1 = (__pyx_v_typeid == GEOS_MULTIPOLYGON); + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":180 + * return [p] + * elif typeid == GEOS_MULTIPOLYGON: + * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<< + * pout = [] + * for i from 0 <= i < numgeoms: + */ + __pyx_v_numgeoms = GEOSGetNumGeometries(__pyx_v_g3); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":181 + * elif typeid == GEOS_MULTIPOLYGON: + * numgeoms = GEOSGetNumGeometries(g3) + * pout = [] # <<<<<<<<<<<<<< + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) + */ + __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} + Py_DECREF(__pyx_v_pout); + __pyx_v_pout = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":182 + * numgeoms = GEOSGetNumGeometries(g3) + * pout = [] + * for i from 0 <= i < numgeoms: # <<<<<<<<<<<<<< + * gout = GEOSGetGeometryN(g3, i) + * p = Polygon() # create an empty Polygon instance + */ + for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_numgeoms; __pyx_v_i++) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":183 + * pout = [] + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<< + * p = Polygon() # create an empty Polygon instance + * p = _add_geom(p,gout) # add geometry to it. + */ + __pyx_v_gout = GEOSGetGeometryN(__pyx_v_g3,__pyx_v_i); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":184 + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) + * p = Polygon() # create an empty Polygon instance # <<<<<<<<<<<<<< + * p = _add_geom(p,gout) # add geometry to it. + * pout.append(p) + */ + __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4geos_Polygon), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":185 + * gout = GEOSGetGeometryN(g3, i) + * p = Polygon() # create an empty Polygon instance + * p = _add_geom(p,gout) # add geometry to it. # <<<<<<<<<<<<<< + * pout.append(p) + * elif typeid == GEOS_MULTILINESTRING: + */ + if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_4geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;} + __pyx_2 = __pyx_f_4geos__add_geom(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_p),__pyx_v_gout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":186 + * p = Polygon() # create an empty Polygon instance + * p = _add_geom(p,gout) # add geometry to it. + * pout.append(p) # <<<<<<<<<<<<<< + * elif typeid == GEOS_MULTILINESTRING: + * numgeoms = GEOSGetNumGeometries(g3) + */ + __pyx_2 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} + Py_INCREF(__pyx_v_p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + } + goto __pyx_L2; + } + __pyx_1 = (__pyx_v_typeid == GEOS_MULTILINESTRING); + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":188 + * pout.append(p) + * elif typeid == GEOS_MULTILINESTRING: + * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<< + * pout = [] + * for i from 0 <= i < numgeoms: + */ + __pyx_v_numgeoms = GEOSGetNumGeometries(__pyx_v_g3); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":189 + * elif typeid == GEOS_MULTILINESTRING: + * numgeoms = GEOSGetNumGeometries(g3) + * pout = [] # <<<<<<<<<<<<<< + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) + */ + __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; goto __pyx_L1;} + Py_DECREF(__pyx_v_pout); + __pyx_v_pout = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":190 + * numgeoms = GEOSGetNumGeometries(g3) + * pout = [] + * for i from 0 <= i < numgeoms: # <<<<<<<<<<<<<< + * gout = GEOSGetGeometryN(g3, i) + * p = LineString() # create an empty Polygon instance + */ + for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_numgeoms; __pyx_v_i++) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":191 + * pout = [] + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<< + * p = LineString() # create an empty Polygon instance + * p = _add_geom(p,gout) # add geometry to it. + */ + __pyx_v_gout = GEOSGetGeometryN(__pyx_v_g3,__pyx_v_i); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":192 + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) + * p = LineString() # create an empty Polygon instance # <<<<<<<<<<<<<< + * p = _add_geom(p,gout) # add geometry to it. + * pout.append(p) + */ + __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_4geos_LineString), 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_3; + __pyx_3 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":193 + * gout = GEOSGetGeometryN(g3, i) + * p = LineString() # create an empty Polygon instance + * p = _add_geom(p,gout) # add geometry to it. # <<<<<<<<<<<<<< + * pout.append(p) + * else: + */ + if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_4geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;} + __pyx_4 = __pyx_f_4geos__add_geom(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_p),__pyx_v_gout); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_4; + __pyx_4 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":194 + * p = LineString() # create an empty Polygon instance + * p = _add_geom(p,gout) # add geometry to it. + * pout.append(p) # <<<<<<<<<<<<<< + * else: + * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) + */ + __pyx_2 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} + Py_INCREF(__pyx_v_p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + } + goto __pyx_L2; + } + /*else*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":196 + * pout.append(p) + * else: + * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) # <<<<<<<<<<<<<< + * return pout + * + */ + __pyx_2 = PyNumber_Remainder(__pyx_k9p, ((PyObject*)&PyType_Type)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_4 = PyObject_CallObject(__pyx_builtin_NotImplementedError, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} + } + __pyx_L2:; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":197 + * else: + * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) + * 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 = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_p); + Py_DECREF(__pyx_v_pout); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_geom); + return __pyx_r; +} + +static PyObject *__pyx_f_py_4geos_12BaseGeometry_get_coords(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static PyObject *__pyx_f_py_4geos_12BaseGeometry_get_coords(PyObject *__pyx_v_self, PyObject *unused) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":200 + * + * def get_coords(self): + * return _get_coords(self._geom) # <<<<<<<<<<<<<< + * + * cdef class Polygon(BaseGeometry): + */ + __pyx_1 = __pyx_f_4geos__get_coords(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_self)->_geom); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; 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 = 0; + __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_f_py_4geos_7Polygon___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_f_py_4geos_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}; + __pyx_v_b = __pyx_k4; + 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_4geos_ndarray, 1, "b"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":214 + * + * # just return an empty class + * if b is None: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_1 = (((PyObject *)__pyx_v_b) == Py_None); + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":215 + * # just return an empty class + * if b is None: + * return # <<<<<<<<<<<<<< + * + * # make sure data is contiguous. + */ + __pyx_r = 0; + goto __pyx_L0; + goto __pyx_L2; + } + __pyx_L2:; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":219 + * # 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) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":220 + * # if not, make a local copy. + * if not PyArray_ISCONTIGUOUS(b): + * b = b.copy() # <<<<<<<<<<<<<< + * + * m = b.shape[0] + */ + __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_b), __pyx_n_copy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4geos_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_b)); + __pyx_v_b = ((PyArrayObject *)__pyx_3); + __pyx_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":222 + * 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 = 222; 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 = 222; goto __pyx_L1;} + __pyx_4 = PyObject_GetItem(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; 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 = 222; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_v_m = __pyx_5; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":225 + * + * # 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 = 225; 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 = 225; 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 = 225; 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 = 225; 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 = 225; 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 = 225; 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 = 225; 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 = 225; 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 = 225; 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 = 225; 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 = 225; 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_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":226 + * # Add closing coordinates to sequence? + * if b[-1,0] != b[0,0] or b[-1,1] != b[0,1]: + * M = m + 1 # <<<<<<<<<<<<<< + * else: + * M = m + */ + __pyx_v_M = (__pyx_v_m + 1); + goto __pyx_L4; + } + /*else*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":228 + * M = m + 1 + * else: + * M = m # <<<<<<<<<<<<<< + * self._npts = M + * + */ + __pyx_v_M = __pyx_v_m; + } + __pyx_L4:; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":229 + * else: + * M = m + * self._npts = M # <<<<<<<<<<<<<< + * + * # Create a coordinate sequence + */ + ((struct __pyx_obj_4geos_Polygon *)__pyx_v_self)->__pyx_base._npts = __pyx_v_M; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":232 + * + * # Create a coordinate sequence + * cs = GEOSCoordSeq_create(M, 2) # <<<<<<<<<<<<<< + * + * # add to coordinate sequence + */ + __pyx_v_cs = GEOSCoordSeq_create(__pyx_v_M,2); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":235 + * + * # add to coordinate sequence + * bbuffer = <double *>b.data # <<<<<<<<<<<<<< + * for i from 0 <= i < m: + * dx = bbuffer[2*i] + */ + __pyx_v_bbuffer = ((double (*))__pyx_v_b->data); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":236 + * # add to coordinate sequence + * bbuffer = <double *>b.data + * for i from 0 <= i < m: # <<<<<<<<<<<<<< + * dx = bbuffer[2*i] + * dy = bbuffer[2*i+1] + */ + for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_m; __pyx_v_i++) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":237 + * bbuffer = <double *>b.data + * for i from 0 <= i < m: + * dx = bbuffer[2*i] # <<<<<<<<<<<<<< + * dy = bbuffer[2*i+1] + * # Because of a bug in the GEOS C API, + */ + __pyx_v_dx = (__pyx_v_bbuffer[(2 * __pyx_v_i)]); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":238 + * for i from 0 <= i < m: + * dx = bbuffer[2*i] + * dy = bbuffer[2*i+1] # <<<<<<<<<<<<<< + * # Because of a bug in the GEOS C API, + * # always set X before Y + */ + __pyx_v_dy = (__pyx_v_bbuffer[((2 * __pyx_v_i) + 1)]); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":241 + * # Because of a bug in the GEOS C API, + * # always set X before Y + * GEOSCoordSeq_setX(cs, i, dx) # <<<<<<<<<<<<<< + * GEOSCoordSeq_setY(cs, i, dy) + * + */ + GEOSCoordSeq_setX(__pyx_v_cs,__pyx_v_i,__pyx_v_dx); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":242 + * # always set X before Y + * GEOSCoordSeq_setX(cs, i, dx) + * GEOSCoordSeq_setY(cs, i, dy) # <<<<<<<<<<<<<< + * + * # Add closing coordinates to sequence? + */ + GEOSCoordSeq_setY(__pyx_v_cs,__pyx_v_i,__pyx_v_dy); + } + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":245 + * + * # Add closing coordinates to sequence? + * if M > m: # <<<<<<<<<<<<<< + * dx = bbuffer[0] + * dy = bbuffer[1] + */ + __pyx_1 = (__pyx_v_M > __pyx_v_m); + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":246 + * # Add closing coordinates to sequence? + * if M > m: + * dx = bbuffer[0] # <<<<<<<<<<<<<< + * dy = bbuffer[1] + * GEOSCoordSeq_setX(cs, M-1, dx) + */ + __pyx_v_dx = (__pyx_v_bbuffer[0]); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":247 + * if M > m: + * dx = bbuffer[0] + * dy = bbuffer[1] # <<<<<<<<<<<<<< + * GEOSCoordSeq_setX(cs, M-1, dx) + * GEOSCoordSeq_setY(cs, M-1, dy) + */ + __pyx_v_dy = (__pyx_v_bbuffer[1]); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":248 + * dx = bbuffer[0] + * dy = bbuffer[1] + * GEOSCoordSeq_setX(cs, M-1, dx) # <<<<<<<<<<<<<< + * GEOSCoordSeq_setY(cs, M-1, dy) + * + */ + GEOSCoordSeq_setX(__pyx_v_cs,(__pyx_v_M - 1),__pyx_v_dx); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":249 + * dy = bbuffer[1] + * GEOSCoordSeq_setX(cs, M-1, dx) + * GEOSCoordSeq_setY(cs, M-1, dy) # <<<<<<<<<<<<<< + * + * # create LinearRing + */ + GEOSCoordSeq_setY(__pyx_v_cs,(__pyx_v_M - 1),__pyx_v_dy); + goto __pyx_L7; + } + __pyx_L7:; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":252 + * + * # create LinearRing + * lr = GEOSGeom_createLinearRing(cs) # <<<<<<<<<<<<<< + * + * # create Polygon from LinearRing (assuming no holes) + */ + __pyx_v_lr = GEOSGeom_createLinearRing(__pyx_v_cs); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":255 + * + * # create Polygon from LinearRing (assuming no holes) + * self._geom = GEOSGeom_createPolygon(lr,NULL,0) # <<<<<<<<<<<<<< + * + * def area(self): + */ + ((struct __pyx_obj_4geos_Polygon *)__pyx_v_self)->__pyx_base._geom = GEOSGeom_createPolygon(__pyx_v_lr,NULL,0); + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_6); + __Pyx_AddTraceback("geos.Polygon.__init__"); + __pyx_r = -1; + __pyx_L0:; + Py_DECREF((PyObject *)__pyx_v_self); + Py_DECREF(__pyx_v_b); + return __pyx_r; +} + +static PyObject *__pyx_f_py_4geos_7Polygon_area(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static PyObject *__pyx_f_py_4geos_7Polygon_area(PyObject *__pyx_v_self, PyObject *unused) { + double __pyx_v_area; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF((PyObject *)__pyx_v_self); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":259 + * def area(self): + * cdef double area + * GEOS... [truncated message content] |
From: <js...@us...> - 2007-11-13 20:37:16
|
Revision: 4250 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4250&view=rev Author: jswhit Date: 2007-11-13 12:37:11 -0800 (Tue, 13 Nov 2007) Log Message: ----------- correct satellite height for geostationary example Modified Paths: -------------- trunk/toolkits/basemap-testing/examples/test.py Modified: trunk/toolkits/basemap-testing/examples/test.py =================================================================== --- trunk/toolkits/basemap-testing/examples/test.py 2007-11-13 18:10:32 UTC (rev 4249) +++ trunk/toolkits/basemap-testing/examples/test.py 2007-11-13 20:37:11 UTC (rev 4250) @@ -489,7 +489,7 @@ # setup of basemap ('geos' = geostationary projection) m = Basemap(projection='geos', rsphere=(6378137.00,6356752.3142),\ - resolution='c',area_thresh=10000.,lon_0=0,satellite_height=42500000.) + resolution='c',area_thresh=10000.,lon_0=0,satellite_height=35785831) # transform to nx x ny regularly spaced native projection grid # nx and ny chosen to have roughly the same horizontal res as original image. dx = 2.*pi*m.rmajor/len(lons) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2007-11-13 18:10:53
|
Revision: 4249 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4249&view=rev Author: dsdale Date: 2007-11-13 10:10:32 -0800 (Tue, 13 Nov 2007) Log Message: ----------- fixed some formatting issues in tconfig Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/config/tconfig.py trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.template Modified: trunk/matplotlib/lib/matplotlib/config/tconfig.py =================================================================== --- trunk/matplotlib/lib/matplotlib/config/tconfig.py 2007-11-13 16:39:12 UTC (rev 4248) +++ trunk/matplotlib/lib/matplotlib/config/tconfig.py 2007-11-13 18:10:32 UTC (rev 4249) @@ -76,6 +76,50 @@ # Utility functions ############################################################################ +def get_split_ind(seq, N): + """seq is a list of words. Return the index into seq such that + len(' '.join(seq[:ind])<=N + """ + + sLen = 0 + # todo: use Alex's xrange pattern from the cbook for efficiency + for (word, ind) in zip(seq, range(len(seq))): + sLen += len(word) + 1 # +1 to account for the len(' ') + if sLen>=N: return ind + return len(seq) + +def wrap(prefix, text, cols, max_lines=6): + 'wrap text with prefix at length cols' + pad = ' '*len(prefix.expandtabs()) + available = cols - len(pad) + + seq = text.split(' ') + Nseq = len(seq) + ind = 0 + lines = [] + while ind<Nseq: + lastInd = ind + ind += get_split_ind(seq[ind:], available) + lines.append(seq[lastInd:ind]) + + num_lines = len(lines) + abbr_end = max_lines // 2 + abbr_start = max_lines - abbr_end + lines_skipped = False + for i in range(num_lines): + if i == 0: + # add the prefix to the first line, pad with spaces otherwise + ret = prefix + ' '.join(lines[i]) + '\n' + elif i < abbr_start or i > num_lines-abbr_end-1: + ret += pad + ' '.join(lines[i]) + '\n' + else: + if not lines_skipped: + lines_skipped = True + ret += ' <...snipped %d lines...> \n' % (num_lines-max_lines) +# for line in lines[1:]: +# ret += pad + ' '.join(line) + '\n' + return ret[:-1] + def dedent(txt): """A modified version of textwrap.dedent, specialized for docstrings. @@ -115,44 +159,6 @@ return ''.join(lines) -def short_str(txt,line_length=80,max_lines=6): - """Shorten a text input if necessary. - """ - - assert max_lines%2==0,"max_lines must be even" - - if txt.count('\n') <= 1: - # Break up auto-generated text that can be *very* long but in just one - # line. - ltxt = len(txt) - max_len = line_length*max_lines - chunk = max_lines/2 - - if ltxt > max_len: - out = [] - for n in range(chunk): - out.append(txt[line_length*n:line_length*(n+1)]) - - out.append(' <...snipped %d chars...> ' % (ltxt-max_len)) - - for n in range(-chunk-1,0,1): - # Special-casing for the last step of the loop, courtesy of - # Python's idiotic string slicign semantics when the second - # argument is 0. Argh. - end = line_length*(n+1) - if end==0: end = None - out.append(txt[line_length*n:end]) - - txt = '\n'.join(out) - else: - nlines = ltxt/line_length - out = [ txt[line_length*n:line_length*(n+1)] - for n in range(nlines+1)] - if out: - txt = '\n'.join(out) - return txt - - def configObj2Str(cobj): """Dump a Configobj instance to a string.""" outstr = StringIO() @@ -463,7 +469,7 @@ # Get a short version of info with lines of max. 78 chars, so # that after commenting them out (with '# ') they are at most # 80-chars long. - out.append(comment(short_str(info,78-len(indent)),indent)) + out.append(comment(wrap('',info.replace('\n', ' '),78-len(indent)),indent)) except (KeyError,AttributeError): pass out.append(indent+('%s = %r' % (s,v))) Modified: trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.template =================================================================== --- trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.template 2007-11-13 16:39:12 UTC (rev 4248) +++ trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.template 2007-11-13 18:10:32 UTC (rev 4249) @@ -39,14 +39,13 @@ maskedarray = False # 'numpy' or 'numeric' or 'numarray' numerix = 'numpy' -# 'Africa/Abidjan' or 'Africa/Accra' or 'Africa/Addis_Ababa' or 'Africa/Algiers' -# or 'Africa/Asmara' or 'Africa/Asmera' or 'Africa/Bamako' or 'Africa/Bangui' o -# r 'Africa/Banjul' or 'Africa/Bissau' or 'Africa/Blantyre' or 'Africa/Brazzavil -# <...snipped 10590 chars...> -# or 'Turkey' or 'UCT' or 'US/Alaska' or 'US/Aleutian' or 'US/Arizona' or 'US/Ce -# ntral' or 'US/East-Indiana' or 'US/Eastern' or 'US/Hawaii' or 'US/Indiana-Star -# ke' or 'US/Michigan' or 'US/Mountain' or 'US/Pacific' or 'US/Pacific-New' or ' -# US/Samoa' or 'UTC' or 'Universal' or 'W-SU' or 'WET' or 'Zulu' or 'posixrules' +# 'Africa/Abidjan' or 'Africa/Accra' or 'Africa/Addis_Ababa' or +# 'Africa/Algiers' or 'Africa/Asmara' or 'Africa/Asmera' or 'Africa/Bamako' or +# 'Africa/Bangui' or 'Africa/Banjul' or 'Africa/Bissau' or 'Africa/Blantyre' +# <...snipped 156 lines...> +# 'US/Michigan' or 'US/Mountain' or 'US/Pacific' or 'US/Pacific-New' or +# 'US/Samoa' or 'UTC' or 'Universal' or 'W-SU' or 'WET' or 'Zulu' or +# 'posixrules' timezone = 'UTC' # 'toolbar2' or None toolbar = 'toolbar2' @@ -72,15 +71,15 @@ # name like 'orange', a hex color like '#efefef', a grayscale intensity # like '0.5', or an RGBA tuple (1,0,0,1) labelcolor = 'black' - # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' - # or 'large' or 'x-large' or 'xx-large' + # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or + # 'medium' or 'large' or 'x-large' or 'xx-large' labelsize = 'medium' # a value of type 'float' linewidth = 1.0 # one of: 0 | on | false | 1 | no | n | y | off | yes | true polargrid = True - # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' - # or 'large' or 'x-large' or 'xx-large' + # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or + # 'medium' or 'large' or 'x-large' or 'xx-large' titlesize = 'large' [[formatter]] @@ -88,8 +87,8 @@ limits = [-7.0, 7.0] [backend] - # one of: ps | qt4agg | fltkagg | gtkagg | agg | cairo | gtk | gtkcairo | wx - # agg | tkagg | qtagg | template | svg | cocoaagg | pdf | wx + # one of: ps | qt4agg | fltkagg | gtkagg | agg | cairo | gtk | gtkcairo | + # wxagg | tkagg | qtagg | template | svg | cocoaagg | pdf | wx use = 'Agg' [[cairo]] @@ -109,10 +108,10 @@ [[ps]] # 3 or 42 fonttype = 3 - # 'auto' or 'letter' or 'legal' or 'ledger' or 'A0' or 'A1' or 'A2' or ' - # A3' or 'A4' or 'A5' or 'A6' or 'A7' or 'A8' or 'A9' or 'A10' or 'B0' o - # r 'B1' or 'B2' or 'B3' or 'B4' or 'B5' or 'B6' or 'B7' or 'B8' or 'B9' - # or 'B10' + # 'auto' or 'letter' or 'legal' or 'ledger' or 'A0' or 'A1' or 'A2' or + # 'A3' or 'A4' or 'A5' or 'A6' or 'A7' or 'A8' or 'A9' or 'A10' or + # 'B0' or 'B1' or 'B2' or 'B3' or 'B4' or 'B5' or 'B6' or 'B7' or 'B8' + # or 'B9' or 'B10' papersize = 'letter' # a value of type 'bool' useafm = False @@ -189,16 +188,16 @@ serif = ['Bitstream Vera Serif', 'New Century Schoolbook', 'Century Schoolbook L', 'Utopia', 'ITC Bookman', 'Bookman', 'Nimbus Roman No9 L', 'Times New Roman', 'Times', 'Palatino', 'Charter', 'serif'] # a value of type 'float' size = 12.0 - # 'ultra-condensed' or 'extra-condensed' or 'condensed' or 'semi-condensed' - # or 'normal' or 'semi-expanded' or 'expanded' or 'extra-expanded' or 'ultra - # -expanded' or 'wider' or 'narrower' + # 'ultra-condensed' or 'extra-condensed' or 'condensed' or + # 'semi-condensed' or 'normal' or 'semi-expanded' or 'expanded' or + # 'extra-expanded' or 'ultra-expanded' or 'wider' or 'narrower' stretch = 'normal' # 'normal' or 'italic' or 'oblique' style = 'normal' # 'normal' or 'small-caps' variant = 'normal' - # 'normal' or 'bold' or 'bolder' or 'lighter' or 100 or 200 or 300 or 400 or - # 500 or 600 or 700 or 800 or 900 + # 'normal' or 'bold' or 'bolder' or 'lighter' or 100 or 200 or 300 or 400 + # or 500 or 600 or 700 or 800 or 900 weight = 'normal' [grid] @@ -214,18 +213,18 @@ [image] # a value of type 'float' or 'equal' or 'auto' aspect = 'equal' - # 'Accent' or 'Accent_r' or 'Blues' or 'Blues_r' or 'BrBG' or 'BrBG_r' or 'B - # uGn' or 'BuGn_r' or 'BuPu' or 'BuPu_r' or 'Dark2' or 'Dark2_r' or 'GnBu' o - # r 'GnBu_r' or 'Greens' or 'Greens_r' or 'Greys' or 'Greys_r' or 'OrRd' or - # <...snipped 1010 chars...> - # ist_stern' or 'gist_stern_r' or 'gist_yarg' or 'gist_yarg_r' or 'gray' or - # 'gray_r' or 'hot' or 'hot_r' or 'hsv' or 'hsv_r' or 'jet' or 'jet_r' or 'p - # ink' or 'pink_r' or 'prism' or 'prism_r' or 'spectral' or 'spectral_r' or - # 'spring' or 'spring_r' or 'summer' or 'summer_r' or 'winter' or 'winter_r' + # 'Accent' or 'Accent_r' or 'Blues' or 'Blues_r' or 'BrBG' or 'BrBG_r' or + # 'BuGn' or 'BuGn_r' or 'BuPu' or 'BuPu_r' or 'Dark2' or 'Dark2_r' or + # 'GnBu' or 'GnBu_r' or 'Greens' or 'Greens_r' or 'Greys' or 'Greys_r' or + # <...snipped 16 lines...> + # 'pink_r' or 'prism' or 'prism_r' or 'spectral' or 'spectral_r' or + # 'spring' or 'spring_r' or 'summer' or 'summer_r' or 'winter' or + # 'winter_r' cmap = 'jet' - # 'bilinear' or 'nearest' or 'bicubic' or 'spline16' or 'spline36' or 'hanni - # ng' or 'hamming' or 'hermite' or 'kaiser' or 'quadric' or 'catrom' or 'gau - # ssian' or 'bessel' or 'mitchell' or 'sinc' or 'lanczos' or 'blackman' + # 'bilinear' or 'nearest' or 'bicubic' or 'spline16' or 'spline36' or + # 'hanning' or 'hamming' or 'hermite' or 'kaiser' or 'quadric' or 'catrom' + # or 'gaussian' or 'bessel' or 'mitchell' or 'sinc' or 'lanczos' or + # 'blackman' interpolation = 'bilinear' # a value of type 'int' lut = 256 @@ -235,8 +234,8 @@ [legend] # a value of type 'float' axespad = 0.02 - # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' - # or 'large' or 'x-large' or 'xx-large' + # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or + # 'medium' or 'large' or 'x-large' or 'xx-large' fontsize = 'medium' # a value of type 'float' handlelen = 0.050000000000000003 @@ -246,9 +245,9 @@ isaxes = True # a value of type 'float' labelsep = 0.01 - # 'best' or 'upper right' or 'upper left' or 'lower left' or 'lower right' o - # r 'right' or 'center left' or 'center right' or 'lower center' or 'upper c - # enter' or 'center' + # 'best' or 'upper right' or 'upper left' or 'lower left' or 'lower right' + # or 'right' or 'center left' or 'center right' or 'lower center' or + # 'upper center' or 'center' loc = 'upper right' # a value of type 'float' markerscale = 1.0 @@ -274,9 +273,9 @@ linestyle = '-' # a value of type 'float' linewidth = 1.0 - # 'None' or 'o' or '.' or ',' or '^' or 'v' or '<' or '>' or 's' or '+' or ' - # x' or 'D' or 'd' or '1' or '2' or '3' or '4' or 'h' or 'H' or 'p' or '|' o - # r '_' + # 'None' or 'o' or '.' or ',' or '^' or 'v' or '<' or '>' or 's' or '+' or + # 'x' or 'D' or 'd' or '1' or '2' or '3' or '4' or 'h' or 'H' or 'p' or + # '|' or '_' marker = 'None' # a value of type 'float' markeredgewidth = 0.5 @@ -288,27 +287,27 @@ solid_joinstyle = 'miter' [mathtext] - # A fontconfig pattern. See the fontconfig user manual for more information - # . + # A fontconfig pattern. See the fontconfig user manual for more + # information. bf = 'serif:bold' - # A fontconfig pattern. See the fontconfig user manual for more information - # . + # A fontconfig pattern. See the fontconfig user manual for more + # information. cal = 'cursive' # a value of type 'bool' fallback_to_cm = True # 'cm' or 'stix' or 'stixsans' or 'custom' fontset = 'cm' - # A fontconfig pattern. See the fontconfig user manual for more information - # . + # A fontconfig pattern. See the fontconfig user manual for more + # information. it = 'serif:oblique' - # A fontconfig pattern. See the fontconfig user manual for more information - # . + # A fontconfig pattern. See the fontconfig user manual for more + # information. rm = 'serif' - # A fontconfig pattern. See the fontconfig user manual for more information - # . + # A fontconfig pattern. See the fontconfig user manual for more + # information. sf = 'sans' - # A fontconfig pattern. See the fontconfig user manual for more information - # . + # A fontconfig pattern. See the fontconfig user manual for more + # information. tt = 'monospace' [patch] @@ -368,8 +367,8 @@ color = 'black' # 'in' or 'out' direction = 'in' - # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' - # or 'large' or 'x-large' or 'xx-large' + # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or + # 'medium' or 'large' or 'x-large' or 'xx-large' labelsize = 'small' [[major]] @@ -391,8 +390,8 @@ color = 'black' # 'in' or 'out' direction = 'in' - # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' - # or 'large' or 'x-large' or 'xx-large' + # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or + # 'medium' or 'large' or 'x-large' or 'xx-large' labelsize = 'small' [[major]] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2007-11-13 16:40:06
|
Revision: 4248 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4248&view=rev Author: dsdale Date: 2007-11-13 08:39:12 -0800 (Tue, 13 Nov 2007) Log Message: ----------- modify formatting of comments in matplotlib.conf Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/config/mplconfig.py trunk/matplotlib/lib/matplotlib/config/mpltraits.py trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.template trunk/matplotlib/setup.py Modified: trunk/matplotlib/lib/matplotlib/config/mplconfig.py =================================================================== --- trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2007-11-13 16:08:33 UTC (rev 4247) +++ trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2007-11-13 16:39:12 UTC (rev 4248) @@ -43,11 +43,11 @@ the default values listed herein. Colors: for the color values below, you can either use - - a matplotlib color string, such as r, k, or b + - a matplotlib color string, such as r | k | b - an rgb tuple, such as (1.0, 0.5, 0.0) - a hex string, such as #ff00ff or ff00ff - a scalar grayscale intensity such as 0.75 - - a legal html color name, eg red, blue, darkslategray + - a legal html color name, eg red | blue | darkslategray Interactivity: see http://matplotlib.sourceforge.net/interactive.html. @@ -63,8 +63,6 @@ units = T.false class backend(TConfig): - """Valid backends are: 'GTKAgg', 'GTKCairo', 'QtAgg', 'Qt4Agg', - 'TkAgg', 'Agg', 'Cairo', 'PS', 'PDF', 'SVG'""" use = T.Trait('Agg', mplT.BackendHandler()) class cairo(TConfig): Modified: trunk/matplotlib/lib/matplotlib/config/mpltraits.py =================================================================== --- trunk/matplotlib/lib/matplotlib/config/mpltraits.py 2007-11-13 16:08:33 UTC (rev 4247) +++ trunk/matplotlib/lib/matplotlib/config/mpltraits.py 2007-11-13 16:39:12 UTC (rev 4248) @@ -24,18 +24,22 @@ class BackendHandler(T.TraitHandler): """ """ - backends = {'tkagg': 'TkAgg', + backends = {'agg': 'Agg', + 'cairo': 'Cairo', + 'cocoaagg': 'CocoaAgg', + 'fltkagg': 'FltkAgg', + 'gtk': 'GTK', 'gtkagg': 'GTKAgg', 'gtkcairo': 'GTKCairo', + 'pdf': 'Pdf', + 'ps': 'PS', 'qt4agg': 'Qt4Agg', 'qtagg': 'QtAgg', - 'wxagg': 'WXAgg', - 'agg': 'Agg', - 'cairo': 'Cairo', - 'ps': 'PS', - 'pdf': 'Pdf', 'svg': 'SVG', - 'template': 'Template' } + 'template': 'Template', + 'tkagg': 'TkAgg', + 'wx': 'WX', + 'wxagg': 'WXAgg'} def validate(self, object, name, value): try: @@ -46,7 +50,7 @@ def info(self): be = self.backends.keys() be.sort - return "one of %s"% ', '.join(['%s'%i for i in be]) + return "one of: %s"% ' | '.join(['%s'%i for i in be]) class BoolHandler(T.TraitHandler): @@ -73,7 +77,7 @@ return self.error(object, name, value) def info(self): - return "one of %s"% ', '.join(['%s'%i for i in self.bools.keys()]) + return "one of: %s"% ' | '.join(['%s'%i for i in self.bools.keys()]) flexible_true = T.Trait(True, BoolHandler()) flexible_false = T.Trait(False, BoolHandler()) Modified: trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.template =================================================================== --- trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.template 2007-11-13 16:08:33 UTC (rev 4247) +++ trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.template 2007-11-13 16:39:12 UTC (rev 4248) @@ -21,11 +21,11 @@ # the default values listed herein. # # Colors: for the color values below, you can either use -# - a matplotlib color string, such as r, k, or b +# - a matplotlib color string, such as r | k | b # - an rgb tuple, such as (1.0, 0.5, 0.0) # - a hex string, such as #ff00ff or ff00ff # - a scalar grayscale intensity such as 0.75 -# - a legal html color name, eg red, blue, darkslategray +# - a legal html color name, eg red | blue | darkslategray # # Interactivity: see http://matplotlib.sourceforge.net/interactive.html. # @@ -33,7 +33,7 @@ # a value of type 'str' datapath = '/usr/lib64/python2.5/site-packages/matplotlib/mpl-data' -# one of 0, on, false, 1, no, n, y, off, yes, true +# one of: 0 | on | false | 1 | no | n | y | off | yes | true interactive = False # a value of type 'bool' maskedarray = False @@ -64,9 +64,9 @@ # name like 'orange', a hex color like '#efefef', a grayscale intensity # like '0.5', or an RGBA tuple (1,0,0,1) facecolor = 'white' - # one of 0, on, false, 1, no, n, y, off, yes, true + # one of: 0 | on | false | 1 | no | n | y | off | yes | true grid = False - # one of 0, on, false, 1, no, n, y, off, yes, true + # one of: 0 | on | false | 1 | no | n | y | off | yes | true hold = True # any valid matplotlib color, eg an abbreviation like 'r' for red, a full # name like 'orange', a hex color like '#efefef', a grayscale intensity @@ -77,7 +77,7 @@ labelsize = 'medium' # a value of type 'float' linewidth = 1.0 - # one of 0, on, false, 1, no, n, y, off, yes, true + # one of: 0 | on | false | 1 | no | n | y | off | yes | true polargrid = True # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' # or 'large' or 'x-large' or 'xx-large' @@ -88,10 +88,8 @@ limits = [-7.0, 7.0] [backend] - # Valid backends are: 'GTKAgg', 'GTKCairo', 'QtAgg', 'Qt4Agg', - # 'TkAgg', 'Agg', 'Cairo', 'PS', 'PDF', 'SVG' - # one of ps, qt4agg, tkagg, gtkagg, agg, cairo, gtkcairo, wxagg, qtagg, temp - # late, svg, pdf + # one of: ps | qt4agg | fltkagg | gtkagg | agg | cairo | gtk | gtkcairo | wx + # agg | tkagg | qtagg | template | svg | cocoaagg | pdf | wx use = 'Agg' [[cairo]] Modified: trunk/matplotlib/setup.py =================================================================== --- trunk/matplotlib/setup.py 2007-11-13 16:08:33 UTC (rev 4247) +++ trunk/matplotlib/setup.py 2007-11-13 16:39:12 UTC (rev 4248) @@ -169,7 +169,6 @@ if options['build_gtk']: if hasgtk or (options['build_gtk'] is True): build_gdk(ext_modules, packages) - rc['backend'] = 'GTK' if options['build_gtkagg']: if hasgtk or (options['build_gtkagg'] is True): options['build_agg'] = 1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-13 16:08:34
|
Revision: 4247 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4247&view=rev Author: mdboom Date: 2007-11-13 08:08:33 -0800 (Tue, 13 Nov 2007) Log Message: ----------- Bugfix for polar plots. Modified Paths: -------------- branches/transforms/lib/matplotlib/projections/polar.py Modified: branches/transforms/lib/matplotlib/projections/polar.py =================================================================== --- branches/transforms/lib/matplotlib/projections/polar.py 2007-11-13 16:08:24 UTC (rev 4246) +++ branches/transforms/lib/matplotlib/projections/polar.py 2007-11-13 16:08:33 UTC (rev 4247) @@ -357,8 +357,9 @@ set_rgrids.__doc__ = cbook.dedent(set_rgrids.__doc__) % kwdocd - def set_xscale(self, *args, **kwargs): - raise NotImplementedError("You can not set the xscale on a polar plot.") + def set_xscale(self, scale, *args, **kwargs): + if scale != 'linear': + raise NotImplementedError("You can not set the xscale on a polar plot.") def set_xlim(self, *args, **kargs): # The xlim is fixed, no matter what you do This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-13 16:08:26
|
Revision: 4246 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4246&view=rev Author: mdboom Date: 2007-11-13 08:08:24 -0800 (Tue, 13 Nov 2007) Log Message: ----------- Don't clip ticks. Modified Paths: -------------- branches/transforms/lib/matplotlib/axis.py Modified: branches/transforms/lib/matplotlib/axis.py =================================================================== --- branches/transforms/lib/matplotlib/axis.py 2007-11-13 16:02:47 UTC (rev 4245) +++ branches/transforms/lib/matplotlib/axis.py 2007-11-13 16:08:24 UTC (rev 4246) @@ -110,8 +110,8 @@ def set_clip_path(self, clippath, transform=None): Artist.set_clip_path(self, clippath, transform) - self.tick1line.set_clip_path(clippath, transform) - self.tick2line.set_clip_path(clippath, transform) + #self.tick1line.set_clip_path(clippath, transform) + #self.tick2line.set_clip_path(clippath, transform) self.gridline.set_clip_path(clippath, transform) set_clip_path.__doc__ = Artist.set_clip_path.__doc__ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-13 16:02:53
|
Revision: 4245 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4245&view=rev Author: mdboom Date: 2007-11-13 08:02:47 -0800 (Tue, 13 Nov 2007) Log Message: ----------- Bug fixes. Modified Paths: -------------- branches/transforms/lib/matplotlib/axes.py branches/transforms/src/_backend_agg.cpp Modified: branches/transforms/lib/matplotlib/axes.py =================================================================== --- branches/transforms/lib/matplotlib/axes.py 2007-11-13 15:22:55 UTC (rev 4244) +++ branches/transforms/lib/matplotlib/axes.py 2007-11-13 16:02:47 UTC (rev 4245) @@ -4504,7 +4504,7 @@ if norm is not None: assert(isinstance(norm, mcolors.Normalize)) if cmap is not None: assert(isinstance(cmap, mcolors.Colormap)) if aspect is None: aspect = rcParams['image.aspect'] - # self.set_aspect(aspect) + self.set_aspect(aspect) if X is None and Y is None: im = mimage.AxesImage(self, cmap, norm, interpolation, origin, extent, Modified: branches/transforms/src/_backend_agg.cpp =================================================================== --- branches/transforms/src/_backend_agg.cpp 2007-11-13 15:22:55 UTC (rev 4244) +++ branches/transforms/src/_backend_agg.cpp 2007-11-13 16:02:47 UTC (rev 4245) @@ -282,7 +282,7 @@ double l, b, r, t; if (py_convert_bbox(cliprect.ptr(), l, b, r, t)) { - rasterizer->clip_box((int)l + 1, (int)b + 1, (int)r + 1, (int)t + 1); + rasterizer->clip_box((int)l + 1, height - (int)(b + 1), (int)r + 1, height - (int)(t + 1)); } _VERBOSE("RendererAgg::set_clipbox done"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-13 15:22:57
|
Revision: 4244 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4244&view=rev Author: mdboom Date: 2007-11-13 07:22:55 -0800 (Tue, 13 Nov 2007) Log Message: ----------- Merged revisions 4220-4243 via svnmerge from http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib ........ r4221 | dsdale | 2007-11-12 10:23:23 -0500 (Mon, 12 Nov 2007) | 3 lines option to disable building backend extension modules moved from setup.py to setup.cfg ........ r4222 | dsdale | 2007-11-12 10:36:08 -0500 (Mon, 12 Nov 2007) | 3 lines collect config package code in one location in setup.py, so it can easily be commented out for the next release. ........ r4223 | jdh2358 | 2007-11-12 11:31:28 -0500 (Mon, 12 Nov 2007) | 2 lines added some mlab imports back to pylab ........ r4231 | mdboom | 2007-11-12 13:10:25 -0500 (Mon, 12 Nov 2007) | 3 lines Provide way to access STIX "letterlike" symbols using LaTeX font commands. Add "stixsans" option to typeset math with sans-serif glyphs. ........ r4232 | mdboom | 2007-11-12 13:53:25 -0500 (Mon, 12 Nov 2007) | 4 lines [ 1691298 ] pcolormesh shows empty plot when plotting small time ranges Avoiding downcasting the data before we have to. ........ r4233 | mdboom | 2007-11-12 13:54:49 -0500 (Mon, 12 Nov 2007) | 4 lines [ 1660316 ] PolyInteractor verts call Should be calling get_verts() instead of .verts. (Thanks JPaul Rinehimer) ........ r4234 | mdboom | 2007-11-12 14:15:28 -0500 (Mon, 12 Nov 2007) | 3 lines [ 1638661 ] Toolbox Save button not saving file in GTK BE with Python2.5 ........ r4235 | mdboom | 2007-11-12 14:22:05 -0500 (Mon, 12 Nov 2007) | 3 lines [ 1545149 ] Problem rendering image in SVG backend Reading the image file should use binary mode. ........ r4236 | jdh2358 | 2007-11-12 15:08:11 -0500 (Mon, 12 Nov 2007) | 2 lines removed duplicate load import ........ r4237 | mdboom | 2007-11-12 15:27:33 -0500 (Mon, 12 Nov 2007) | 6 lines [ 1448342 ] FigureCanvasAgg.print_figure fails with StringIO 'file' Added support to write png to an arbitrary Python file-like object in the agg backend. Will continue to use faster C-only calls if the file-like object is in fact a file. Also, clean up exception handling in write_png. ........ r4238 | mdboom | 2007-11-12 15:45:15 -0500 (Mon, 12 Nov 2007) | 3 lines [ 1358130 ] Cannot get underscore in mathtext Fixed. ........ r4239 | dsdale | 2007-11-12 17:00:15 -0500 (Mon, 12 Nov 2007) | 2 lines expose remaining build options in setup.cfg. See setup.cfg for details ........ r4240 | dsdale | 2007-11-12 18:29:44 -0500 (Mon, 12 Nov 2007) | 2 lines updated default matplotlib.conf ........ r4241 | dsdale | 2007-11-12 18:38:12 -0500 (Mon, 12 Nov 2007) | 2 lines expose verbose build option in setup.cfg ........ r4242 | dsdale | 2007-11-13 08:50:29 -0500 (Tue, 13 Nov 2007) | 4 lines updated creation of default config files at build time: * modify matplotlib.conf based on available backends and setup.cfg * modify backend selection: SVG, Agg, TkAgg, WXAgg, GTK, GTKAgg, selection in setup.cfg ........ r4243 | mdboom | 2007-11-13 10:15:36 -0500 (Tue, 13 Nov 2007) | 2 lines All backends can write to file-like objects rather than only regular files. ........ Modified Paths: -------------- branches/transforms/CHANGELOG branches/transforms/Makefile branches/transforms/examples/mathtext_examples.py branches/transforms/lib/configobj.py branches/transforms/lib/dateutil/__init__.py branches/transforms/lib/matplotlib/_mathtext_data.py branches/transforms/lib/matplotlib/axes.py branches/transforms/lib/matplotlib/backends/backend_agg.py branches/transforms/lib/matplotlib/backends/backend_gtk.py branches/transforms/lib/matplotlib/backends/backend_pdf.py branches/transforms/lib/matplotlib/backends/backend_ps.py branches/transforms/lib/matplotlib/backends/backend_svg.py branches/transforms/lib/matplotlib/backends/backend_wx.py branches/transforms/lib/matplotlib/config/mplconfig.py branches/transforms/lib/matplotlib/config/rcsetup.py branches/transforms/lib/matplotlib/mathtext.py branches/transforms/lib/matplotlib/mlab.py branches/transforms/lib/matplotlib/pylab.py branches/transforms/lib/matplotlib/pyplot.py branches/transforms/lib/matplotlib/rcsetup.py branches/transforms/lib/pytz/__init__.py branches/transforms/matplotlibrc.template branches/transforms/setup.cfg.template branches/transforms/setup.py branches/transforms/setupext.py branches/transforms/src/_backend_agg.cpp Added Paths: ----------- branches/transforms/examples/stix_fonts_demo.py branches/transforms/lib/matplotlib/mpl-data/matplotlib.conf.template Removed Paths: ------------- branches/transforms/lib/matplotlib/mpl-data/matplotlib.conf branches/transforms/lib/matplotlib/mpl-data/matplotlib.conf.backup Property Changed: ---------------- branches/transforms/ Property changes on: branches/transforms ___________________________________________________________________ Name: svnmerge-integrated - /trunk/matplotlib:1-4219 + /trunk/matplotlib:1-4243 Modified: branches/transforms/CHANGELOG =================================================================== --- branches/transforms/CHANGELOG 2007-11-13 15:15:36 UTC (rev 4243) +++ branches/transforms/CHANGELOG 2007-11-13 15:22:55 UTC (rev 4244) @@ -1,3 +1,47 @@ +2007-11-13 All backends now support writing to a file-like object, not + just a regular file. savefig() can be passed a file-like + object in place of a file path. - MGD + +2007-11-13 Improved the default backend selection at build time: + SVG -> Agg -> TkAgg -> WXAgg -> GTK -> GTKAgg. The last usable + backend in this progression will be chosen in the default + config file. If a backend is defined in setup.cfg, that will + be the default backend - DSD + +2007-11-13 Improved creation of default config files at build time for + traited config package - DSD + +2007-11-12 Exposed all the build options in setup.cfg. These options are + read into a dict called "options" by setupext.py. Also, added + "-mpl" tags to the version strings for packages provided by + matplotlib. Versions provided by mpl will be identified and + updated on subsequent installs - DSD + +2007-11-12 Added support for STIX fonts. A new rcParam, + mathtext.fontset, can be used to choose between: + + 'cm': + The TeX/LaTeX Computer Modern fonts + + 'stix': + The STIX fonts (see stixfonts.org) + + 'stixsans': + The STIX fonts, using sans-serif glyphs by default + + 'custom': + A generic Unicode font, in which case the mathtext font + must be specified using mathtext.bf, mathtext.it, + mathtext.sf etc. + + Added a new example, stix_fonts_demo.py to show how to access + different fonts and unusual symbols. + + - MGD + +2007-11-12 Options to disable building backend extension modules moved + from setup.py to setup.cfg - DSD + 2007-11-09 Applied Martin Teichmann's patch 1828813: a QPainter is used in paintEvent, which has to be destroyed using the method end(). If matplotlib raises an exception before the call to end - and it Modified: branches/transforms/Makefile =================================================================== --- branches/transforms/Makefile 2007-11-13 15:15:36 UTC (rev 4243) +++ branches/transforms/Makefile 2007-11-13 15:22:55 UTC (rev 4244) @@ -1,6 +1,6 @@ # Makefile for matplotlib -PYTHON = /usr/bin/python2.5 +PYTHON = `which python` VERSION = `${PYTHON} setup.py --version` DISTFILES = API_CHANGES KNOWN_BUGS INSTALL README TODO license \ @@ -12,11 +12,11 @@ clean: ${PYTHON} setup.py clean;\ - rm -f *.png *.ps *.eps *.svg *.jpg + rm -f *.png *.ps *.eps *.svg *.jpg *.pdf find . -name "_tmp*.py" | xargs rm -f;\ find . \( -name "*~" -o -name "*.pyc" \) | xargs rm -f;\ - find examples \( -name "*.svg" -o -name "*.png" -o -name "*.ps" -o -name "*.eps" -o -name "*.tar" -o -name "*.gz" -o -name "*.log" -o -name "*.aux" -o -name "*.tex" \) | xargs rm -f - find unit \( -name "*.png" -o -name "*.ps" -o -name "*.eps" \) | xargs rm -f + find examples \( -name "*.svg" C-o -name "*.png" -o -name "*.pdf" -o -name "*.ps" -o -name "*.eps" -o -name "*.tar" -o -name "*.gz" -o -name "*.log" -o -name "*.aux" -o -name "*.tex" \) | xargs rm -f + find unit \( -name "*.png" -o -name "*.ps" -o -name "*.pdf" -o -name "*.eps" \) | xargs rm -f find . \( -name "#*" -o -name ".#*" -o -name ".*~" -o -name "*~" \) | xargs rm -f Modified: branches/transforms/examples/mathtext_examples.py =================================================================== --- branches/transforms/examples/mathtext_examples.py 2007-11-13 15:15:36 UTC (rev 4243) +++ branches/transforms/examples/mathtext_examples.py 2007-11-13 15:22:55 UTC (rev 4244) @@ -6,7 +6,7 @@ stests = [ r'Kerning: AVA $AVA$', - r'\$100.00 $\alpha$', + r'\$100.00 $\alpha \_$', r'$\frac{\$100.00}{y}$', r'$x y$', r'$x+y\ x=y\ x<y\ x:y\ x,y\ x@y$', @@ -49,7 +49,7 @@ r'$\widehat{abc}\widetilde{def}$', r'$\Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega$', r'$\alpha \beta \gamma \delta \epsilon \zeta \eta \theta \iota \lambda \mu \nu \xi \pi \kappa \rho \sigma \tau \upsilon \phi \chi \psi$', - #ur'Generic symbol: $\u23ce \mathrm{\ue0f2 \U0001D538}$' + ur'Generic symbol: $\u23ce \mathrm{\ue0f2 \U0001D538}$' ] from pylab import * @@ -66,7 +66,7 @@ print (i, s) text(0.1, -i, s, fontsize=20) - #savefig('mathtext_example') + savefig('mathtext_examples') #close('all') show() Copied: branches/transforms/examples/stix_fonts_demo.py (from rev 4243, trunk/matplotlib/examples/stix_fonts_demo.py) =================================================================== --- branches/transforms/examples/stix_fonts_demo.py (rev 0) +++ branches/transforms/examples/stix_fonts_demo.py 2007-11-13 15:22:55 UTC (rev 4244) @@ -0,0 +1,54 @@ +#!/usr/bin/env python + +import os, sys, re + +import gc + +stests = [ + r'$\mathcircled{123} \mathrm{\mathcircled{123}} \mathbf{\mathcircled{123}}$', + r'$\mathsf{Sans \Omega} \mathrm{\mathsf{Sans \Omega}} \mathbf{\mathsf{Sans \Omega}}$', + r'$\mathtt{Monospace}$', + r'$\mathcal{CALLIGRAPHIC}$', + r'$\mathbb{Blackboard \pi}$', + r'$\mathrm{\mathbb{Blackboard \pi}}$', + r'$\mathbf{\mathbb{Blackboard \pi}}$', + r'$\mathfrak{Fraktur} \mathbf{\mathfrak{Fraktur}}$', + r'$\mathscr{Script}$', + ur'Direct Unicode: $\u23ce \mathrm{\ue0f2 \U0001D538}$' + ] + +from pylab import * + +def doall(): + tests = stests + + figure(figsize=(8, (len(tests) * 1) + 2)) + plot([0, 0], 'r') + grid(False) + axis([0, 3, -len(tests), 0]) + yticks(arange(len(tests)) * -1) + for i, s in enumerate(tests): + print (i, s) + text(0.1, -i, s, fontsize=32) + + savefig('stix_fonts_example') + #close('all') + show() + +if '--latex' in sys.argv: + fd = open("stix_fonts_examples.ltx", "w") + fd.write("\\documentclass{article}\n") + fd.write("\\begin{document}\n") + fd.write("\\begin{enumerate}\n") + + for i, s in enumerate(stests): + s = re.sub(r"(?<!\\)\$", "$$", s) + fd.write("\\item %s\n" % s) + + fd.write("\\end{enumerate}\n") + fd.write("\\end{document}\n") + fd.close() + + os.system("pdflatex stix_fonts_examples.ltx") +else: + doall() Property changes on: branches/transforms/examples/stix_fonts_demo.py ___________________________________________________________________ Name: svn:executable + * Modified: branches/transforms/lib/configobj.py =================================================================== --- branches/transforms/lib/configobj.py 2007-11-13 15:15:36 UTC (rev 4243) +++ branches/transforms/lib/configobj.py 2007-11-13 15:22:55 UTC (rev 4244) @@ -109,7 +109,7 @@ True, False = 1, 0 -__version__ = '4.4.0' +__version__ = '4.4.0-mpl' __revision__ = '$Id: configobj.py 156 2006-01-31 14:57:08Z fuzzyman $' Modified: branches/transforms/lib/dateutil/__init__.py =================================================================== --- branches/transforms/lib/dateutil/__init__.py 2007-11-13 15:15:36 UTC (rev 4243) +++ branches/transforms/lib/dateutil/__init__.py 2007-11-13 15:22:55 UTC (rev 4244) @@ -6,4 +6,4 @@ """ __author__ = "Gustavo Niemeyer <gu...@ni...>" __license__ = "PSF License" -__version__ = "1.2" +__version__ = "1.2-mpl" Modified: branches/transforms/lib/matplotlib/_mathtext_data.py =================================================================== --- branches/transforms/lib/matplotlib/_mathtext_data.py 2007-11-13 15:15:36 UTC (rev 4243) +++ branches/transforms/lib/matplotlib/_mathtext_data.py 2007-11-13 15:22:55 UTC (rev 4244) @@ -115,6 +115,7 @@ r'%' : ('cmr10', 48), r'\$' : ('cmr10', 99), r'@' : ('cmr10', 111), + r'\_' : ('cmtt10', 79), r'\Gamma' : ('cmr10', 19), r'\Delta' : ('cmr10', 6), r'\Theta' : ('cmr10', 7), @@ -2234,6 +2235,7 @@ '$': 36, '{': 123, '}': 125, +'_': 95, 'imath': 0x131, 'circumflexaccent' : 770, 'combiningbreve' : 774, @@ -2263,482 +2265,207 @@ 'bigotimes': 10754 } -uni2tex = dict([(v,k) for k,v in tex2uni.items()]) - -tex2type1 = {'doteq': 'uni2250', -'partial': 'uni2202', -'gg': 'uni226B', -'asymp': 'uni224D', -'blacktriangledown': 'uni25BE', -'otimes': 'uni2297', -'nearrow': 'uni2197', -'varpi': 'uni03D6', -'vee': 'uni2228', -'vec': 'uni20D7', -'smile': 'uni2323', -'succnsim': 'uni22E9', -'gimel': 'uni2137', -'vert': 'bar', -'varrho': 'uni03F1', -'P': 'paragraph', -'approxident': 'uni224B', -'Swarrow': 'uni21D9', -'textasciicircum': 'asciicircum', -'imageof': 'uni22B7', -'ntriangleleft': 'uni22EA', -'nleq': 'uni2270', -'div': 'divide', -'nparallel': 'uni2226', -'Leftarrow': 'uni21D0', -'lll': 'uni22D8', -'oiint': 'uni222F', -'ngeq': 'uni2271', -'Theta': 'uni0398', -'origof': 'uni22B6', -'blacksquare': 'uni25A0', -'hspace': 'uni200A', -'solbar': 'uni233F', -'neg': 'logicalnot', -'sum': 'uni2211', -'Vdash': 'uni22A9', -'coloneq': 'uni2254', -'degree': 'degree', -'bowtie': 'uni22C8', -'blacktriangleright': 'uni25B6', -'varsigma': 'uni03C2', -'leq': 'uni2264', -'ggg': 'uni22D9', -'lneqq': 'uni2268', -'scurel': 'uni22B1', -'stareq': 'uni225B', -'BbbN': 'uni2115', -'nLeftarrow': 'uni21CD', -'nLeftrightarrow': 'uni21CE', -'k': 'uni0328', -'bot': 'uni22A5', -'BbbC': 'uni2102', -'Lsh': 'uni21B0', -'leftleftarrows': 'uni21C7', -'BbbZ': 'uni2124', -'digamma': 'uni03DD', -'BbbR': 'uni211D', -'BbbP': 'uni2119', -'BbbQ': 'uni211A', -'vartriangleright': 'uni22B3', -'succsim': 'uni227F', -'wedge': 'uni2227', -'lessgtr': 'uni2276', -'veebar': 'uni22BB', -'mapsdown': 'uni21A7', -'Rsh': 'uni21B1', -'chi': 'uni03C7', -'prec': 'uni227A', -'nsubseteq': 'uni2288', -'therefore': 'uni2234', -'eqcirc': 'uni2256', -'textexclamdown': 'exclamdown', -'nRightarrow': 'uni21CF', -'flat': 'uni266D', -'notin': 'uni2209', -'llcorner': 'uni231E', -'varepsilon': 'uni03B5', -'bigtriangleup': 'uni25B3', -'aleph': 'uni2135', -'dotminus': 'uni2238', -'upsilon': 'uni03C5', -'Lambda': 'uni039B', -'cap': 'uni2229', -'barleftarrow': 'uni21E4', -'mu': 'uni03BC', -'boxplus': 'uni229E', -'mp': 'uni2213', -'circledast': 'uni229B', -'tau': 'uni03C4', -'in': 'uni2208', -'backslash': 'backslash', -'varnothing': 'uni2205', -'sharp': 'uni266F', -'eqsim': 'uni2242', -'gnsim': 'uni22E7', -'Searrow': 'uni21D8', -'updownarrows': 'uni21C5', -'heartsuit': 'uni2661', -'trianglelefteq': 'uni22B4', -'ddag': 'daggerdbl', -'sqsubseteq': 'uni2291', -'mapsfrom': 'uni21A4', -'boxbar': 'uni25EB', -'sim': 'uni223C', -'Nwarrow': 'uni21D6', -'nequiv': 'uni2262', -'succ': 'uni227B', -'vdash': 'uni22A2', -'Leftrightarrow': 'uni21D4', -'parallel': 'uni2225', -'invnot': 'uni2310', -'natural': 'uni266E', -'ss': 'germandbls', -'uparrow': 'uni2191', -'nsim': 'uni2241', -'hookrightarrow': 'uni21AA', -'Equiv': 'uni2263', -'approx': 'uni2248', -'Vvdash': 'uni22AA', -'nsucc': 'uni2281', -'leftrightharpoons': 'uni21CB', -'Re': 'uni211C', -'boxminus': 'uni229F', -'equiv': 'uni2261', -'Lleftarrow': 'uni21DA', -'thinspace': 'uni2009', -'ll': 'uni226A', -'Cup': 'uni22D3', -'measeq': 'uni225E', -'upharpoonleft': 'uni21BF', -'lq': 'quoteleft', -'Upsilon': 'uni03D2', -'subsetneq': 'uni228A', -'greater': 'greater', -'supsetneq': 'uni228B', -'Cap': 'uni22D2', -'L': 'Lslash', -'spadesuit': 'uni2660', -'lrcorner': 'uni231F', -'not': 'uni0338', -'bar': 'uni0304', -'rightharpoonaccent': 'uni20D1', -'boxdot': 'uni22A1', -'l': 'lslash', -'leftharpoondown': 'uni21BD', -'bigcup': 'uni22C3', -'iint': 'uni222C', -'bigwedge': 'uni22C0', -'downharpoonleft': 'uni21C3', -'textasciitilde': 'asciitilde', -'subset': 'uni2282', -'leqq': 'uni2266', -'mapsup': 'uni21A5', -'nvDash': 'uni22AD', -'looparrowleft': 'uni21AB', -'nless': 'uni226E', -'rightarrowbar': 'uni21E5', -'Vert': 'uni2016', -'downdownarrows': 'uni21CA', -'uplus': 'uni228E', -'simeq': 'uni2243', -'napprox': 'uni2249', -'ast': 'uni2217', -'twoheaduparrow': 'uni219F', -'doublebarwedge ?': 'uni2306', -'Sigma': 'uni03A3', -'leftharpoonaccent': 'uni20D0', -'ntrianglelefteq': 'uni22EC', -'nexists': 'uni2204', -'times': 'multiply', -'measuredangle': 'uni2221', -'bumpeq': 'uni224F', -'carriagereturn': 'uni21B5', -'adots': 'uni22F0', -'checkmark': 'uni2713', -'lambda': 'uni03BB', -'xi': 'uni03BE', -'rbrace': 'braceright', -'rbrack': 'bracketright', -'Nearrow': 'uni21D7', -'maltese': 'uni2720', -'clubsuit': 'uni2663', -'top': 'uni22A4', -'overarc': 'uni0311', -'varphi': 'uni03C6', -'Delta': 'uni0394', -'iota': 'uni03B9', -'nleftarrow': 'uni219A', -'candra': 'uni0310', -'supset': 'uni2283', -'triangleleft': 'uni25C1', -'gtreqless': 'uni22DB', -'ntrianglerighteq': 'uni22ED', -'quad': 'uni2003', -'Xi': 'uni039E', -'gtrdot': 'uni22D7', -'leftthreetimes': 'uni22CB', -'minus': 'minus', -'preccurlyeq': 'uni227C', -'nleftrightarrow': 'uni21AE', -'lambdabar': 'uni019B', -'blacktriangle': 'uni25B4', -'kernelcontraction': 'uni223B', -'Phi': 'uni03A6', -'angle': 'uni2220', -'spadesuitopen': 'uni2664', -'eqless': 'uni22DC', -'mid': 'uni2223', -'varkappa': 'uni03F0', -'Ldsh': 'uni21B2', -'updownarrow': 'uni2195', -'beta': 'uni03B2', -'textquotedblleft': 'quotedblleft', -'rho': 'uni03C1', -'alpha': 'uni03B1', -'intercal': 'uni22BA', -'beth': 'uni2136', -'grave': 'uni0300', -'acwopencirclearrow': 'uni21BA', -'nmid': 'uni2224', -'nsupset': 'uni2285', -'sigma': 'uni03C3', -'dot': 'uni0307', -'Rightarrow': 'uni21D2', -'turnednot': 'uni2319', -'backsimeq': 'uni22CD', -'leftarrowtail': 'uni21A2', -'approxeq': 'uni224A', -'curlyeqsucc': 'uni22DF', -'rightarrowtail': 'uni21A3', -'Psi': 'uni03A8', -'copyright': 'copyright', -'yen': 'yen', -'vartriangleleft': 'uni22B2', -'rasp': 'uni02BC', -'triangleright': 'uni25B7', -'precsim': 'uni227E', -'infty': 'uni221E', -'geq': 'uni2265', -'updownarrowbar': 'uni21A8', -'precnsim': 'uni22E8', -'H': 'uni030B', -'ulcorner': 'uni231C', -'looparrowright': 'uni21AC', -'ncong': 'uni2247', -'downarrow': 'uni2193', -'circeq': 'uni2257', -'subseteq': 'uni2286', -'bigstar': 'uni2605', -'prime': 'uni2032', -'lceil': 'uni2308', -'Rrightarrow': 'uni21DB', -'oiiint': 'uni2230', -'curlywedge': 'uni22CF', -'vDash': 'uni22A8', -'lfloor': 'uni230A', -'ddots': 'uni22F1', -'exists': 'uni2203', -'underbar': 'uni0331', -'Pi': 'uni03A0', -'leftrightarrows': 'uni21C6', -'sphericalangle': 'uni2222', -'coprod': 'uni2210', -'circledcirc': 'uni229A', -'gtrsim': 'uni2273', -'gneqq': 'uni2269', -'between': 'uni226C', -'theta': 'uni03B8', -'complement': 'uni2201', -'arceq': 'uni2258', -'nVdash': 'uni22AE', -'S': 'section', -'wr': 'uni2240', -'wp': 'uni2118', -'backcong': 'uni224C', -'lasp': 'uni02BD', -'c': 'uni0327', -'nabla': 'uni2207', -'dotplus': 'uni2214', -'eta': 'uni03B7', -'forall': 'uni2200', -'eth': 'eth', -'colon': 'colon', -'sqcup': 'uni2294', -'rightrightarrows': 'uni21C9', -'sqsupset': 'uni2290', -'mapsto': 'uni21A6', -'bigtriangledown': 'uni25BD', -'sqsupseteq': 'uni2292', -'propto': 'uni221D', -'pi': 'uni03C0', -'pm': 'plusminus', -'dots': 'ellipsis', -'nrightarrow': 'uni219B', -'textasciiacute': 'acute', -'Doteq': 'uni2251', -'breve': 'uni0306', -'sqcap': 'uni2293', -'twoheadrightarrow': 'uni21A0', -'kappa': 'uni03BA', -'vartriangle': 'uni25B5', -'diamondsuit': 'uni2662', -'pitchfork': 'uni22D4', -'blacktriangleleft': 'uni25C0', -'nprec': 'uni2280', -'vdots': 'uni22EE', -'curvearrowright': 'uni21B7', -'barwedge': 'uni22BC', -'multimap': 'uni22B8', -'textquestiondown': 'questiondown', -'cong': 'uni2245', -'rtimes': 'uni22CA', -'rightzigzagarrow': 'uni21DD', -'rightarrow': 'uni2192', -'leftarrow': 'uni2190', -'__sqrt__': 'uni221A', -'twoheaddownarrow': 'uni21A1', -'oint': 'uni222E', -'bigvee': 'uni22C1', -'eqdef': 'uni225D', -'sterling': 'sterling', -'phi': 'uni03D5', -'Updownarrow': 'uni21D5', -'backprime': 'uni2035', -'emdash': 'emdash', -'Gamma': 'uni0393', -'i': 'dotlessi', -'rceil': 'uni2309', -'leftharpoonup': 'uni21BC', -'Im': 'uni2111', -'curvearrowleft': 'uni21B6', -'wedgeq': 'uni2259', -'fallingdotseq': 'uni2252', -'curlyeqprec': 'uni22DE', -'questeq': 'uni225F', -'less': 'less', -'upuparrows': 'uni21C8', -'tilde': 'uni0303', -'textasciigrave': 'grave', -'smallsetminus': 'uni2216', -'ell': 'uni2113', -'cup': 'uni222A', -'danger': 'uni2621', -'nVDash': 'uni22AF', -'cdotp': 'periodcentered', -'cdots': 'uni22EF', -'hat': 'uni0302', -'eqgtr': 'uni22DD', -'enspace': 'uni2002', -'psi': 'uni03C8', -'frown': 'uni2322', -'acute': 'uni0301', -'downzigzagarrow': 'uni21AF', -'ntriangleright': 'uni22EB', -'cupdot': 'uni228D', -'circleddash': 'uni229D', -'oslash': 'uni2298', -'mho': 'uni2127', -'d': 'uni0323', -'sqsubset': 'uni228F', -'cdot': 'uni22C5', -'Omega': 'uni03A9', -'OE': 'OE', -'veeeq': 'uni225A', -'Finv': 'uni2132', -'t': 'uni0361', -'leftrightarrow': 'uni2194', -'swarrow': 'uni2199', -'rightthreetimes': 'uni22CC', -'rightleftharpoons': 'uni21CC', -'lesssim': 'uni2272', -'searrow': 'uni2198', -'because': 'uni2235', -'gtrless': 'uni2277', -'star': 'uni22C6', -'nsubset': 'uni2284', -'zeta': 'uni03B6', -'dddot': 'uni20DB', -'bigcirc': 'uni25CB', -'Supset': 'uni22D1', -'circ': 'uni2218', -'slash': 'uni2215', -'ocirc': 'uni030A', -'prod': 'uni220F', -'twoheadleftarrow': 'uni219E', -'daleth': 'uni2138', -'upharpoonright': 'uni21BE', -'odot': 'uni2299', -'Uparrow': 'uni21D1', -'O': 'Oslash', -'hookleftarrow': 'uni21A9', -'trianglerighteq': 'uni22B5', -'nsime': 'uni2244', -'oe': 'oe', -'nwarrow': 'uni2196', -'o': 'oslash', -'ddddot': 'uni20DC', -'downharpoonright': 'uni21C2', -'succcurlyeq': 'uni227D', -'gamma': 'uni03B3', -'scrR': 'uni211B', -'dag': 'dagger', -'thickspace': 'uni2005', -'frakZ': 'uni2128', -'lessdot': 'uni22D6', -'triangledown': 'uni25BF', -'ltimes': 'uni22C9', -'scrB': 'uni212C', -'endash': 'endash', -'scrE': 'uni2130', -'scrF': 'uni2131', -'scrH': 'uni210B', -'scrI': 'uni2110', -'rightharpoondown': 'uni21C1', -'scrL': 'uni2112', -'scrM': 'uni2133', -'frakC': 'uni212D', -'nsupseteq': 'uni2289', -'circledR': 'registered', -'circledS': 'uni24C8', -'ngtr': 'uni226F', -'bigcap': 'uni22C2', -'scre': 'uni212F', -'Downarrow': 'uni21D3', -'scrg': 'uni210A', -'overleftrightarrow': 'uni20E1', -'scro': 'uni2134', -'lnsim': 'uni22E6', -'eqcolon': 'uni2255', -'curlyvee': 'uni22CE', -'urcorner': 'uni231D', -'lbrace': 'braceleft', -'Bumpeq': 'uni224E', -'delta': 'uni03B4', -'boxtimes': 'uni22A0', -'overleftarrow': 'uni20D6', -'prurel': 'uni22B0', -'clubsuitopen': 'uni2667', -'cwopencirclearrow': 'uni21BB', -'geqq': 'uni2267', -'rightleftarrows': 'uni21C4', -'ac': 'uni223E', -'ae': 'ae', -'int': 'uni222B', -'rfloor': 'uni230B', -'risingdotseq': 'uni2253', -'nvdash': 'uni22AC', -'diamond': 'uni22C4', -'ddot': 'uni0308', -'backsim': 'uni223D', -'oplus': 'uni2295', -'triangleq': 'uni225C', -'check': 'uni030C', -'ni': 'uni220B', -'iiint': 'uni222D', -'ne': 'uni2260', -'lesseqgtr': 'uni22DA', -'obar': 'uni233D', -'supseteq': 'uni2287', -'nu': 'uni03BD', -'AA': 'uni212B', -'AE': 'AE', -'models': 'uni22A7', -'ominus': 'uni2296', -'dashv': 'uni22A3', -'omega': 'uni03C9', -'rq': 'quoteright', -'Subset': 'uni22D0', -'rightharpoonup': 'uni21C0', -'Rdsh': 'uni21B3', -'bullet': 'uni2219', -'divideontimes': 'uni22C7', -'lbrack': 'bracketleft', -'textquotedblright': 'quotedblright', -'Colon': 'uni2237'} - -type12tex = dict([(v,k) for k,v in tex2type1.items()]) +# Each element is a 4-tuple of the form: +# src_start, src_end, dst_font, dst_start +# +stix_virtual_fonts = { + 'bb': + { + 'rm': + [ + (0x0030, 0x0039, 'rm', 0x1d7d8), # 0-9 + (0x0041, 0x0042, 'rm', 0x1d538), # A-B + (0x0043, 0x0043, 'rm', 0x2102), # C + (0x0044, 0x0047, 'rm', 0x1d53b), # D-G + (0x0048, 0x0048, 'rm', 0x210d), # H + (0x0049, 0x004d, 'rm', 0x1d540), # I-M + (0x004e, 0x004e, 'rm', 0x2115), # N + (0x004f, 0x004f, 'rm', 0x1d546), # O + (0x0050, 0x0051, 'rm', 0x2119), # P-Q + (0x0052, 0x0052, 'rm', 0x211d), # R + (0x0053, 0x0059, 'rm', 0x1d54a), # S-Y + (0x005a, 0x005a, 'rm', 0x2124), # Z + (0x0061, 0x007a, 'rm', 0x1d552), # a-z + (0x0393, 0x0393, 'rm', 0x213e), # \Gamma + (0x03a0, 0x03a0, 'rm', 0x213f), # \Pi + (0x03a3, 0x03a3, 'rm', 0x2140), # \Sigma + (0x03b3, 0x03b3, 'rm', 0x213d), # \gamma + (0x03c0, 0x03c0, 'rm', 0x213c), # \pi + ], + 'it': + [ + (0x0041, 0x0041, 'it', 0xe154), # A-B + (0x0043, 0x0043, 'it', 0x2102), # C (missing in beta STIX fonts) + (0x0044, 0x0044, 'it', 0x2145), # D + (0x0045, 0x0047, 'it', 0xe156), # E-G + (0x0048, 0x0048, 'it', 0x210d), # H (missing in beta STIX fonts) + (0x0049, 0x004d, 'it', 0xe159), # I-M + (0x004e, 0x004e, 'it', 0x2115), # N (missing in beta STIX fonts) + (0x004f, 0x004f, 'it', 0xe15e), # O + (0x0050, 0x0051, 'it', 0x2119), # P-Q (missing in beta STIX fonts) + (0x0052, 0x0052, 'it', 0x211d), # R (missing in beta STIX fonts) + (0x0053, 0x0059, 'it', 0xe15f), # S-Y + (0x005a, 0x005a, 'it', 0x2124), # Z (missing in beta STIX fonts) + (0x0061, 0x0063, 'it', 0xe166), # a-c + (0x0064, 0x0065, 'it', 0x2146), # d-e + (0x0066, 0x0068, 'it', 0xe169), # f-h + (0x0069, 0x006a, 'it', 0x2148), # i-j + (0x006b, 0x007a, 'it', 0xe16c), # k-z + (0x0393, 0x0393, 'it', 0x213e), # \Gamma (missing in beta STIX fonts) + (0x03a0, 0x03a0, 'it', 0x213f), # \Pi + (0x03a3, 0x03a3, 'it', 0x2140), # \Sigma (missing in beta STIX fonts) + (0x03b3, 0x03b3, 'it', 0x213d), # \gamma (missing in beta STIX fonts) + (0x03c0, 0x03c0, 'it', 0x213c), # \pi + ], + 'bf': + [ + (0x0030, 0x0039, 'rm', 0x1d7d8), # 0-9 + (0x0041, 0x005a, 'bf', 0xe38a), # A-Z + (0x0061, 0x007a, 'bf', 0xe39d), # a-z + (0x0393, 0x0393, 'bf', 0x213e), # \Gamma + (0x03a0, 0x03a0, 'bf', 0x213f), # \Pi + (0x03a3, 0x03a3, 'bf', 0x2140), # \Sigma + (0x03b3, 0x03b3, 'bf', 0x213d), # \gamma + (0x03c0, 0x03c0, 'bf', 0x213c), # \pi + ], + }, + 'cal': + [ + (0x0041, 0x005a, 'it', 0xe22d), # A-Z + ], + 'circled': + { + 'rm': + [ + (0x0030, 0x0030, 'rm', 0x24ea), # 0 + (0x0031, 0x0039, 'rm', 0x2460), # 1-9 + (0x0041, 0x005a, 'rm', 0x24b6), # A-Z + (0x0061, 0x007a, 'rm', 0x24d0) # a-z + ], + 'it': + [ + (0x0030, 0x0030, 'it', 0x24ea), # 0 + (0x0031, 0x0039, 'it', 0x2460), # 1-9 + (0x0041, 0x005a, 'it', 0x24b6), # A-Z + (0x0061, 0x007a, 'it', 0x24d0) # a-z + ], + 'bf': + [ + (0x0030, 0x0030, 'bf', 0x24ea), # 0 + (0x0031, 0x0039, 'bf', 0x2460), # 1-9 + (0x0041, 0x005a, 'bf', 0x24b6), # A-Z + (0x0061, 0x007a, 'bf', 0x24d0) # a-z + ], + }, + 'frak': + { + 'rm': + [ + (0x0041, 0x0042, 'rm', 0x1d504), # A-B + (0x0043, 0x0043, 'rm', 0x212d), # C + (0x0044, 0x0047, 'rm', 0x1d507), # D-G + (0x0048, 0x0048, 'rm', 0x210c), # H + (0x0049, 0x0049, 'rm', 0x2111), # I + (0x004a, 0x0051, 'rm', 0x1d50d), # J-Q + (0x0052, 0x0052, 'rm', 0x211c), # R + (0x0053, 0x0059, 'rm', 0x1d516), # S-Y + (0x005a, 0x005a, 'rm', 0x2128), # Z + (0x0061, 0x007a, 'rm', 0x1d51e), # a-z + ], + 'it': + [ + (0x0041, 0x0042, 'rm', 0x1d504), # A-B + (0x0043, 0x0043, 'rm', 0x212d), # C + (0x0044, 0x0047, 'rm', 0x1d507), # D-G + (0x0048, 0x0048, 'rm', 0x210c), # H + (0x0049, 0x0049, 'rm', 0x2111), # I + (0x004a, 0x0051, 'rm', 0x1d50d), # J-Q + (0x0052, 0x0052, 'rm', 0x211c), # R + (0x0053, 0x0059, 'rm', 0x1d516), # S-Y + (0x005a, 0x005a, 'rm', 0x2128), # Z + (0x0061, 0x007a, 'rm', 0x1d51e), # a-z + ], + 'bf': + [ + (0x0041, 0x005a, 'bf', 0x1d56c), # A-Z + (0x0061, 0x007a, 'bf', 0x1d586), # a-z + ], + }, + 'scr': + [ + (0x0041, 0x0041, 'it', 0x1d49c), # A + (0x0042, 0x0042, 'it', 0x212c), # B + (0x0043, 0x0044, 'it', 0x1d49e), # C-D + (0x0045, 0x0046, 'it', 0x2130), # E-F + (0x0047, 0x0047, 'it', 0x1d4a2), # G + (0x0048, 0x0048, 'it', 0x210b), # H + (0x0049, 0x0049, 'it', 0x2110), # I + (0x004a, 0x004b, 'it', 0x1d4a5), # J-K + (0x004c, 0x004c, 'it', 0x2112), # L + (0x004d, 0x003d, 'it', 0x2113), # M + (0x004e, 0x0051, 'it', 0x1d4a9), # N-Q + (0x0052, 0x0052, 'it', 0x211b), # R + (0x0053, 0x005a, 'it', 0x1d4ae), # S-Z + (0x0061, 0x0064, 'it', 0x1d4b6), # a-d + (0x0065, 0x0065, 'it', 0x212f), # e + (0x0066, 0x0066, 'it', 0x1d4bb), # f + (0x0067, 0x0067, 'it', 0x210a), # g + (0x0068, 0x006e, 'it', 0x1d4bd), # h-n + (0x006f, 0x006f, 'it', 0x2134), # o + (0x0070, 0x007a, 'it', 0x1d4c5), # p-z + ], + 'sf': + { + 'rm': + [ + (0x0030, 0x0039, 'rm', 0x1d7e2), # 0-9 + (0x0041, 0x005a, 'rm', 0x1d5a0), # A-Z + (0x0061, 0x007a, 'rm', 0x1d5ba), # a-z + (0x0391, 0x03a9, 'rm', 0xe17d), # \Alpha-\Omega + (0x03b1, 0x03c9, 'rm', 0xe196), # \alpha-\omega + (0x03d1, 0x03d1, 'rm', 0xe1b0), # theta variant + (0x03d5, 0x03d5, 'rm', 0xe1b1), # phi variant + (0x03d6, 0x03d6, 'rm', 0xe1b3), # pi variant + (0x03f1, 0x03f1, 'rm', 0xe1b2), # rho variant + (0x03f5, 0x03f5, 'rm', 0xe1af), # lunate epsilon + (0x2202, 0x2202, 'rm', 0xe17c), # partial differential + ], + 'it': + [ + (0x0030, 0x0039, 'it', 0xe1b4), # 0-9 + (0x0041, 0x005a, 'it', 0x1d608), # A-Z + (0x0061, 0x007a, 'it', 0x1d622), # a-z + (0x0391, 0x03a9, 'it', 0xe1bf), # \Alpha-\Omega + (0x03b1, 0x03c9, 'it', 0xe1d8), # \alpha-\omega + (0x03d1, 0x03d1, 'it', 0xe1f2), # theta variant + (0x03d5, 0x03d5, 'it', 0xe1f3), # phi variant + (0x03d6, 0x03d6, 'it', 0xe1f5), # pi variant + (0x03f1, 0x03f1, 'it', 0xe1f4), # rho variant + (0x03f5, 0x03f5, 'it', 0xe1f1), # lunate epsilon + ], + 'bf': + [ + (0x0030, 0x0039, 'bf', 0x1d7ec), # 0-9 + (0x0041, 0x005a, 'bf', 0x1d5d4), # A-Z + (0x0061, 0x007a, 'bf', 0x1d5ee), # a-z + (0x0391, 0x03a9, 'bf', 0x1d756), # \Alpha-\Omega + (0x03b1, 0x03c9, 'bf', 0x1d770), # \alpha-\omega + (0x03d1, 0x03d1, 'bf', 0x1d78b), # theta variant + (0x03d5, 0x03d5, 'bf', 0x1d78d), # phi variant + (0x03d6, 0x03d6, 'bf', 0x1d78f), # pi variant + (0x03f0, 0x03f0, 'bf', 0x1d78c), # kappa variant + (0x03f1, 0x03f1, 'bf', 0x1d78e), # rho variant + (0x03f5, 0x03f5, 'bf', 0x1d78a), # lunate epsilon + (0x2202, 0x2202, 'bf', 0x1d789), # partial differential + (0x2207, 0x2207, 'bf', 0x1d76f), # \Nabla + ], + }, + 'tt': + [ + (0x0030, 0x0039, 'rm', 0x1d7f6), # 0-9 + (0x0041, 0x005a, 'rm', 0x1d670), # A-Z + (0x0061, 0x007a, 'rm', 0x1d68a) # a-z + ], + } + + Modified: branches/transforms/lib/matplotlib/axes.py =================================================================== --- branches/transforms/lib/matplotlib/axes.py 2007-11-13 15:15:36 UTC (rev 4243) +++ branches/transforms/lib/matplotlib/axes.py 2007-11-13 15:22:55 UTC (rev 4244) @@ -4827,7 +4827,7 @@ X = X.ravel() Y = Y.ravel() - coords = npy.zeros(((Nx * Ny), 2), npy.float32) + coords = npy.zeros(((Nx * Ny), 2), X.dtype) coords[:, 0] = X coords[:, 1] = Y @@ -4898,6 +4898,39 @@ return mtable.table(self, **kwargs) table.__doc__ = cbook.dedent(table.__doc__) % martist.kwdocd + def twinx(self): + """ + ax = twinx() + + create a twin of Axes for generating a plot with a sharex + x-axis but independent y axis. The y-axis of self will have + ticks on left and the returned axes will have ticks on the + right + """ + + ax2 = self.figure.add_axes(self.get_position(), sharex=self, frameon=False) + ax2.yaxis.tick_right() + ax2.yaxis.set_label_position('right') + self.yaxis.tick_left() + return ax2 + + def twiny(self): + """ + ax = twiny() + + create a twin of Axes for generating a plot with a shared + y-axis but independent x axis. The x-axis of self will have + ticks on bottom and the returned axes will have ticks on the + top + """ + + ax2 = self.figure.add_axes(self.get_position(), sharey=self, frameon=False) + ax2.xaxis.tick_top() + ax2.xaxis.set_label_position('top') + self.xaxis.tick_bottom() + return ax2 + + #### Data analysis Modified: branches/transforms/lib/matplotlib/backends/backend_agg.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_agg.py 2007-11-13 15:15:36 UTC (rev 4243) +++ branches/transforms/lib/matplotlib/backends/backend_agg.py 2007-11-13 15:22:55 UTC (rev 4244) @@ -318,5 +318,5 @@ def print_png(self, filename, *args, **kwargs): FigureCanvasAgg.draw(self) - self.get_renderer()._renderer.write_png(str(filename), self.figure.dpi) + self.get_renderer()._renderer.write_png(filename, self.figure.dpi) Modified: branches/transforms/lib/matplotlib/backends/backend_gtk.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_gtk.py 2007-11-13 15:15:36 UTC (rev 4243) +++ branches/transforms/lib/matplotlib/backends/backend_gtk.py 2007-11-13 15:22:55 UTC (rev 4244) @@ -365,11 +365,24 @@ pixbuf.get_from_drawable(pixmap, pixmap.get_colormap(), 0, 0, 0, 0, width, height) - try: - pixbuf.save(filename, format) - except gobject.GError, exc: - error_msg_gtk('Save figure failure:\n%s' % (exc,), parent=self) - + if is_string_like(filename): + try: + pixbuf.save(filename, format) + except gobject.GError, exc: + error_msg_gtk('Save figure failure:\n%s' % (exc,), parent=self) + elif hasattr(filename, 'write') and callable(filename.write): + if hasattr(pixbuf, 'save_to_callback'): + def save_callback(buf, data=None): + data.write(buf) + try: + pixbuf.save_to_callback(save_callback, format, user_data=filename) + except gobject.GError, exc: + error_msg_gtk('Save figure failure:\n%s' % (exc,), parent=self) + else: + raise ValueError("Saving to a Python file-like object is only supported by PyGTK >= 2.8") + else: + raise ValueError("filename must be a path or a file-like object") + def get_default_filetype(self): return 'png' @@ -1019,7 +1032,7 @@ def get_filename_from_user (self): while True: filename = None - if self.run() != gtk.RESPONSE_OK: + if self.run() != int(gtk.RESPONSE_OK): break filename = self.get_filename() break @@ -1045,7 +1058,7 @@ self.set_filename(self.path) filename = None - if self.run() == gtk.RESPONSE_OK: + if self.run() == int(gtk.RESPONSE_OK): self.path = filename = self.get_filename() self.hide() Modified: branches/transforms/lib/matplotlib/backends/backend_pdf.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_pdf.py 2007-11-13 15:15:36 UTC (rev 4243) +++ branches/transforms/lib/matplotlib/backends/backend_pdf.py 2007-11-13 15:22:55 UTC (rev 4244) @@ -330,7 +330,15 @@ self.width, self.height = width, height self.nextObject = 1 # next free object id self.xrefTable = [ [0, 65535, 'the zero object'] ] - fh = file(filename, 'wb') + self.passed_in_file_object = False + if is_string_like(filename): + fh = file(filename, 'wb') + elif hasattr(filename, 'write') and callable(filename.write): + fh = filename + self.passed_in_file_object = True + else: + raise ValueError("filename must be a path or a file-like object") + self.fh = fh self.currentstream = None # stream object to write to, if any fh.write("%PDF-1.4\n") # 1.4 is the first version to have alpha @@ -427,7 +435,8 @@ self.writeMarkers() self.writeXref() self.writeTrailer() - self.fh.close() + if not self.passed_in_file_object: + self.fh.close() def write(self, data): if self.currentstream is None: Modified: branches/transforms/lib/matplotlib/backends/backend_ps.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_ps.py 2007-11-13 15:15:36 UTC (rev 4243) +++ branches/transforms/lib/matplotlib/backends/backend_ps.py 2007-11-13 15:22:55 UTC (rev 4244) @@ -869,10 +869,16 @@ written into this file object. """ isEPSF = format == 'eps' - title = outfile - - # write to a temp file, we'll move it to outfile when done - tmpfile = os.path.join(gettempdir(), md5.md5(outfile).hexdigest()) + passed_in_file_object = False + if is_string_like(outfile): + title = outfile + tmpfile = os.path.join(gettempdir(), md5.md5(outfile).hexdigest()) + elif hasattr(outfile, 'write') and callable(outfile.write): + title = None + tmpfile = os.path.join(gettempdir(), md5.md5(str(hash(outfile))).hexdigest()) + passed_in_file_object = True + else: + raise ValueError("outfile must be a path or a file-like object") fh = file(tmpfile, 'w') # find the appropriate papertype @@ -990,10 +996,11 @@ elif rcParams['ps.usedistiller'] == 'xpdf': xpdf_distill(tmpfile, isEPSF, ptype=papertype, bbox=bbox) - if isinstance(outfile, file): + if passed_in_file_object: fh = file(tmpfile) print >>outfile, fh.read() - else: shutil.move(tmpfile, outfile) + else: + shutil.move(tmpfile, outfile) def _print_figure_tex(self, outfile, format, dpi, facecolor, edgecolor, orientation, isLandscape, papertype): Modified: branches/transforms/lib/matplotlib/backends/backend_svg.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_svg.py 2007-11-13 15:15:36 UTC (rev 4243) +++ branches/transforms/lib/matplotlib/backends/backend_svg.py 2007-11-13 15:22:55 UTC (rev 4244) @@ -5,6 +5,7 @@ from matplotlib import verbose, __version__, rcParams from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\ FigureManagerBase, FigureCanvasBase +from matplotlib.cbook import is_string_like from matplotlib.colors import rgb2hex from matplotlib.figure import Figure from matplotlib.font_manager import findfont, FontProperties @@ -258,7 +259,7 @@ im.write_png(filename) im.flipud_out() - imfile = file (filename, 'r') + imfile = file (filename, 'rb') image64 = base64.encodestring (imfile.read()) imfile.close() os.remove(filename) @@ -500,15 +501,27 @@ 'svgz': 'Scalable Vector Graphics'} def print_svg(self, filename, *args, **kwargs): - svgwriter = codecs.open(filename, 'w', 'utf-8') - return self._print_svg(filename, svgwriter) - + if is_string_like(filename): + fh_to_close = svgwriter = codecs.open(filename, 'w', 'utf-8') + elif hasattr(filename, 'write') and callable(filename.write): + svgwriter = codecs.EncodedFile(filename, 'utf-8') + fh_to_close = None + else: + raise ValueError("filename must be a path or a file-like object") + return self._print_svg(filename, svgwriter, fh_to_close) + def print_svgz(self, filename, *args, **kwargs): - gzipwriter = gzip.GzipFile(filename, 'w') - svgwriter = codecs.EncodedFile(gzipwriter, 'utf-8') - return self._print_svg(filename, svgwriter) + if is_string_like(filename): + gzipwriter = gzip.GzipFile(filename, 'w') + fh_to_close = svgwriter = codecs.EncodedFile(gzipwriter, 'utf-8') + elif hasattr(filename, 'write') and callable(filename.write): + fh_to_close = gzipwriter = gzip.GzipFile(fileobj=filename, mode='w') + svgwriter = codecs.EncodedFile(gzipwriter, 'utf-8') + else: + raise ValueError("filename must be a path or a file-like object") + return self._print_svg(filename, svgwriter, fh_to_close) - def _print_svg(self, filename, svgwriter): + def _print_svg(self, filename, svgwriter, fh_to_close=None): self.figure.set_dpi(72.0) width, height = self.figure.get_size_inches() w, h = width*72, height*72 @@ -516,7 +529,8 @@ renderer = RendererSVG(w, h, svgwriter, filename) self.figure.draw(renderer) renderer.finish() - svgwriter.close() + if fh_to_close is not None: + svgwriter.close() def get_default_filetype(self): return 'svg' Modified: branches/transforms/lib/matplotlib/backends/backend_wx.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_wx.py 2007-11-13 15:15:36 UTC (rev 4243) +++ branches/transforms/lib/matplotlib/backends/backend_wx.py 2007-11-13 15:22:55 UTC (rev 4244) @@ -152,7 +152,7 @@ cursors from matplotlib._pylab_helpers import Gcf from matplotlib.artist import Artist -from matplotlib.cbook import exception_to_str +from matplotlib.cbook import exception_to_str, is_string_like from matplotlib.figure import Figure from matplotlib.path import Path from matplotlib.text import _process_text_args, Text @@ -969,12 +969,17 @@ # Now that we have rendered into the bitmap, save it # to the appropriate file type and clean up - if not self.bitmap.SaveFile(filename, filetype): - DEBUG_MSG('print_figure() file save error', 4, self) - # note the error must be displayed here because trapping - # the error on a call or print_figure may not work because - # printing can be qued and called from realize - raise RuntimeError('Could not save figure to %s\n' % (filename)) + if is_string_like(filename): + if not self.bitmap.SaveFile(filename, filetype): + DEBUG_MSG('print_figure() file save error', 4, self) + # note the error must be displayed here because trapping + # the error on a call or print_figure may not work because + # printing can be qued and called from realize + raise RuntimeError('Could not save figure to %s\n' % (filename)) + elif hasattr(filename, 'write') and callable(filename.write): + if not self.bitmap.ConvertToImage().SaveStream(filename, filetype): + DEBUG_MSG('print_figure() file save error', 4, self) + raise RuntimeError('Could not save figure to %s\n' % (filename)) # Restore everything to normal self.bitmap = origBitmap Modified: branches/transforms/lib/matplotlib/config/mplconfig.py =================================================================== --- branches/transforms/lib/matplotlib/config/mplconfig.py 2007-11-13 15:15:36 UTC (rev 4243) +++ branches/transforms/lib/matplotlib/config/mplconfig.py 2007-11-13 15:22:55 UTC (rev 4244) @@ -65,7 +65,7 @@ class backend(TConfig): """Valid backends are: 'GTKAgg', 'GTKCairo', 'QtAgg', 'Qt4Agg', 'TkAgg', 'Agg', 'Cairo', 'PS', 'PDF', 'SVG'""" - use = T.Trait('TkAgg', mplT.BackendHandler()) + use = T.Trait('Agg', mplT.BackendHandler()) class cairo(TConfig): format = T.Trait('png', 'png', 'ps', 'pdf', 'svg') @@ -166,7 +166,7 @@ it = T.Trait('serif:oblique' , mplT.FontconfigPatternHandler()) bf = T.Trait('serif:bold' , mplT.FontconfigPatternHandler()) sf = T.Trait('sans' , mplT.FontconfigPatternHandler()) - fontset = T.Trait('cm', 'cm', 'stix', 'custom') + fontset = T.Trait('cm', 'cm', 'stix', 'stixsans', 'custom') fallback_to_cm = T.true class axes(TConfig): @@ -525,5 +525,5 @@ ############################################################################## if __name__ == "__main__": mplConfig = MPLConfig() - tconf2File(mplConfig, '../mpl-data/matplotlib.conf', force=True) - print 'Default matplotlib.conf created in ../mpl-data' + tconf2File(mplConfig, '../mpl-data/matplotlib.conf.template', force=True) + print 'matplotlib.conf.template created in ../mpl-data' Modified: branches/transforms/lib/matplotlib/config/rcsetup.py =================================================================== --- branches/transforms/lib/matplotlib/config/rcsetup.py 2007-11-13 15:15:36 UTC (rev 4243) +++ branches/transforms/lib/matplotlib/config/rcsetup.py 2007-11-13 15:22:55 UTC (rev 4244) @@ -203,7 +203,7 @@ parse_fontconfig_pattern(s) return s -validate_fontset = ValidateInStrings('fontset', ['cm', 'stix', 'custom']) +validate_fontset = ValidateInStrings('fontset', ['cm', 'stix', 'stixsans', 'custom']) validate_verbose = ValidateInStrings('verbose',[ 'silent', 'helpful', 'debug', 'debug-annoying', Modified: branches/transforms/lib/matplotlib/mathtext.py =================================================================== --- branches/transforms/lib/matplotlib/mathtext.py 2007-11-13 15:15:36 UTC (rev 4243) +++ branches/transforms/lib/matplotlib/mathtext.py 2007-11-13 15:22:55 UTC (rev 4244) @@ -144,8 +144,7 @@ from matplotlib.ft2font import FT2Font, FT2Image, KERNING_DEFAULT, LOAD_FORCE_AUTOHINT, LOAD_NO_HINTING from matplotlib.font_manager import findfont, FontProperties from matplotlib._mathtext_data import latex_to_bakoma, \ - latex_to_standard, tex2uni, tex2type1, uni2type1, \ - latex_to_cmex + latex_to_standard, tex2uni, latex_to_cmex, stix_virtual_fonts from matplotlib import get_data_path, rcParams #################### @@ -182,29 +181,6 @@ raise ValueError, message -#Not used, but might turn useful -def get_type1_name(symbol): - """get_type1_name(symbol) -> string - -Returns the the Type1 name of symbol. -symbol can be a single unicode character, or a TeX command (i.e. r'\pi'). - -""" - try:# This will succeed if symbol is a single unicode char - return uni2type1[ord(symbol)] - except TypeError: - pass - try:# Is symbol a TeX symbol (i.e. \alpha) - return tex2type1[symbol.strip("\\")] - except KeyError: - pass - # The symbol is already a Type1 name so return it - if isinstance(symbol, str): - return symbol - else: - # The user did not suply a valid symbol, show usage - raise ValueError, get_type1_name.__doc__ - class MathtextBackend(object): def __init__(self): self.fonts_object = None @@ -468,7 +444,7 @@ """ return 0. - def get_metrics(self, font, sym, fontsize, dpi): + def get_metrics(self, font, font_class, sym, fontsize, dpi): """ font: one of the TeX font names, tt, it, rm, cal, sf, bf or default (non-math) @@ -483,7 +459,7 @@ iceberg - the distance from the baseline to the top of the glyph. horiBearingY in Truetype parlance, height in TeX parlance """ - info = self._get_info(font, sym, fontsize, dpi) + info = self._get_info(font, font_class, sym, fontsize, dpi) return info.metrics def set_canvas_size(self, w, h, d): @@ -491,8 +467,8 @@ self.width, self.height, self.depth = ceil(w), ceil(h), ceil(d) self.mathtext_backend.set_canvas_size(self.width, self.height, self.depth) - def render_glyph(self, ox, oy, facename, sym, fontsize, dpi): - info = self._get_info(facename, sym, fontsize, dpi) + def render_glyph(self, ox, oy, facename, font_class, sym, fontsize, dpi): + info = self._get_info(facename, font_class, sym, fontsize, dpi) realpath, stat_key = get_realpath_and_stat(info.font.fname) used_characters = self.used_characters.setdefault( stat_key, (realpath, Set())) @@ -566,7 +542,10 @@ cached_font = self.fonts.get(basename) if cached_font is None: - font = FT2Font(basename) + try: + font = FT2Font(basename) + except RuntimeError: + return None cached_font = self.CachedFont(font) self.fonts[basename] = cached_font self.fonts[font.postscript_name] = cached_font @@ -578,15 +557,15 @@ return glyph.height/64.0/2.0 + 256.0/64.0 * dpi/72.0 return 0. - def _get_info (self, fontname, sym, fontsize, dpi, mark_as_used=True): + def _get_info(self, fontname, font_class, sym, fontsize, dpi): 'load the cmfont, metrics and glyph with caching' - key = fontname, sym, fontsize, dpi + key = fontname, font_class, sym, fontsize, dpi bunch = self.glyphd.get(key) if bunch is not None: return bunch cached_font, num, symbol_name, fontsize, slanted = \ - self._get_glyph(fontname, sym, fontsize) + self._get_glyph(fontname, font_class, sym, fontsize) font = cached_font.font font.set_size(fontsize, dpi) @@ -627,7 +606,7 @@ pclt = cached_font.font.get_sfnt_table('pclt') if pclt is None: # Some fonts don't store the xHeight, so we do a poor man's xHeight - metrics = self.get_metrics(font, 'x', fontsize, dpi) + metrics = self.get_metrics(font, 'it', 'x', fontsize, dpi) return metrics.iceberg xHeight = pclt['xHeight'] / 64.0 return xHeight @@ -636,11 +615,11 @@ cached_font = self._get_font(font) return max(1.0, cached_font.font.underline_thickness / 64.0 / fontsize * 10.0) - def get_kern(self, font1, sym1, fontsize1, - font2, sym2, fontsize2, dpi): + def get_kern(self, font1, fontclass1, sym1, fontsize1, + font2, fontclass2, sym2, fontsize2, dpi): if font1 == font2 and fontsize1 == fontsize2: - info1 = self._get_info(font1, sym1, fontsize1, dpi) - info2 = self._get_info(font2, sym2, fontsize2, dpi) + info1 = self._get_info(font1, fontclass1, sym1, fontsize1, dpi) + info2 = self._get_info(font2, fontclass2, sym2, fontsize2, dpi) font = info1.font return font.get_kerning(info1.num, info2.num, KERNING_DEFAULT) / 64.0 return 0.0 @@ -669,7 +648,7 @@ _slanted_symbols = Set(r"\int \oint".split()) - def _get_glyph(self, fontname, sym, fontsize): + def _get_glyph(self, fontname, font_class, sym, fontsize): symbol_name = None if fontname in self.fontmap and latex_to_bakoma.has_key(sym): basename, num = latex_to_bakoma[sym] @@ -680,11 +659,12 @@ elif len(sym) == 1: slanted = (fontname == "it") cached_font = self._get_font(fontname) - num = ord(sym) - gid = cached_font.charmap.get(num) - if gid is not None: - symbol_name = cached_font.font.get_glyph_name( - cached_font.charmap[num]) + if cached_font is not None: + num = ord(sym) + gid = cached_font.charmap.get(num) + if gid is not None: + symbol_name = cached_font.font.get_glyph_name( + cached_font.charmap[num]) if symbol_name is None: warn("Unrecognized symbol '%s'. Substituting with a dummy symbol." @@ -778,8 +758,11 @@ self.fontmap['ex'] = font _slanted_symbols = Set(r"\int \oint".split()) - - def _get_glyph(self, fontname, sym, fontsize): + + def _map_virtual_font(self, fontname, font_class, uniindex): + return fontname, uniindex + + def _get_glyph(self, fontname, font_class, sym, fontsize): found_symbol = False if self.use_cmex: @@ -798,6 +781,9 @@ sym.encode('ascii', 'backslashreplace'), MathTextWarning) + fontname, uniindex = self._map_virtual_font( + fontname, font_class, uniindex) + # Only characters in the "Letter" class should be italicized in 'it' # mode. Greek capital letters should be Roman. if found_symbol: @@ -805,26 +791,29 @@ if fontname == 'it': unistring = unichr(uniindex) - if (not unicodedata.category(unistring).startswith("L") + if (not unicodedata.category(unistring)[0] == "L" or unicodedata.name(unistring).startswith("GREEK CAPITAL")): new_fontname = 'rm' slanted = (new_fontname == 'it') or sym in self._slanted_symbols cached_font = self._get_font(new_fontname) - try: - glyphindex = cached_font.charmap[uniindex] - except KeyError: - warn("Font '%s' does not have a glyph for '%s'" % - (cached_font.font.postscript_name, - sym.encode('ascii', 'backslashreplace')), - MathTextWarning) - found_symbol = False + found_symbol = False + if cached_font is not None: + try: + glyphindex = cached_font.charmap[uniindex] + found_symbol = True + except KeyError: + warn("Font '%s' does not have a glyph for '%s'" % + (cached_font.font.postscript_name, + sym.encode('ascii', 'backslashreplace')), + MathTextWarning) if not found_symbol: if self.cm_fallback: warn("Substituting with a symbol from Computer Modern.", MathTextWarning) - return self.cm_fallback._get_glyph(fontname, sym, fontsize) + return self.cm_fallback._get_glyph( + fontname, 'it', sym, fontsize) else: warn("Substituting with a dummy symbol.", MathTextWarning) fontname = 'rm' @@ -845,10 +834,8 @@ class StixFonts(UnicodeFonts): _fontmap = { 'rm' : 'STIXGeneral', - 'tt' : 'VeraMono', 'it' : 'STIXGeneralItalic', 'bf' : 'STIXGeneralBol', - 'sf' : 'Vera', 'nonunirm' : 'STIXNonUni', 'nonuniit' : 'STIXNonUniIta', 'nonunibf' : 'STIXNonUniBol', @@ -865,6 +852,7 @@ cm_fallback = False def __init__(self, *args, **kwargs): + self._sans = kwargs.pop("sans", False) TruetypeFonts.__init__(self, *args, **kwargs) if not len(self.fontmap): for key, name in self._fontmap.iteritems(): @@ -872,20 +860,47 @@ self.fontmap[key] = fullpath self.fontmap[name] = fullpath - def _get_glyph(self, fontname, sym, fontsize): - # Handle calligraphic letters - if fontname == 'cal': - if len(sym) != 1 or ord(sym) < ord('A') or ord(sym) > ord('Z'): - raise ValueError(r"Sym '%s' is not available in \mathcal font" % sym) - fontname = 'nonuniit' - sym = unichr(ord(sym) + 0xe22d - ord('A')) + def _map_virtual_font(self, fontname, font_class, uniindex): + # Handle these "fonts" that are actually embedded in + # other fonts. + mapping = stix_virtual_fonts.get(fontname) + if self._sans and mapping is None: + mapping = stix_virtual_fonts['sf'] + doing_sans_conversion = True + else: + doing_sans_conversion = False + if mapping is not None: + if isinstance(mapping, dict): + mapping = mapping[font_class] + + # Binary search for the source glyph + lo = 0 + hi = len(mapping) + while lo < hi: + mid = (lo+hi)//2 + range = mapping[mid] + if uniindex < range[0]: + hi = mid + elif uniindex <= range[1]: + break + else: + lo = mid + 1 + + if uniindex >= range[0] and uniindex <= range[1]: + uniindex = uniindex - range[0] + range[3] + fontname = range[2] + elif not doing_sans_conversion: + # This will generate a dummy character + uniindex = 0x1 + fontname = 'it' + # Handle private use area glyphs if (fontname in ('it', 'rm', 'bf') and - len(sym) == 1 and ord(sym) >= 0xe000 and ord(sym) <= 0xf8ff): + uniindex >= 0xe000 and uniindex <= 0xf8ff): fontname = 'nonuni' + fontname - return UnicodeFonts._get_glyph(self, fontname, sym, fontsize) + return fontname, uniindex _size_alternatives = {} def get_sized_alternatives_for_symbol(self, fontname, sym): @@ -953,7 +968,7 @@ self.fonts[cached_font.get_fontname()] = cached_font return cached_font - def _get_info (self, fontname, sym, fontsize, dpi): + def _get_info (self, fontname, font_class, sym, f... [truncated message content] |
From: <md...@us...> - 2007-11-13 15:15:38
|
Revision: 4243 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4243&view=rev Author: mdboom Date: 2007-11-13 07:15:36 -0800 (Tue, 13 Nov 2007) Log Message: ----------- All backends can write to file-like objects rather than only regular files. Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py trunk/matplotlib/lib/matplotlib/backends/backend_ps.py trunk/matplotlib/lib/matplotlib/backends/backend_svg.py trunk/matplotlib/lib/matplotlib/backends/backend_wx.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2007-11-13 13:50:29 UTC (rev 4242) +++ trunk/matplotlib/CHANGELOG 2007-11-13 15:15:36 UTC (rev 4243) @@ -1,3 +1,7 @@ +2007-11-13 All backends now support writing to a file-like object, not + just a regular file. savefig() can be passed a file-like + object in place of a file path. - MGD + 2007-11-13 Improved the default backend selection at build time: SVG -> Agg -> TkAgg -> WXAgg -> GTK -> GTKAgg. The last usable backend in this progression will be chosen in the default Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2007-11-13 13:50:29 UTC (rev 4242) +++ trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2007-11-13 15:15:36 UTC (rev 4243) @@ -365,11 +365,24 @@ pixbuf.get_from_drawable(pixmap, pixmap.get_colormap(), 0, 0, 0, 0, width, height) - try: - pixbuf.save(filename, format) - except gobject.GError, exc: - error_msg_gtk('Save figure failure:\n%s' % (exc,), parent=self) - + if is_string_like(filename): + try: + pixbuf.save(filename, format) + except gobject.GError, exc: + error_msg_gtk('Save figure failure:\n%s' % (exc,), parent=self) + elif hasattr(filename, 'write') and callable(filename.write): + if hasattr(pixbuf, 'save_to_callback'): + def save_callback(buf, data=None): + data.write(buf) + try: + pixbuf.save_to_callback(save_callback, format, user_data=filename) + except gobject.GError, exc: + error_msg_gtk('Save figure failure:\n%s' % (exc,), parent=self) + else: + raise ValueError("Saving to a Python file-like object is only supported by PyGTK >= 2.8") + else: + raise ValueError("filename must be a path or a file-like object") + def get_default_filetype(self): return 'png' Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2007-11-13 13:50:29 UTC (rev 4242) +++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2007-11-13 15:15:36 UTC (rev 4243) @@ -325,7 +325,15 @@ self.width, self.height = width, height self.nextObject = 1 # next free object id self.xrefTable = [ [0, 65535, 'the zero object'] ] - fh = file(filename, 'wb') + self.passed_in_file_object = False + if is_string_like(filename): + fh = file(filename, 'wb') + elif hasattr(filename, 'write') and callable(filename.write): + fh = filename + self.passed_in_file_object = True + else: + raise ValueError("filename must be a path or a file-like object") + self.fh = fh self.currentstream = None # stream object to write to, if any fh.write("%PDF-1.4\n") # 1.4 is the first version to have alpha @@ -423,7 +431,8 @@ self.writeMarkers() self.writeXref() self.writeTrailer() - self.fh.close() + if not self.passed_in_file_object: + self.fh.close() def write(self, data): if self.currentstream is None: Modified: trunk/matplotlib/lib/matplotlib/backends/backend_ps.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2007-11-13 13:50:29 UTC (rev 4242) +++ trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2007-11-13 15:15:36 UTC (rev 4243) @@ -1047,10 +1047,16 @@ written into this file object. """ isEPSF = format == 'eps' - title = outfile - - # write to a temp file, we'll move it to outfile when done - tmpfile = os.path.join(gettempdir(), md5.md5(outfile).hexdigest()) + passed_in_file_object = False + if is_string_like(outfile): + title = outfile + tmpfile = os.path.join(gettempdir(), md5.md5(outfile).hexdigest()) + elif hasattr(outfile, 'write') and callable(outfile.write): + title = None + tmpfile = os.path.join(gettempdir(), md5.md5(str(hash(outfile))).hexdigest()) + passed_in_file_object = True + else: + raise ValueError("outfile must be a path or a file-like object") fh = file(tmpfile, 'w') # find the appropriate papertype @@ -1168,10 +1174,11 @@ elif rcParams['ps.usedistiller'] == 'xpdf': xpdf_distill(tmpfile, isEPSF, ptype=papertype, bbox=bbox) - if isinstance(outfile, file): + if passed_in_file_object: fh = file(tmpfile) print >>outfile, fh.read() - else: shutil.move(tmpfile, outfile) + else: + shutil.move(tmpfile, outfile) def _print_figure_tex(self, outfile, format, dpi, facecolor, edgecolor, orientation, isLandscape, papertype): Modified: trunk/matplotlib/lib/matplotlib/backends/backend_svg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2007-11-13 13:50:29 UTC (rev 4242) +++ trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2007-11-13 15:15:36 UTC (rev 4243) @@ -5,6 +5,7 @@ from matplotlib import verbose, __version__, rcParams from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\ FigureManagerBase, FigureCanvasBase +from matplotlib.cbook import is_string_like from matplotlib.colors import rgb2hex from matplotlib.figure import Figure from matplotlib.font_manager import findfont, FontProperties @@ -458,15 +459,27 @@ 'svgz': 'Scalable Vector Graphics'} def print_svg(self, filename, *args, **kwargs): - svgwriter = codecs.open(filename, 'w', 'utf-8') - return self._print_svg(filename, svgwriter) - + if is_string_like(filename): + fh_to_close = svgwriter = codecs.open(filename, 'w', 'utf-8') + elif hasattr(filename, 'write') and callable(filename.write): + svgwriter = codecs.EncodedFile(filename, 'utf-8') + fh_to_close = None + else: + raise ValueError("filename must be a path or a file-like object") + return self._print_svg(filename, svgwriter, fh_to_close) + def print_svgz(self, filename, *args, **kwargs): - gzipwriter = gzip.GzipFile(filename, 'w') - svgwriter = codecs.EncodedFile(gzipwriter, 'utf-8') - return self._print_svg(filename, svgwriter) + if is_string_like(filename): + gzipwriter = gzip.GzipFile(filename, 'w') + fh_to_close = svgwriter = codecs.EncodedFile(gzipwriter, 'utf-8') + elif hasattr(filename, 'write') and callable(filename.write): + fh_to_close = gzipwriter = gzip.GzipFile(fileobj=filename, mode='w') + svgwriter = codecs.EncodedFile(gzipwriter, 'utf-8') + else: + raise ValueError("filename must be a path or a file-like object") + return self._print_svg(filename, svgwriter, fh_to_close) - def _print_svg(self, filename, svgwriter): + def _print_svg(self, filename, svgwriter, fh_to_close=None): self.figure.dpi.set(72) width, height = self.figure.get_size_inches() w, h = width*72, height*72 @@ -474,7 +487,8 @@ renderer = RendererSVG(w, h, svgwriter, filename) self.figure.draw(renderer) renderer.finish() - svgwriter.close() + if fh_to_close is not None: + svgwriter.close() def get_default_filetype(self): return 'svg' Modified: trunk/matplotlib/lib/matplotlib/backends/backend_wx.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2007-11-13 13:50:29 UTC (rev 4242) +++ trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2007-11-13 15:15:36 UTC (rev 4243) @@ -152,7 +152,7 @@ cursors from matplotlib._pylab_helpers import Gcf from matplotlib.artist import Artist -from matplotlib.cbook import exception_to_str +from matplotlib.cbook import exception_to_str, is_string_like from matplotlib.figure import Figure from matplotlib.text import _process_text_args, Text from matplotlib.widgets import SubplotTool @@ -1030,12 +1030,17 @@ # Now that we have rendered into the bitmap, save it # to the appropriate file type and clean up - if not self.bitmap.SaveFile(filename, filetype): - DEBUG_MSG('print_figure() file save error', 4, self) - # note the error must be displayed here because trapping - # the error on a call or print_figure may not work because - # printing can be qued and called from realize - raise RuntimeError('Could not save figure to %s\n' % (filename)) + if is_string_like(filename): + if not self.bitmap.SaveFile(filename, filetype): + DEBUG_MSG('print_figure() file save error', 4, self) + # note the error must be displayed here because trapping + # the error on a call or print_figure may not work because + # printing can be qued and called from realize + raise RuntimeError('Could not save figure to %s\n' % (filename)) + elif hasattr(filename, 'write') and callable(filename.write): + if not self.bitmap.ConvertToImage().SaveStream(filename, filetype): + DEBUG_MSG('print_figure() file save error', 4, self) + raise RuntimeError('Could not save figure to %s\n' % (filename)) # Restore everything to normal self.bitmap = origBitmap This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2007-11-13 13:50:30
|
Revision: 4242 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4242&view=rev Author: dsdale Date: 2007-11-13 05:50:29 -0800 (Tue, 13 Nov 2007) Log Message: ----------- updated creation of default config files at build time: * modify matplotlib.conf based on available backends and setup.cfg * modify backend selection: SVG, Agg, TkAgg, WXAgg, GTK, GTKAgg, selection in setup.cfg Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/config/mplconfig.py trunk/matplotlib/setup.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.template Removed Paths: ------------- trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.backup Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2007-11-12 23:38:12 UTC (rev 4241) +++ trunk/matplotlib/CHANGELOG 2007-11-13 13:50:29 UTC (rev 4242) @@ -1,3 +1,12 @@ +2007-11-13 Improved the default backend selection at build time: + SVG -> Agg -> TkAgg -> WXAgg -> GTK -> GTKAgg. The last usable + backend in this progression will be chosen in the default + config file. If a backend is defined in setup.cfg, that will + be the default backend - DSD + +2007-11-13 Improved creation of default config files at build time for + traited config package - DSD + 2007-11-12 Exposed all the build options in setup.cfg. These options are read into a dict called "options" by setupext.py. Also, added "-mpl" tags to the version strings for packages provided by Modified: trunk/matplotlib/lib/matplotlib/config/mplconfig.py =================================================================== --- trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2007-11-12 23:38:12 UTC (rev 4241) +++ trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2007-11-13 13:50:29 UTC (rev 4242) @@ -65,7 +65,7 @@ class backend(TConfig): """Valid backends are: 'GTKAgg', 'GTKCairo', 'QtAgg', 'Qt4Agg', 'TkAgg', 'Agg', 'Cairo', 'PS', 'PDF', 'SVG'""" - use = T.Trait('TkAgg', mplT.BackendHandler()) + use = T.Trait('Agg', mplT.BackendHandler()) class cairo(TConfig): format = T.Trait('png', 'png', 'ps', 'pdf', 'svg') @@ -525,5 +525,5 @@ ############################################################################## if __name__ == "__main__": mplConfig = MPLConfig() - tconf2File(mplConfig, '../mpl-data/matplotlib.conf', force=True) - print 'Default matplotlib.conf created in ../mpl-data' + tconf2File(mplConfig, '../mpl-data/matplotlib.conf.template', force=True) + print 'matplotlib.conf.template created in ../mpl-data' Deleted: trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf =================================================================== --- trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf 2007-11-12 23:38:12 UTC (rev 4241) +++ trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf 2007-11-13 13:50:29 UTC (rev 4242) @@ -1,410 +0,0 @@ -# MPLConfig - plaintext (in .conf format) - -# This is a sample matplotlib configuration file. It should be placed -# in HOME/.matplotlib/matplotlibrc (unix/linux like systems) and -# C:\Documents and Settings\yourname\.matplotlib (win32 systems) -# -# By default, the installer will overwrite the existing file in the install -# path, so if you want to preserve yours, please move it to your HOME dir and -# set the environment variable if necessary. -# -# This file is best viewed in a editor which supports ini or conf mode syntax -# highlighting. -# -# Blank lines, or lines starting with a comment symbol, are ignored, -# as are trailing comments. Other lines must have the format -# -# key = val optional comment -# -# val should be valid python syntax, just as you would use when setting -# properties using rcParams. This should become more obvious by inspecting -# the default values listed herein. -# -# Colors: for the color values below, you can either use -# - a matplotlib color string, such as r, k, or b -# - an rgb tuple, such as (1.0, 0.5, 0.0) -# - a hex string, such as #ff00ff or ff00ff -# - a scalar grayscale intensity such as 0.75 -# - a legal html color name, eg red, blue, darkslategray -# -# Interactivity: see http://matplotlib.sourceforge.net/interactive.html. -# -# ### CONFIGURATION BEGINS HERE ### - -# a value of type 'str' -datapath = '/usr/lib64/python2.5/site-packages/matplotlib/mpl-data' -# one of 0, on, false, 1, no, n, y, off, yes, true -interactive = False -# a value of type 'bool' -maskedarray = False -# 'numpy' or 'numeric' or 'numarray' -numerix = 'numpy' -# 'Africa/Abidjan' or 'Africa/Accra' or 'Africa/Addis_Ababa' or 'Africa/Algiers' -# or 'Africa/Asmara' or 'Africa/Asmera' or 'Africa/Bamako' or 'Africa/Bangui' o -# r 'Africa/Banjul' or 'Africa/Bissau' or 'Africa/Blantyre' or 'Africa/Brazzavil -# <...snipped 10590 chars...> -# or 'Turkey' or 'UCT' or 'US/Alaska' or 'US/Aleutian' or 'US/Arizona' or 'US/Ce -# ntral' or 'US/East-Indiana' or 'US/Eastern' or 'US/Hawaii' or 'US/Indiana-Star -# ke' or 'US/Michigan' or 'US/Mountain' or 'US/Pacific' or 'US/Pacific-New' or ' -# US/Samoa' or 'UTC' or 'Universal' or 'W-SU' or 'WET' or 'Zulu' or 'posixrules' -timezone = 'UTC' -# 'toolbar2' or None -toolbar = 'toolbar2' -# a value of type 'bool' -units = False - -[axes] - # a value of type 'bool' - axisbelow = False - # any valid matplotlib color, eg an abbreviation like 'r' for red, a full - # name like 'orange', a hex color like '#efefef', a grayscale intensity - # like '0.5', or an RGBA tuple (1,0,0,1) - edgecolor = 'black' - # any valid matplotlib color, eg an abbreviation like 'r' for red, a full - # name like 'orange', a hex color like '#efefef', a grayscale intensity - # like '0.5', or an RGBA tuple (1,0,0,1) - facecolor = 'white' - # one of 0, on, false, 1, no, n, y, off, yes, true - grid = False - # one of 0, on, false, 1, no, n, y, off, yes, true - hold = True - # any valid matplotlib color, eg an abbreviation like 'r' for red, a full - # name like 'orange', a hex color like '#efefef', a grayscale intensity - # like '0.5', or an RGBA tuple (1,0,0,1) - labelcolor = 'black' - # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' - # or 'large' or 'x-large' or 'xx-large' - labelsize = 'medium' - # a value of type 'float' - linewidth = 1.0 - # one of 0, on, false, 1, no, n, y, off, yes, true - polargrid = True - # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' - # or 'large' or 'x-large' or 'xx-large' - titlesize = 'large' - - [[formatter]] - # a list of from 2 to 2 items each of which is a value of type 'float' - limits = [-7.0, 7.0] - -[backend] - # Valid backends are: 'GTKAgg', 'GTKCairo', 'QtAgg', 'Qt4Agg', - # 'TkAgg', 'Agg', 'Cairo', 'PS', 'PDF', 'SVG' - # one of ps, qt4agg, tkagg, gtkagg, agg, cairo, gtkcairo, wxagg, qtagg, temp - # late, svg, pdf - use = 'TkAgg' - - [[cairo]] - # 'png' or 'ps' or 'pdf' or 'svg' - format = 'png' - - [[pdf]] - # 0 <= an integer <= 9 - compression = 6 - # 3 or 42 - fonttype = 3 - # a value of type 'bool' - inheritcolor = False - # a value of type 'bool' - use14corefonts = False - - [[ps]] - # 3 or 42 - fonttype = 3 - # 'auto' or 'letter' or 'legal' or 'ledger' or 'A0' or 'A1' or 'A2' or ' - # A3' or 'A4' or 'A5' or 'A6' or 'A7' or 'A8' or 'A9' or 'A10' or 'B0' o - # r 'B1' or 'B2' or 'B3' or 'B4' or 'B5' or 'B6' or 'B7' or 'B8' or 'B9' - # or 'B10' - papersize = 'letter' - # a value of type 'bool' - useafm = False - - [[[distiller]]] - # a value of type 'float' - resolution = 6000.0 - # a bool or None or 'ghostscript' or 'xpdf' - use = None - - [[svg]] - # a value of type 'bool' - embed_chars = True - # a value of type 'bool' - image_inline = True - # a value of type 'bool' - image_noscale = False - - [[tk]] - # window_focus : Maintain shell focus for TkAgg - # pythoninspect: tk sets PYTHONINSPECT - - # a value of type 'bool' - pythoninspect = False - # a value of type 'bool' - window_focus = False - -[contour] - # 'dashed' or 'solid' - negative_linestyle = 'dashed' - -[figure] - # a value of type 'float' - dpi = 80.0 - # any valid matplotlib color, eg an abbreviation like 'r' for red, a full - # name like 'orange', a hex color like '#efefef', a grayscale intensity - # like '0.5', or an RGBA tuple (1,0,0,1) - edgecolor = 'white' - # any valid matplotlib color, eg an abbreviation like 'r' for red, a full - # name like 'orange', a hex color like '#efefef', a grayscale intensity - # like '0.5', or an RGBA tuple (1,0,0,1) - facecolor = '0.75' - # a list of from 2 to 2 items each of which is a value of type 'float' - figsize = [8.0, 6.0] - - [[subplot]] - # The figure subplot parameters. All dimensions are fraction - # of the figure width or height - # a value of type 'float' - bottom = 0.10000000000000001 - # a value of type 'float' - hspace = 0.20000000000000001 - # a value of type 'float' - left = 0.125 - # a value of type 'float' - right = 0.90000000000000002 - # a value of type 'float' - top = 0.90000000000000002 - # a value of type 'float' - wspace = 0.20000000000000001 - -[font] - # a list of items each of which is a value of type 'str' - cursive = ['Apple Chancery', 'Textile', 'Zapf Chancery', 'Sand', 'cursive'] - # 'sans-serif' or 'serif' or 'cursive' or 'fantasy' or 'monospace' - family = 'sans-serif' - # a list of items each of which is a value of type 'str' - fantasy = ['Comic Sans MS', 'Chicago', 'Charcoal', 'Impact', 'Western', 'fantasy'] - # a list of items each of which is a value of type 'str' - monospace = ['Bitstream Vera Sans Mono', 'Andale Mono', 'Nimbus Mono L', 'Courier New', 'Courier', 'Fixed', 'Terminal', 'monospace'] - # a list of items each of which is a value of type 'str' - sans_serif = ['Bitstream Vera Sans', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', 'sans-serif'] - # a list of items each of which is a value of type 'str' - serif = ['Bitstream Vera Serif', 'New Century Schoolbook', 'Century Schoolbook L', 'Utopia', 'ITC Bookman', 'Bookman', 'Nimbus Roman No9 L', 'Times New Roman', 'Times', 'Palatino', 'Charter', 'serif'] - # a value of type 'float' - size = 12.0 - # 'ultra-condensed' or 'extra-condensed' or 'condensed' or 'semi-condensed' - # or 'normal' or 'semi-expanded' or 'expanded' or 'extra-expanded' or 'ultra - # -expanded' or 'wider' or 'narrower' - stretch = 'normal' - # 'normal' or 'italic' or 'oblique' - style = 'normal' - # 'normal' or 'small-caps' - variant = 'normal' - # 'normal' or 'bold' or 'bolder' or 'lighter' or 100 or 200 or 300 or 400 or - # 500 or 600 or 700 or 800 or 900 - weight = 'normal' - -[grid] - # any valid matplotlib color, eg an abbreviation like 'r' for red, a full - # name like 'orange', a hex color like '#efefef', a grayscale intensity - # like '0.5', or an RGBA tuple (1,0,0,1) - color = 'black' - # '-' or '--' or '-.' or ':' or 'steps' or '' or ' ' - linestyle = ':' - # a value of type 'float' - linewidth = 0.5 - -[image] - # a value of type 'float' or 'equal' or 'auto' - aspect = 'equal' - # 'Accent' or 'Accent_r' or 'Blues' or 'Blues_r' or 'BrBG' or 'BrBG_r' or 'B - # uGn' or 'BuGn_r' or 'BuPu' or 'BuPu_r' or 'Dark2' or 'Dark2_r' or 'GnBu' o - # r 'GnBu_r' or 'Greens' or 'Greens_r' or 'Greys' or 'Greys_r' or 'OrRd' or - # <...snipped 1010 chars...> - # ist_stern' or 'gist_stern_r' or 'gist_yarg' or 'gist_yarg_r' or 'gray' or - # 'gray_r' or 'hot' or 'hot_r' or 'hsv' or 'hsv_r' or 'jet' or 'jet_r' or 'p - # ink' or 'pink_r' or 'prism' or 'prism_r' or 'spectral' or 'spectral_r' or - # 'spring' or 'spring_r' or 'summer' or 'summer_r' or 'winter' or 'winter_r' - cmap = 'jet' - # 'bilinear' or 'nearest' or 'bicubic' or 'spline16' or 'spline36' or 'hanni - # ng' or 'hamming' or 'hermite' or 'kaiser' or 'quadric' or 'catrom' or 'gau - # ssian' or 'bessel' or 'mitchell' or 'sinc' or 'lanczos' or 'blackman' - interpolation = 'bilinear' - # a value of type 'int' - lut = 256 - # 'upper' or 'lower' - origin = 'upper' - -[legend] - # a value of type 'float' - axespad = 0.02 - # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' - # or 'large' or 'x-large' or 'xx-large' - fontsize = 'medium' - # a value of type 'float' - handlelen = 0.050000000000000003 - # a value of type 'float' - handletextsep = 0.02 - # a value of type 'bool' - isaxes = True - # a value of type 'float' - labelsep = 0.01 - # 'best' or 'upper right' or 'upper left' or 'lower left' or 'lower right' o - # r 'right' or 'center left' or 'center right' or 'lower center' or 'upper c - # enter' or 'center' - loc = 'upper right' - # a value of type 'float' - markerscale = 1.0 - # a value of type 'int' - numpoints = 3 - # a value of type 'float' - pad = 0.20000000000000001 - # a value of type 'bool' - shadow = False - -[lines] - # a value of type 'bool' - antialiased = True - # any valid matplotlib color, eg an abbreviation like 'r' for red, a full - # name like 'orange', a hex color like '#efefef', a grayscale intensity - # like '0.5', or an RGBA tuple (1,0,0,1) - color = 'blue' - # 'butt' or 'round' or 'projecting' - dash_capstyle = 'butt' - # 'miter' or 'round' or 'bevel' - dash_joinstyle = 'miter' - # '-' or '--' or '-.' or ':' or 'steps' or '' or ' ' or None - linestyle = '-' - # a value of type 'float' - linewidth = 1.0 - # 'None' or 'o' or '.' or ',' or '^' or 'v' or '<' or '>' or 's' or '+' or ' - # x' or 'D' or 'd' or '1' or '2' or '3' or '4' or 'h' or 'H' or 'p' or '|' o - # r '_' - marker = 'None' - # a value of type 'float' - markeredgewidth = 0.5 - # a value of type 'float' - markersize = 6.0 - # 'butt' or 'round' or 'projecting' - solid_capstyle = 'butt' - # 'miter' or 'round' or 'bevel' - solid_joinstyle = 'miter' - -[mathtext] - # A fontconfig pattern. See the fontconfig user manual for more information - # . - bf = 'serif:bold' - # A fontconfig pattern. See the fontconfig user manual for more information - # . - cal = 'cursive' - # a value of type 'bool' - fallback_to_cm = True - # 'cm' or 'stix' or 'stixsans' or 'custom' - fontset = 'cm' - # A fontconfig pattern. See the fontconfig user manual for more information - # . - it = 'serif:oblique' - # A fontconfig pattern. See the fontconfig user manual for more information - # . - rm = 'serif' - # A fontconfig pattern. See the fontconfig user manual for more information - # . - sf = 'sans' - # A fontconfig pattern. See the fontconfig user manual for more information - # . - tt = 'monospace' - -[patch] - # a value of type 'bool' - antialiased = True - # any valid matplotlib color, eg an abbreviation like 'r' for red, a full - # name like 'orange', a hex color like '#efefef', a grayscale intensity - # like '0.5', or an RGBA tuple (1,0,0,1) - edgecolor = 'black' - # any valid matplotlib color, eg an abbreviation like 'r' for red, a full - # name like 'orange', a hex color like '#efefef', a grayscale intensity - # like '0.5', or an RGBA tuple (1,0,0,1) - facecolor = 'blue' - # a value of type 'float' - linewidth = 1.0 - -[savefig] - # a value of type 'float' - dpi = 100.0 - # any valid matplotlib color, eg an abbreviation like 'r' for red, a full - # name like 'orange', a hex color like '#efefef', a grayscale intensity - # like '0.5', or an RGBA tuple (1,0,0,1) - edgecolor = 'white' - # any valid matplotlib color, eg an abbreviation like 'r' for red, a full - # name like 'orange', a hex color like '#efefef', a grayscale intensity - # like '0.5', or an RGBA tuple (1,0,0,1) - facecolor = 'white' - # 'portrait' or 'landscape' - orientation = 'portrait' - -[text] - # any valid matplotlib color, eg an abbreviation like 'r' for red, a full - # name like 'orange', a hex color like '#efefef', a grayscale intensity - # like '0.5', or an RGBA tuple (1,0,0,1) - color = 'black' - # a value of type 'bool' - usetex = False - - [[latex]] - # a value of type 'bool' - dvipnghack = False - # a list of items each of which is a value of type 'str' - preamble = [] - # a value of type 'bool' - unicode = False - -[verbose] - # a value of type 'str' or a value of type 'unicode' or 'sys.stdout' - fileo = 'sys.stdout' - # 'silent' or 'helpful' or 'debug' or 'debug-annoying' - level = 'silent' - -[xticks] - # any valid matplotlib color, eg an abbreviation like 'r' for red, a full - # name like 'orange', a hex color like '#efefef', a grayscale intensity - # like '0.5', or an RGBA tuple (1,0,0,1) - color = 'black' - # 'in' or 'out' - direction = 'in' - # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' - # or 'large' or 'x-large' or 'xx-large' - labelsize = 'small' - - [[major]] - # a value of type 'float' - pad = 4.0 - # a value of type 'float' - size = 4.0 - - [[minor]] - # a value of type 'float' - pad = 4.0 - # a value of type 'float' - size = 2.0 - -[yticks] - # any valid matplotlib color, eg an abbreviation like 'r' for red, a full - # name like 'orange', a hex color like '#efefef', a grayscale intensity - # like '0.5', or an RGBA tuple (1,0,0,1) - color = 'black' - # 'in' or 'out' - direction = 'in' - # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' - # or 'large' or 'x-large' or 'xx-large' - labelsize = 'small' - - [[major]] - # a value of type 'float' - pad = 4.0 - # a value of type 'float' - size = 4.0 - - [[minor]] - # a value of type 'float' - pad = 4.0 - # a value of type 'float' - size = 2.0 \ No newline at end of file Deleted: trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.backup =================================================================== --- trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.backup 2007-11-12 23:38:12 UTC (rev 4241) +++ trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.backup 2007-11-13 13:50:29 UTC (rev 4242) @@ -1,456 +0,0 @@ -### MATPLOTLIBRC FORMAT - -# This is a sample matplotlib configuration file. It should be placed -# in HOME/.matplotlib/matplotlibrc (unix/linux like systems) and -# C:\Documents and Settings\yourname\.matplotlib (win32 systems) -# -# By default, the installer will overwrite the existing file in the -# install path, so if you want to preserve your's, please move it to -# your HOME dir and set the environment variable if necessary. -# -# This file is best viewed in a editor which supports ini or conf mode -# syntax highlighting -# -# Blank lines, or lines starting with a comment symbol, are ignored, -# as are trailing comments. Other lines must have the format -# -# key = val # optional comment -# -# val should be valid python syntax, just as you would use when setting -# properties using rcParams. This should become more obvious by inspecting -# the default values listed herein. -# -# Colors: for the color values below, you can either use -# - a matplotlib color string, such as r, k, or b -# - an rgb tuple, such as (1.0, 0.5, 0.0) -# - a hex string, such as #ff00ff or ff00ff -# - a scalar grayscale intensity such as 0.75 -# - a legal html color name, eg red, blue, darkslategray - -#### CONFIGURATION BEGINS HERE - -# numpy, Numeric or numarray -numerix = 'numpy' - -# True to use external maskedarray module instead of numpy.ma; this is a -# temporary setting for testing maskedarray. -maskedarray = False - -# see http://matplotlib.sourceforge.net/interactive.html -interactive = False - -# None | classic | toolbar2 -toolbar = 'toolbar2' - -# a pytz timezone string, eg US/Central or Europe/Paris -timezone = 'UTC' - -units = False - -# Where your matplotlib data lives if you installed to a non-default -#location. This is where the matplotlib fonts, bitmaps, etc reside -#datapath = '/home/fperez/.matplotlib' - -#bogus = 1 -#[bogus_section] -# foo = 1 - -[backend] - - #[[bogus_subsection]] - # bar =1 - - # 'GTKAgg', 'GTKCairo', 'QtAgg', 'Qt4Agg', 'TkAgg', 'Agg', - # 'Cairo', 'PS', 'PDF', 'SVG' - use = 'TkAgg' - - [[cairo]] - # png, ps, pdf, svg - format = 'png' - - [[tk]] - # Maintain shell focus for TkAgg - window_focus = False - - # tk sets PYTHONINSEPCT - pythoninspect = False - - [[ps]] - # auto, letter, legal, ledger, A0-A10, B0-B10 - papersize = 'letter' - - # use of afm fonts, results in smaller files - useafm = False - - # 3 (Type3) or 42 (TrueType) - fonttype = 3 - - [[[distiller]]] - # can be: None, ghostscript or xpdf - # xpdf intended for production of publication quality - # files, but requires ghostscript, xpdf and ps2eps - use = None - - # distiller resolution, dpi - resolution = 6000.0 - - [[pdf]] - # integer from 0 to 9 - # 0 disables compression (good for debugging) - compression = 6 - - # 3 (Type3) or 42 (TrueType) - fonttype = 3 - - [[svg]] - # write raster image data directly into the svg file - image_inline = True - - # suppress scaling of raster data embedded in SVG - image_noscale = False - - # embed character outlines in the SVG file - embed_chars = False - -[lines] - # See http://matplotlib.sourceforge.net/matplotlib.lines.html for more - # information on line properties. - - # line width in points - linewidth = 1.0 - - # '-','--','-.', ':', 'steps', '', ' ', or None - linestyle = '-' - - color = 'blue' - - # The default marker: 'None', 'o', '.', ',', '^', 'v', '<', '>', 's', '+', - # 'x', 'D', 'd', '1', '2', '3', '4', 'h', 'H', 'p', '|', '_' - marker = 'None' - - # the line width around the marker symbol - markeredgewidth = 0.5 - - # markersize, in points - markersize = 6.0 - - # miter|round|bevel - dash_joinstyle = 'miter' - solid_joinstyle = 'miter' - - # butt|round|projecting - dash_capstyle = 'butt' - solid_capstyle = 'projecting' - - # render antialised lines (no jaggies) - antialiased = True - -[patch] - # Patches are graphical objects that fill 2D space, like polygons or - # circles. See - # http://matplotlib.sourceforge.net/matplotlib.patches.html for more - # information on patch properties - - # edge width in points - linewidth = 1.0 - - facecolor = 'blue' - edgecolor = 'black' - - # render antialised lines (no jaggies) - antialiased = True - -[font] - # font properties used by text.Text. See - # http://matplotlib.sourceforge.net/matplotlib.font_manager.html for more - # information on font properties. The 6 font properties used for font - # matching are given below with their default values. - # - # The font.family property has five values: 'serif' (e.g. Times), - # 'sans-serif' (e.g. Helvetica), 'cursive' (e.g. Zapf-Chancery), - # 'fantasy' (e.g. Western), and 'monospace' (e.g. Courier). Each of - # these font families has a default list of font names in decreasing - # order of priority associated with them. - family = 'sans-serif' - - # The font.style property has three values: normal (or roman), italic - # or oblique. The oblique style will be used for italic, if it is not - # present. - style = 'normal' - - # The font.variant property has two values: normal or small-caps. For - # TrueType fonts, which are scalable fonts, small-caps is equivalent - # to using a font size of 'smaller', or about 83% of the current font - # size. - variant = 'normal' - - # The font.weight property has effectively 13 values= normal, bold, - # bolder, lighter, 100, 200, 300, ..., 900. Normal is the same as - # 400, and bold is 700. bolder and lighter are relative values with - # respect to the current weight. - weight = 'normal' - - # The font.stretch property has 11 values: ultra-condensed, - # extra-condensed, condensed, semi-condensed, normal, semi-expanded, - # expanded, extra-expanded, ultra-expanded, wider, and narrower. This - # property is not currently implemented. - stretch = 'normal' - - # The font.size property is the default font size for text, given in pts. - # 12pt is the standard value. - # - # Note that font.size controls default text sizes. To configure - # special text sizes tick labels, axes, labels, title, etc, see the rc - # settings for axes and ticks. Special text sizes can be defined - # relative to font.size, using the following values: xx-small, x-small, - # small, medium, large, x-large, xx-large, larger, or smaller - size = 12.0 - - # A search list for each of the font families - serif = ['Bitstream Vera Serif', 'New Century Schoolbook', 'Century Schoolbook L', 'Utopia', 'ITC Bookman', 'Bookman', 'Nimbus Roman No9 L', 'Times New Roman', 'Times', 'Palatino', 'Charter', 'serif'] - sans_serif = ['Bitstream Vera Sans', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', 'sans-serif'] - cursive = ['Apple Chancery', 'Textile', 'Zapf Chancery', 'Sand', 'cursive'] - fantasy = ['Comic Sans MS', 'Chicago', 'Charcoal', 'Impact', 'Western', 'fantasy'] - monospace = ['Bitstream Vera Sans Mono', 'Andale Mono', 'Nimbus Mono L', 'Courier New', 'Courier', 'Fixed', 'Terminal', 'monospace'] - -[text] - # text properties used by text.Text. See - # http://matplotlib.sourceforge.net/matplotlib.text.html for more - # information on text properties - color = 'black' - - ### LaTeX customizations - # See http://www.scipy.org/Wiki/Cookbook/Matplotlib/UsingTex - - # use latex for all text handling. The following fonts - # are supported through the usual rc parameter settings: - # new century schoolbook, bookman, times, palatino, - # zapf chancery, charter, serif, sans-serif, helvetica, - # avant garde, courier, monospace, computer modern roman, - # computer modern sans serif, computer modern typewriter - # If another font is desired which can loaded using the - # LaTeX \usepackage command, please inquire at the - # matplotlib mailing list - usetex = False - - [[latex]] - # use "ucs" and "inputenc" LaTeX packages for - # handling unicode strings. - unicode = False - - # IMPROPER USE OF THE PREAMBLE WILL LEAD TO LATEX - # FAILURES AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT - # ASK FOR HELP IF THIS FEATURE DOES NOT DO WHAT YOU - # EXPECT IT TO. - # preamble is a comma separated list of LaTeX - # statements that are included in the LaTeX document - # preamble. - # An example: - # text.latex.preamble = ["\usepackage{bm}", "\usepackage{euler}"] - # The following packages are always loaded with usetex, - # so beware of package collisions: color, geometry, - # graphicx, type1cm, textcomp. Adobe Postscript - # (PSSNFS) font packages may also be loaded, depending - # on your font settings - preamble = [] - - # some versions of dvipng don't handle alpha channel properly. - # Use True to correct and flush ~/.matplotlib/tex.cache before - # testing - dvipnghack = False - -[axes] - # default face and edge color, default tick sizes, - # default fontsizes for ticklabels, and so on. See - # http://matplotlib.sourceforge.net/matplotlib.axes.html#Axes - - # whether to clear the axes by default - hold = True - - # axes background color - facecolor = 'white' - - # axes edge color - edgecolor = 'black' - - # edge linewidth - linewidth = 1.0 - - # display grid on regular or polar axes - grid = False - polargrid = True - - # fontsize of the axes title and labels - titlesize = 'large' - labelsize = 'medium' - - labelcolor = 'black' - - # whether axis gridlines and ticks are below the axes elements - # (lines, text, etc) - axisbelow = False - - [[formatter]] - # use scientific notation if log10 of the axis range is smaller - # than the first or larger than the second - limits = [-7.0, 7.0] - -[xticks] - # see http://matplotlib.sourceforge.net/matplotlib.axis.html#Ticks - color = 'k' - labelsize = 'small' - - # direction: in or out - direction = 'in' - - [[major]] - # in points - size = 4.0 - pad = 4.0 - - [[minor]] - # in points - size = 2.0 - pad = 4.0 - -[yticks] - color = 'k' - labelsize = 'small' - - # direction: in or out - direction = 'in' - - [[major]] - # in points - size = 4.0 - pad = 4.0 - - [[minor]] - # in points - size = 2.0 - pad = 4.0 - -[grid] - color = 'black' - - # '-','--','-.', ':', 'steps', '', ' ', or None - linestyle = ':' - - linewidth = 0.5 - -[legend] - loc = 'upper right' - - isaxes = True - - # the number of points in the legend line - numpoints = 2 - - fontsize = 'medium' - - # the fractional whitespace inside the legend border - pad = 0.20000000000000001 - - # the relative size of legend markers vs. original - # the following dimensions are in axes coords - markerscale = 1.0 - - # the vertical space between the legend entries - labelsep = 0.01 - - # the length of the legend lines - handlelen = 0.050000000000000003 - - # the space between the legend line and legend text - handletextsep = 0.02 - - # the border between the axes and legend edge - axespad = 0.02 - - # Show a shadow behind the legend - shadow = False - -[figure] - # See http://matplotlib.sourceforge.net/matplotlib.figure.html#Figure - - # figure size in inches - figsize = [8.0, 6.0] - - # figure dots per inch - dpi = 80.0 - - # figure face and edge colors; '0.75' is scalar gray - facecolor = '0.75' - edgecolor = 'white' - - [[subplot]] - # The figure subplot parameters. All dimensions are fraction of the - # figure width or height - left = 0.125 - right = 0.90000000000000002 - bottom = 0.10000000000000001 - top = 0.90000000000000002 - - # the amount of width or height reserved for blank space between - #subplots - wspace = 0.20000000000000001 - hspace = 0.20000000000000001 - - -[image] - # equal | auto | a number - aspect = 'equal' - - # see help(imshow) for options - interpolation = 'bilinear' - cmap = 'jet' - - # the size of the colormap lookup table - lut = 256 - - # 'lower' or 'upper' - origin = 'upper' - - -[contour] - # 'dashed' or 'solid' - negative_linestyle = 'dashed' - -[savefig] - # Saving figures - # the default savefig params can be different for the GUI backends. - # Eg, you may want a higher resolution, or to make the figure - # background white - - # figure dots per inch - dpi = 100.0 - - # figure face and edge colors - facecolor = 'white' - edgecolor = 'white' - orientation = 'portrait' - -[verbose] - # Set the verbose flags. This controls how much information - # matplotlib gives you at runtime and where it goes. The verbosity - # levels are: silent, helpful, debug, debug-annoying. Any level is - # inclusive of all the levels below it. If you setting is debug, - # you'll get all the debug and helpful messages. When submitting - # problems to the mailing-list, please set verbose to helpful or debug - # and paste the output into your report. - # - # The fileo gives the destination for any calls to verbose.report. - # These objects can a filename, or a filehandle like sys.stdout. - # - # You can override the rc default verbosity from the command line by - # giving the flags --verbose-LEVEL where LEVEL is one of the legal - # levels, eg --verbose-helpful. - # - # You can access the verbose instance in your code - # from matplotlib import verbose. - - # 'silent', 'helpful', 'debug', or 'debug-annoying' - level = 'silent' - - # a log filename, 'sys.stdout' or 'sys.stderr' - fileo = 'sys.stdout' Added: trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.template =================================================================== --- trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.template (rev 0) +++ trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.template 2007-11-13 13:50:29 UTC (rev 4242) @@ -0,0 +1,410 @@ +# MPLConfig - plaintext (in .conf format) + +# This is a sample matplotlib configuration file. It should be placed +# in HOME/.matplotlib/matplotlibrc (unix/linux like systems) and +# C:\Documents and Settings\yourname\.matplotlib (win32 systems) +# +# By default, the installer will overwrite the existing file in the install +# path, so if you want to preserve yours, please move it to your HOME dir and +# set the environment variable if necessary. +# +# This file is best viewed in a editor which supports ini or conf mode syntax +# highlighting. +# +# Blank lines, or lines starting with a comment symbol, are ignored, +# as are trailing comments. Other lines must have the format +# +# key = val optional comment +# +# val should be valid python syntax, just as you would use when setting +# properties using rcParams. This should become more obvious by inspecting +# the default values listed herein. +# +# Colors: for the color values below, you can either use +# - a matplotlib color string, such as r, k, or b +# - an rgb tuple, such as (1.0, 0.5, 0.0) +# - a hex string, such as #ff00ff or ff00ff +# - a scalar grayscale intensity such as 0.75 +# - a legal html color name, eg red, blue, darkslategray +# +# Interactivity: see http://matplotlib.sourceforge.net/interactive.html. +# +# ### CONFIGURATION BEGINS HERE ### + +# a value of type 'str' +datapath = '/usr/lib64/python2.5/site-packages/matplotlib/mpl-data' +# one of 0, on, false, 1, no, n, y, off, yes, true +interactive = False +# a value of type 'bool' +maskedarray = False +# 'numpy' or 'numeric' or 'numarray' +numerix = 'numpy' +# 'Africa/Abidjan' or 'Africa/Accra' or 'Africa/Addis_Ababa' or 'Africa/Algiers' +# or 'Africa/Asmara' or 'Africa/Asmera' or 'Africa/Bamako' or 'Africa/Bangui' o +# r 'Africa/Banjul' or 'Africa/Bissau' or 'Africa/Blantyre' or 'Africa/Brazzavil +# <...snipped 10590 chars...> +# or 'Turkey' or 'UCT' or 'US/Alaska' or 'US/Aleutian' or 'US/Arizona' or 'US/Ce +# ntral' or 'US/East-Indiana' or 'US/Eastern' or 'US/Hawaii' or 'US/Indiana-Star +# ke' or 'US/Michigan' or 'US/Mountain' or 'US/Pacific' or 'US/Pacific-New' or ' +# US/Samoa' or 'UTC' or 'Universal' or 'W-SU' or 'WET' or 'Zulu' or 'posixrules' +timezone = 'UTC' +# 'toolbar2' or None +toolbar = 'toolbar2' +# a value of type 'bool' +units = False + +[axes] + # a value of type 'bool' + axisbelow = False + # any valid matplotlib color, eg an abbreviation like 'r' for red, a full + # name like 'orange', a hex color like '#efefef', a grayscale intensity + # like '0.5', or an RGBA tuple (1,0,0,1) + edgecolor = 'black' + # any valid matplotlib color, eg an abbreviation like 'r' for red, a full + # name like 'orange', a hex color like '#efefef', a grayscale intensity + # like '0.5', or an RGBA tuple (1,0,0,1) + facecolor = 'white' + # one of 0, on, false, 1, no, n, y, off, yes, true + grid = False + # one of 0, on, false, 1, no, n, y, off, yes, true + hold = True + # any valid matplotlib color, eg an abbreviation like 'r' for red, a full + # name like 'orange', a hex color like '#efefef', a grayscale intensity + # like '0.5', or an RGBA tuple (1,0,0,1) + labelcolor = 'black' + # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' + # or 'large' or 'x-large' or 'xx-large' + labelsize = 'medium' + # a value of type 'float' + linewidth = 1.0 + # one of 0, on, false, 1, no, n, y, off, yes, true + polargrid = True + # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' + # or 'large' or 'x-large' or 'xx-large' + titlesize = 'large' + + [[formatter]] + # a list of from 2 to 2 items each of which is a value of type 'float' + limits = [-7.0, 7.0] + +[backend] + # Valid backends are: 'GTKAgg', 'GTKCairo', 'QtAgg', 'Qt4Agg', + # 'TkAgg', 'Agg', 'Cairo', 'PS', 'PDF', 'SVG' + # one of ps, qt4agg, tkagg, gtkagg, agg, cairo, gtkcairo, wxagg, qtagg, temp + # late, svg, pdf + use = 'Agg' + + [[cairo]] + # 'png' or 'ps' or 'pdf' or 'svg' + format = 'png' + + [[pdf]] + # 0 <= an integer <= 9 + compression = 6 + # 3 or 42 + fonttype = 3 + # a value of type 'bool' + inheritcolor = False + # a value of type 'bool' + use14corefonts = False + + [[ps]] + # 3 or 42 + fonttype = 3 + # 'auto' or 'letter' or 'legal' or 'ledger' or 'A0' or 'A1' or 'A2' or ' + # A3' or 'A4' or 'A5' or 'A6' or 'A7' or 'A8' or 'A9' or 'A10' or 'B0' o + # r 'B1' or 'B2' or 'B3' or 'B4' or 'B5' or 'B6' or 'B7' or 'B8' or 'B9' + # or 'B10' + papersize = 'letter' + # a value of type 'bool' + useafm = False + + [[[distiller]]] + # a value of type 'float' + resolution = 6000.0 + # a bool or None or 'ghostscript' or 'xpdf' + use = None + + [[svg]] + # a value of type 'bool' + embed_chars = True + # a value of type 'bool' + image_inline = True + # a value of type 'bool' + image_noscale = False + + [[tk]] + # window_focus : Maintain shell focus for TkAgg + # pythoninspect: tk sets PYTHONINSPECT + + # a value of type 'bool' + pythoninspect = False + # a value of type 'bool' + window_focus = False + +[contour] + # 'dashed' or 'solid' + negative_linestyle = 'dashed' + +[figure] + # a value of type 'float' + dpi = 80.0 + # any valid matplotlib color, eg an abbreviation like 'r' for red, a full + # name like 'orange', a hex color like '#efefef', a grayscale intensity + # like '0.5', or an RGBA tuple (1,0,0,1) + edgecolor = 'white' + # any valid matplotlib color, eg an abbreviation like 'r' for red, a full + # name like 'orange', a hex color like '#efefef', a grayscale intensity + # like '0.5', or an RGBA tuple (1,0,0,1) + facecolor = '0.75' + # a list of from 2 to 2 items each of which is a value of type 'float' + figsize = [8.0, 6.0] + + [[subplot]] + # The figure subplot parameters. All dimensions are fraction + # of the figure width or height + # a value of type 'float' + bottom = 0.10000000000000001 + # a value of type 'float' + hspace = 0.20000000000000001 + # a value of type 'float' + left = 0.125 + # a value of type 'float' + right = 0.90000000000000002 + # a value of type 'float' + top = 0.90000000000000002 + # a value of type 'float' + wspace = 0.20000000000000001 + +[font] + # a list of items each of which is a value of type 'str' + cursive = ['Apple Chancery', 'Textile', 'Zapf Chancery', 'Sand', 'cursive'] + # 'sans-serif' or 'serif' or 'cursive' or 'fantasy' or 'monospace' + family = 'sans-serif' + # a list of items each of which is a value of type 'str' + fantasy = ['Comic Sans MS', 'Chicago', 'Charcoal', 'Impact', 'Western', 'fantasy'] + # a list of items each of which is a value of type 'str' + monospace = ['Bitstream Vera Sans Mono', 'Andale Mono', 'Nimbus Mono L', 'Courier New', 'Courier', 'Fixed', 'Terminal', 'monospace'] + # a list of items each of which is a value of type 'str' + sans_serif = ['Bitstream Vera Sans', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', 'sans-serif'] + # a list of items each of which is a value of type 'str' + serif = ['Bitstream Vera Serif', 'New Century Schoolbook', 'Century Schoolbook L', 'Utopia', 'ITC Bookman', 'Bookman', 'Nimbus Roman No9 L', 'Times New Roman', 'Times', 'Palatino', 'Charter', 'serif'] + # a value of type 'float' + size = 12.0 + # 'ultra-condensed' or 'extra-condensed' or 'condensed' or 'semi-condensed' + # or 'normal' or 'semi-expanded' or 'expanded' or 'extra-expanded' or 'ultra + # -expanded' or 'wider' or 'narrower' + stretch = 'normal' + # 'normal' or 'italic' or 'oblique' + style = 'normal' + # 'normal' or 'small-caps' + variant = 'normal' + # 'normal' or 'bold' or 'bolder' or 'lighter' or 100 or 200 or 300 or 400 or + # 500 or 600 or 700 or 800 or 900 + weight = 'normal' + +[grid] + # any valid matplotlib color, eg an abbreviation like 'r' for red, a full + # name like 'orange', a hex color like '#efefef', a grayscale intensity + # like '0.5', or an RGBA tuple (1,0,0,1) + color = 'black' + # '-' or '--' or '-.' or ':' or 'steps' or '' or ' ' + linestyle = ':' + # a value of type 'float' + linewidth = 0.5 + +[image] + # a value of type 'float' or 'equal' or 'auto' + aspect = 'equal' + # 'Accent' or 'Accent_r' or 'Blues' or 'Blues_r' or 'BrBG' or 'BrBG_r' or 'B + # uGn' or 'BuGn_r' or 'BuPu' or 'BuPu_r' or 'Dark2' or 'Dark2_r' or 'GnBu' o + # r 'GnBu_r' or 'Greens' or 'Greens_r' or 'Greys' or 'Greys_r' or 'OrRd' or + # <...snipped 1010 chars...> + # ist_stern' or 'gist_stern_r' or 'gist_yarg' or 'gist_yarg_r' or 'gray' or + # 'gray_r' or 'hot' or 'hot_r' or 'hsv' or 'hsv_r' or 'jet' or 'jet_r' or 'p + # ink' or 'pink_r' or 'prism' or 'prism_r' or 'spectral' or 'spectral_r' or + # 'spring' or 'spring_r' or 'summer' or 'summer_r' or 'winter' or 'winter_r' + cmap = 'jet' + # 'bilinear' or 'nearest' or 'bicubic' or 'spline16' or 'spline36' or 'hanni + # ng' or 'hamming' or 'hermite' or 'kaiser' or 'quadric' or 'catrom' or 'gau + # ssian' or 'bessel' or 'mitchell' or 'sinc' or 'lanczos' or 'blackman' + interpolation = 'bilinear' + # a value of type 'int' + lut = 256 + # 'upper' or 'lower' + origin = 'upper' + +[legend] + # a value of type 'float' + axespad = 0.02 + # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' + # or 'large' or 'x-large' or 'xx-large' + fontsize = 'medium' + # a value of type 'float' + handlelen = 0.050000000000000003 + # a value of type 'float' + handletextsep = 0.02 + # a value of type 'bool' + isaxes = True + # a value of type 'float' + labelsep = 0.01 + # 'best' or 'upper right' or 'upper left' or 'lower left' or 'lower right' o + # r 'right' or 'center left' or 'center right' or 'lower center' or 'upper c + # enter' or 'center' + loc = 'upper right' + # a value of type 'float' + markerscale = 1.0 + # a value of type 'int' + numpoints = 3 + # a value of type 'float' + pad = 0.20000000000000001 + # a value of type 'bool' + shadow = False + +[lines] + # a value of type 'bool' + antialiased = True + # any valid matplotlib color, eg an abbreviation like 'r' for red, a full + # name like 'orange', a hex color like '#efefef', a grayscale intensity + # like '0.5', or an RGBA tuple (1,0,0,1) + color = 'blue' + # 'butt' or 'round' or 'projecting' + dash_capstyle = 'butt' + # 'miter' or 'round' or 'bevel' + dash_joinstyle = 'miter' + # '-' or '--' or '-.' or ':' or 'steps' or '' or ' ' or None + linestyle = '-' + # a value of type 'float' + linewidth = 1.0 + # 'None' or 'o' or '.' or ',' or '^' or 'v' or '<' or '>' or 's' or '+' or ' + # x' or 'D' or 'd' or '1' or '2' or '3' or '4' or 'h' or 'H' or 'p' or '|' o + # r '_' + marker = 'None' + # a value of type 'float' + markeredgewidth = 0.5 + # a value of type 'float' + markersize = 6.0 + # 'butt' or 'round' or 'projecting' + solid_capstyle = 'butt' + # 'miter' or 'round' or 'bevel' + solid_joinstyle = 'miter' + +[mathtext] + # A fontconfig pattern. See the fontconfig user manual for more information + # . + bf = 'serif:bold' + # A fontconfig pattern. See the fontconfig user manual for more information + # . + cal = 'cursive' + # a value of type 'bool' + fallback_to_cm = True + # 'cm' or 'stix' or 'stixsans' or 'custom' + fontset = 'cm' + # A fontconfig pattern. See the fontconfig user manual for more information + # . + it = 'serif:oblique' + # A fontconfig pattern. See the fontconfig user manual for more information + # . + rm = 'serif' + # A fontconfig pattern. See the fontconfig user manual for more information + # . + sf = 'sans' + # A fontconfig pattern. See the fontconfig user manual for more information + # . + tt = 'monospace' + +[patch] + # a value of type 'bool' + antialiased = True + # any valid matplotlib color, eg an abbreviation like 'r' for red, a full + # name like 'orange', a hex color like '#efefef', a grayscale intensity + # like '0.5', or an RGBA tuple (1,0,0,1) + edgecolor = 'black' + # any valid matplotlib color, eg an abbreviation like 'r' for red, a full + # name like 'orange', a hex color like '#efefef', a grayscale intensity + # like '0.5', or an RGBA tuple (1,0,0,1) + facecolor = 'blue' + # a value of type 'float' + linewidth = 1.0 + +[savefig] + # a value of type 'float' + dpi = 100.0 + # any valid matplotlib color, eg an abbreviation like 'r' for red, a full + # name like 'orange', a hex color like '#efefef', a grayscale intensity + # like '0.5', or an RGBA tuple (1,0,0,1) + edgecolor = 'white' + # any valid matplotlib color, eg an abbreviation like 'r' for red, a full + # name like 'orange', a hex color like '#efefef', a grayscale intensity + # like '0.5', or an RGBA tuple (1,0,0,1) + facecolor = 'white' + # 'portrait' or 'landscape' + orientation = 'portrait' + +[text] + # any valid matplotlib color, eg an abbreviation like 'r' for red, a full + # name like 'orange', a hex color like '#efefef', a grayscale intensity + # like '0.5', or an RGBA tuple (1,0,0,1) + color = 'black' + # a value of type 'bool' + usetex = False + + [[latex]] + # a value of type 'bool' + dvipnghack = False + # a list of items each of which is a value of type 'str' + preamble = [] + # a value of type 'bool' + unicode = False + +[verbose] + # a value of type 'str' or a value of type 'unicode' or 'sys.stdout' + fileo = 'sys.stdout' + # 'silent' or 'helpful' or 'debug' or 'debug-annoying' + level = 'silent' + +[xticks] + # any valid matplotlib color, eg an abbreviation like 'r' for red, a full + # name like 'orange', a hex color like '#efefef', a grayscale intensity + # like '0.5', or an RGBA tuple (1,0,0,1) + color = 'black' + # 'in' or 'out' + direction = 'in' + # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' + # or 'large' or 'x-large' or 'xx-large' + labelsize = 'small' + + [[major]] + # a value of type 'float' + pad = 4.0 + # a value of type 'float' + size = 4.0 + + [[minor]] + # a value of type 'float' + pad = 4.0 + # a value of type 'float' + size = 2.0 + +[yticks] + # any valid matplotlib color, eg an abbreviation like 'r' for red, a full + # name like 'orange', a hex color like '#efefef', a grayscale intensity + # like '0.5', or an RGBA tuple (1,0,0,1) + color = 'black' + # 'in' or 'out' + direction = 'in' + # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' + # or 'large' or 'x-large' or 'xx-large' + labelsize = 'small' + + [[major]] + # a value of type 'float' + pad = 4.0 + # a value of type 'float' + size = 4.0 + + [[minor]] + # a value of type 'float' + pad = 4.0 + # a value of type 'float' + size = 2.0 \ No newline at end of file Modified: trunk/matplotlib/setup.py =================================================================== --- trunk/matplotlib/setup.py 2007-11-12 23:38:12 UTC (rev 4241) +++ trunk/matplotlib/setup.py 2007-11-13 13:50:29 UTC (rev 4242) @@ -133,21 +133,21 @@ print_raw("") print_raw("OPTIONAL BACKEND DEPENDENCIES") +if check_for_libpng() and options['build_agg']: + build_agg(ext_modules, packages) + rc['backend'] = 'Agg' +else: + rc['backend'] = 'SVG' +if options['build_image']: + build_image(ext_modules, packages) + +if options['build_windowing'] and sys.platform=='win32': + build_windowing(ext_modules, packages) + # the options can be True, False, or 'auto'. If True, try to build # regardless of the lack of dependencies. If auto, silently skip # when dependencies are missing. -hasgtk = check_for_gtk() -if options['build_gtk']: - if hasgtk or (options['build_gtk'] is True): - build_gdk(ext_modules, packages) - rc['backend'] = 'GTK' -if options['build_gtkagg']: - if hasgtk or (options['build_gtkagg'] is True): - options['build_agg'] = 1 - build_gtkagg(ext_modules, packages) - rc['backend'] = 'GTKAgg' - if options['build_tkagg']: if check_for_tk() or (options['build_tkagg'] is True): options['build_agg'] = 1 @@ -165,27 +165,22 @@ print_message("WxAgg extension not required for wxPython >= 2.8") rc['backend'] = 'WXAgg' +hasgtk = check_for_gtk() +if options['build_gtk']: + if hasgtk or (options['build_gtk'] is True): + build_gdk(ext_modules, packages) + rc['backend'] = 'GTK' +if options['build_gtkagg']: + if hasgtk or (options['build_gtkagg'] is True): + options['build_agg'] = 1 + build_gtkagg(ext_modules, packages) + rc['backend'] = 'GTKAgg' + # These are informational only. We don't build any extensions for them. check_for_qt() check_for_qt4() check_for_cairo() - -if check_for_libpng() and options['build_agg']: - build_agg(ext_modules, packages) - rc['backend'] = 'Agg' -else: - rc['backend'] = 'SVG' -if options['build_windowing'] and sys.platform=='win32': - build_windowing(ext_modules, packages) - -if options['build_image']: - build_image(ext_modules, packages) - -for mod in ext_modules: - if options['verbose']: - mod.extra_compile_args.append('-DVERBOSE') - print_raw("") print_raw("OPTIONAL DATE/TIMEZONE DEPENDENCIES") @@ -253,9 +248,20 @@ template = file('matplotlibrc.template').read() file('lib/matplotlib/mpl-data/matplotlibrc', 'w').write(template%rc) +# Write the default matplotlib.conf file +template = file('lib/matplotlib/mpl-data/matplotlib.conf.template').read() +template = template.replace("datapath = ", "#datapath = ") +template = template.replace("numerix = 'numpy'", "numerix = '%s'"%rc['numerix']) +template = template.replace(" use = 'Agg'", " use = '%s'"%rc['backend']) +file('lib/matplotlib/mpl-data/matplotlib.conf', 'w').write(template) + try: additional_params # has setupegg.py provided except NameError: additional_params = {} +for mod in ext_modules: + if options['verbose']: + mod.extra_compile_args.append('-DVERBOSE') + distrib = setup(name="matplotlib", version= __version__, description = "Matlab(TM) style python plotting package", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2007-11-12 23:38:15
|
Revision: 4241 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4241&view=rev Author: dsdale Date: 2007-11-12 15:38:12 -0800 (Mon, 12 Nov 2007) Log Message: ----------- expose verbose build option in setup.cfg Modified Paths: -------------- trunk/matplotlib/setup.cfg.template trunk/matplotlib/setup.py trunk/matplotlib/setupext.py Modified: trunk/matplotlib/setup.cfg.template =================================================================== --- trunk/matplotlib/setup.cfg.template 2007-11-12 23:29:44 UTC (rev 4240) +++ trunk/matplotlib/setup.cfg.template 2007-11-12 23:38:12 UTC (rev 4241) @@ -7,8 +7,10 @@ [status] # To suppress display of the dependencies and their versions # at the top of the build log, uncomment the following line: +#suppress = True # -#suppress = True +# Uncomment to insert lots of diagnostic prints in extension code +#verbose = True [provide_packages] # By default, matplotlib checks for a few dependencies and Modified: trunk/matplotlib/setup.py =================================================================== --- trunk/matplotlib/setup.py 2007-11-12 23:29:44 UTC (rev 4240) +++ trunk/matplotlib/setup.py 2007-11-12 23:38:12 UTC (rev 4241) @@ -7,9 +7,6 @@ setup.cfg.template for more information. """ - -VERBOSE = False # insert lots of diagnostic prints in extension code - # This dict will be updated as we try to select the best option during # the build process. However, values in setup.cfg will be used, if # defined. @@ -186,7 +183,7 @@ build_image(ext_modules, packages) for mod in ext_modules: - if VERBOSE: + if options['verbose']: mod.extra_compile_args.append('-DVERBOSE') print_raw("") Modified: trunk/matplotlib/setupext.py =================================================================== --- trunk/matplotlib/setupext.py 2007-11-12 23:29:44 UTC (rev 4240) +++ trunk/matplotlib/setupext.py 2007-11-12 23:38:12 UTC (rev 4241) @@ -99,6 +99,7 @@ # matplotlib build options, which can be altered using setup.cfg options = {'display_status': True, + 'verbose': False, 'provide_pytz': 'auto', 'provide_dateutil': 'auto', 'provide_configobj': 'auto', @@ -117,9 +118,13 @@ if os.path.exists("setup.cfg"): config = ConfigParser.SafeConfigParser() config.read("setup.cfg") + try: options['display_status'] = not config.getboolean("status", "suppress") except: pass + try: options['verbose'] = not config.getboolean("status", "verbose") + except: pass + try: options['provide_pytz'] = config.getboolean("provide_packages", "pytz") except: options['provide_pytz'] = 'auto' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2007-11-12 23:29:45
|
Revision: 4240 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4240&view=rev Author: dsdale Date: 2007-11-12 15:29:44 -0800 (Mon, 12 Nov 2007) Log Message: ----------- updated default matplotlib.conf Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf Modified: trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf =================================================================== --- trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf 2007-11-12 22:00:15 UTC (rev 4239) +++ trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf 2007-11-12 23:29:44 UTC (rev 4240) @@ -3,36 +3,36 @@ # This is a sample matplotlib configuration file. It should be placed # in HOME/.matplotlib/matplotlibrc (unix/linux like systems) and # C:\Documents and Settings\yourname\.matplotlib (win32 systems) -# +# # By default, the installer will overwrite the existing file in the install # path, so if you want to preserve yours, please move it to your HOME dir and # set the environment variable if necessary. -# +# # This file is best viewed in a editor which supports ini or conf mode syntax # highlighting. -# +# # Blank lines, or lines starting with a comment symbol, are ignored, # as are trailing comments. Other lines must have the format -# +# # key = val optional comment -# +# # val should be valid python syntax, just as you would use when setting # properties using rcParams. This should become more obvious by inspecting # the default values listed herein. -# +# # Colors: for the color values below, you can either use # - a matplotlib color string, such as r, k, or b # - an rgb tuple, such as (1.0, 0.5, 0.0) # - a hex string, such as #ff00ff or ff00ff # - a scalar grayscale intensity such as 0.75 # - a legal html color name, eg red, blue, darkslategray -# +# # Interactivity: see http://matplotlib.sourceforge.net/interactive.html. -# +# # ### CONFIGURATION BEGINS HERE ### # a value of type 'str' -datapath = '/usr/lib64/python2.5/site-packages/matplotlib-0.90.1_r3640-py2.5-linux-x86_64.egg/matplotlib/mpl-data' +datapath = '/usr/lib64/python2.5/site-packages/matplotlib/mpl-data' # one of 0, on, false, 1, no, n, y, off, yes, true interactive = False # a value of type 'bool' @@ -42,7 +42,7 @@ # 'Africa/Abidjan' or 'Africa/Accra' or 'Africa/Addis_Ababa' or 'Africa/Algiers' # or 'Africa/Asmara' or 'Africa/Asmera' or 'Africa/Bamako' or 'Africa/Bangui' o # r 'Africa/Banjul' or 'Africa/Bissau' or 'Africa/Blantyre' or 'Africa/Brazzavil -# <...snipped 10590 chars...> +# <...snipped 10590 chars...> # or 'Turkey' or 'UCT' or 'US/Alaska' or 'US/Aleutian' or 'US/Arizona' or 'US/Ce # ntral' or 'US/East-Indiana' or 'US/Eastern' or 'US/Hawaii' or 'US/Indiana-Star # ke' or 'US/Michigan' or 'US/Mountain' or 'US/Pacific' or 'US/Pacific-New' or ' @@ -72,14 +72,14 @@ # name like 'orange', a hex color like '#efefef', a grayscale intensity # like '0.5', or an RGBA tuple (1,0,0,1) labelcolor = 'black' - # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' + # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' # or 'large' or 'x-large' or 'xx-large' labelsize = 'medium' # a value of type 'float' linewidth = 1.0 # one of 0, on, false, 1, no, n, y, off, yes, true polargrid = True - # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' + # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' # or 'large' or 'x-large' or 'xx-large' titlesize = 'large' @@ -92,7 +92,7 @@ # 'TkAgg', 'Agg', 'Cairo', 'PS', 'PDF', 'SVG' # one of ps, qt4agg, tkagg, gtkagg, agg, cairo, gtkcairo, wxagg, qtagg, temp # late, svg, pdf - use = 'PS' + use = 'TkAgg' [[cairo]] # 'png' or 'ps' or 'pdf' or 'svg' @@ -127,7 +127,7 @@ [[svg]] # a value of type 'bool' - embed_chars = False + embed_chars = True # a value of type 'bool' image_inline = True # a value of type 'bool' @@ -191,7 +191,7 @@ serif = ['Bitstream Vera Serif', 'New Century Schoolbook', 'Century Schoolbook L', 'Utopia', 'ITC Bookman', 'Bookman', 'Nimbus Roman No9 L', 'Times New Roman', 'Times', 'Palatino', 'Charter', 'serif'] # a value of type 'float' size = 12.0 - # 'ultra-condensed' or 'extra-condensed' or 'condensed' or 'semi-condensed' + # 'ultra-condensed' or 'extra-condensed' or 'condensed' or 'semi-condensed' # or 'normal' or 'semi-expanded' or 'expanded' or 'extra-expanded' or 'ultra # -expanded' or 'wider' or 'narrower' stretch = 'normal' @@ -218,11 +218,11 @@ aspect = 'equal' # 'Accent' or 'Accent_r' or 'Blues' or 'Blues_r' or 'BrBG' or 'BrBG_r' or 'B # uGn' or 'BuGn_r' or 'BuPu' or 'BuPu_r' or 'Dark2' or 'Dark2_r' or 'GnBu' o - # r 'GnBu_r' or 'Greens' or 'Greens_r' or 'Greys' or 'Greys_r' or 'OrRd' or - # <...snipped 1010 chars...> - # ist_stern' or 'gist_stern_r' or 'gist_yarg' or 'gist_yarg_r' or 'gray' or + # r 'GnBu_r' or 'Greens' or 'Greens_r' or 'Greys' or 'Greys_r' or 'OrRd' or + # <...snipped 1010 chars...> + # ist_stern' or 'gist_stern_r' or 'gist_yarg' or 'gist_yarg_r' or 'gray' or # 'gray_r' or 'hot' or 'hot_r' or 'hsv' or 'hsv_r' or 'jet' or 'jet_r' or 'p - # ink' or 'pink_r' or 'prism' or 'prism_r' or 'spectral' or 'spectral_r' or + # ink' or 'pink_r' or 'prism' or 'prism_r' or 'spectral' or 'spectral_r' or # 'spring' or 'spring_r' or 'summer' or 'summer_r' or 'winter' or 'winter_r' cmap = 'jet' # 'bilinear' or 'nearest' or 'bicubic' or 'spline16' or 'spline36' or 'hanni @@ -237,7 +237,7 @@ [legend] # a value of type 'float' axespad = 0.02 - # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' + # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' # or 'large' or 'x-large' or 'xx-large' fontsize = 'medium' # a value of type 'float' @@ -289,6 +289,30 @@ # 'miter' or 'round' or 'bevel' solid_joinstyle = 'miter' +[mathtext] + # A fontconfig pattern. See the fontconfig user manual for more information + # . + bf = 'serif:bold' + # A fontconfig pattern. See the fontconfig user manual for more information + # . + cal = 'cursive' + # a value of type 'bool' + fallback_to_cm = True + # 'cm' or 'stix' or 'stixsans' or 'custom' + fontset = 'cm' + # A fontconfig pattern. See the fontconfig user manual for more information + # . + it = 'serif:oblique' + # A fontconfig pattern. See the fontconfig user manual for more information + # . + rm = 'serif' + # A fontconfig pattern. See the fontconfig user manual for more information + # . + sf = 'sans' + # A fontconfig pattern. See the fontconfig user manual for more information + # . + tt = 'monospace' + [patch] # a value of type 'bool' antialiased = True @@ -333,22 +357,6 @@ # a value of type 'bool' unicode = False - [[math]] - # a value of type 'str' - cal = 'cmsy10.ttf' - # a value of type 'str' - it = 'cmmi10.ttf' - # a value of type 'bool' - mathtext2 = False - # a value of type 'str' - mit = 'cmmi10.ttf' - # a value of type 'str' - nonascii = 'cmex10.ttf' - # a value of type 'str' - rm = 'cmr10.ttf' - # a value of type 'str' - tt = 'cmtt10.ttf' - [verbose] # a value of type 'str' or a value of type 'unicode' or 'sys.stdout' fileo = 'sys.stdout' @@ -362,7 +370,7 @@ color = 'black' # 'in' or 'out' direction = 'in' - # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' + # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' # or 'large' or 'x-large' or 'xx-large' labelsize = 'small' @@ -385,7 +393,7 @@ color = 'black' # 'in' or 'out' direction = 'in' - # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' + # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' # or 'large' or 'x-large' or 'xx-large' labelsize = 'small' @@ -399,4 +407,4 @@ # a value of type 'float' pad = 4.0 # a value of type 'float' - size = 2.0 + size = 2.0 \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2007-11-12 22:00:20
|
Revision: 4239 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4239&view=rev Author: dsdale Date: 2007-11-12 14:00:15 -0800 (Mon, 12 Nov 2007) Log Message: ----------- expose remaining build options in setup.cfg. See setup.cfg for details Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/configobj.py trunk/matplotlib/lib/dateutil/__init__.py trunk/matplotlib/lib/pytz/__init__.py trunk/matplotlib/setup.cfg.template trunk/matplotlib/setup.py trunk/matplotlib/setupext.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2007-11-12 20:45:15 UTC (rev 4238) +++ trunk/matplotlib/CHANGELOG 2007-11-12 22:00:15 UTC (rev 4239) @@ -1,3 +1,9 @@ +2007-11-12 Exposed all the build options in setup.cfg. These options are + read into a dict called "options" by setupext.py. Also, added + "-mpl" tags to the version strings for packages provided by + matplotlib. Versions provided by mpl will be identified and + updated on subsequent installs - DSD + 2007-11-12 Added support for STIX fonts. A new rcParam, mathtext.fontset, can be used to choose between: Modified: trunk/matplotlib/lib/configobj.py =================================================================== --- trunk/matplotlib/lib/configobj.py 2007-11-12 20:45:15 UTC (rev 4238) +++ trunk/matplotlib/lib/configobj.py 2007-11-12 22:00:15 UTC (rev 4239) @@ -109,7 +109,7 @@ True, False = 1, 0 -__version__ = '4.4.0' +__version__ = '4.4.0-mpl' __revision__ = '$Id: configobj.py 156 2006-01-31 14:57:08Z fuzzyman $' Modified: trunk/matplotlib/lib/dateutil/__init__.py =================================================================== --- trunk/matplotlib/lib/dateutil/__init__.py 2007-11-12 20:45:15 UTC (rev 4238) +++ trunk/matplotlib/lib/dateutil/__init__.py 2007-11-12 22:00:15 UTC (rev 4239) @@ -6,4 +6,4 @@ """ __author__ = "Gustavo Niemeyer <gu...@ni...>" __license__ = "PSF License" -__version__ = "1.2" +__version__ = "1.2-mpl" Modified: trunk/matplotlib/lib/pytz/__init__.py =================================================================== --- trunk/matplotlib/lib/pytz/__init__.py 2007-11-12 20:45:15 UTC (rev 4238) +++ trunk/matplotlib/lib/pytz/__init__.py 2007-11-12 22:00:15 UTC (rev 4239) @@ -12,7 +12,7 @@ OLSON_VERSION = '2007g' VERSION = OLSON_VERSION #VERSION = OLSON_VERSION + '.2' -__version__ = OLSON_VERSION +__version__ = OLSON_VERSION+'-mpl' OLSEN_VERSION = OLSON_VERSION # Old releases had this misspelling Modified: trunk/matplotlib/setup.cfg.template =================================================================== --- trunk/matplotlib/setup.cfg.template 2007-11-12 20:45:15 UTC (rev 4238) +++ trunk/matplotlib/setup.cfg.template 2007-11-12 22:00:15 UTC (rev 4239) @@ -13,7 +13,11 @@ [provide_packages] # By default, matplotlib checks for a few dependencies and # installs them if missing. This feature can be turned off -# by uncommenting the following lines: +# by uncommenting the following lines. Acceptible values are: +# True: install, overwrite an existing installation +# False: do not install +# auto: install only if the package is unavailable. This +# is the default behavior # ## Date/timezone support: #pytz = False @@ -40,8 +44,34 @@ # installed on your system. # # You can uncomment any the following lines if you know you do -# not want to use the GUI toolkit. +# not want to use the GUI toolkit. Acceptible values are: +# True: build the extension. Exits with a warning if the +# required dependencies are not available +# False: do not build the extension +# auto: build if the required dependencies are available, +# otherwise skip silently. This is the default +# behavior +# #gtk = False #gtkagg = False #tkagg = False #wxagg = False + +[rc_options] +# User-configurable options +# +# Default backend, one of: Agg, Cairo, CocoaAgg, GTK, GTKAgg, +# GTKCairo, FltkAgg, QtAgg, Qt4Agg, SVG, TkAgg, WX, WXAgg. +# Only the Agg and SVG backends do not require external +# dependencies. Do not choose GTK, GTKAgg, GTKCairo, TkAgg or +# WXAgg if you have disabled the relevent extension modules. +# Agg will be used by default. +#backend = Agg +# +# The numerix module was historically used to provide +# compatibility between the Numeric, numarray, and NumPy array +# packages. Now that NumPy has emerge as the universal array +# package for python, numerix is not really necessary and is +# maintained to provide backward compatibility. Do not change +# this unless you have a compelling reason to do so. +#numerix = numpy Modified: trunk/matplotlib/setup.py =================================================================== --- trunk/matplotlib/setup.py 2007-11-12 20:45:15 UTC (rev 4238) +++ trunk/matplotlib/setup.py 2007-11-12 22:00:15 UTC (rev 4239) @@ -3,74 +3,19 @@ matplotlib, inlcuding the *-devel versions of these libraries if you are using a package manager like RPM or debian. -matplotlib has added some extension module code which can optionally -be built by setting the appropriate flag below. - -The GTKAgg and TkAgg will try to build if they detect pygtk or Tkinter -respectively; set them to 0 if you do not want to build them +The matplotlib build options can be modified with a setup.cfg file. See +setup.cfg.template for more information. """ -rc = {'backend':'PS', 'numerix':'numpy'} - -# build the image support module - requires agg. By default, matplotlib will -# build support for whatever array packages you have installed. -BUILD_IMAGE = 1 - - -# build a small extension to manage the focus on win32 platforms. -#BUILD_WINDOWING = 0 -BUILD_WINDOWING = 'auto' - - VERBOSE = False # insert lots of diagnostic prints in extension code +# This dict will be updated as we try to select the best option during +# the build process. However, values in setup.cfg will be used, if +# defined. +rc = {'backend':'Agg', 'numerix':'numpy'} - -## You shouldn't need to customize below this point -import ConfigParser -import os - -# Build the antigrain geometry toolkit. Agg makes heavy use of -# templates, so it probably requires a fairly recent compiler to build -# it. It makes very nice antialiased output and also supports alpha -# blending -BUILD_AGG = 1 -BUILD_GTKAGG = 1 -BUILD_GTK = 1 - -# build TK GUI with Agg renderer ; requires Tkinter Python extension -# and Tk includes -# Use False or 0 if you don't want to build -BUILD_TKAGG = 'auto' - - -# build wxPython extension code to efficiently blit agg into wx. Only -# needed for wxpython <2.8 if you plan on doing animations -BUILD_WXAGG = 1 - -if os.path.exists("setup.cfg"): - config = ConfigParser.SafeConfigParser() - config.read("setup.cfg") - try: - BUILD_GTK = config.getboolean("gui_support", "gtk") - except: - pass - try: - BUILD_GTKAGG = config.getboolean("gui_support", "gtkagg") - except: - pass - try: - BUILD_TKAGG = config.getboolean("gui_support", "tkagg") - except: - pass - try: - BUILD_WXAGG = config.getboolean("gui_support", "wxagg") - except: - pass - - # BEFORE importing disutils, remove MANIFEST. distutils doesn't properly # update it when the contents of directories change. import os @@ -106,7 +51,7 @@ check_for_cairo, check_provide_traits, check_provide_pytz, \ check_provide_dateutil, check_provide_configobj, check_for_dvipng, \ check_for_ghostscript, check_for_latex, check_for_pdftops, \ - check_for_datetime + check_for_datetime, options #import distutils.sysconfig # jdh @@ -127,12 +72,6 @@ ext_modules = [] -# these are not optional -BUILD_FT2FONT = 1 -BUILD_TTCONV = 1 -BUILD_CONTOUR = 1 -BUILD_NXUTILS = 1 - for line in file('lib/matplotlib/__init__.py').readlines(): if (line.startswith('__version__')): exec(line.strip()) @@ -166,16 +105,6 @@ if not check_for_numpy(): sys.exit() -# The NUMERIX variable (a list) is left over from the days when it had -# a string for each of the supported backends. Now there is only one -# supported backend, so this approach could (should?) get changed for -# simplicity. - -import numpy -NUMERIX = ['numpy'] - -rc['numerix'] = NUMERIX[-1] - try: import subprocess except ImportError: havesubprocess = False else: havesubprocess = True @@ -196,61 +125,64 @@ if not check_for_freetype(): sys.exit(1) -if BUILD_FT2FONT: - build_ft2font(ext_modules, packages) +build_ft2font(ext_modules, packages) +build_ttconv(ext_modules, packages) +build_contour(ext_modules, packages) +build_nxutils(ext_modules, packages) -if BUILD_TTCONV: - build_ttconv(ext_modules, packages) - -if 1: # I don't think we need to make these optional - build_contour(ext_modules, packages) - build_nxutils(ext_modules, packages) - build_swigagg(ext_modules, packages) build_transforms(ext_modules, packages) print_raw("") print_raw("OPTIONAL BACKEND DEPENDENCIES") -if check_for_gtk() and (BUILD_GTK or BUILD_GTKAGG): - if BUILD_GTK: + +# the options can be True, False, or 'auto'. If True, try to build +# regardless of the lack of dependencies. If auto, silently skip +# when dependencies are missing. +hasgtk = check_for_gtk() +if options['build_gtk']: + if hasgtk or (options['build_gtk'] is True): build_gdk(ext_modules, packages) rc['backend'] = 'GTK' - if BUILD_GTKAGG: - BUILD_AGG = 1 +if options['build_gtkagg']: + if hasgtk or (options['build_gtkagg'] is True): + options['build_agg'] = 1 build_gtkagg(ext_modules, packages) rc['backend'] = 'GTKAgg' -if check_for_tk() and BUILD_TKAGG: - BUILD_AGG = 1 - build_tkagg(ext_modules, packages) - rc['backend'] = 'TkAgg' +if options['build_tkagg']: + if check_for_tk() or (options['build_tkagg'] is True): + options['build_agg'] = 1 + build_tkagg(ext_modules, packages) + rc['backend'] = 'TkAgg' -explanation = None -if check_for_wx() and BUILD_WXAGG: - BUILD_AGG = 1 - import wx - if getattr(wx, '__version__', '0.0')[0:3] < '2.8': - build_wxagg(ext_modules, packages) - wxagg_backend_status = "yes" - else: - print_message("WxAgg extension not required for wxPython >= 2.8") - rc['backend'] = 'WXAgg' +if options['build_wxagg']: + if check_for_wx() or (options['build_wxagg'] is True): + options['build_agg'] = 1 + import wx + if getattr(wx, '__version__', '0.0')[0:3] < '2.8' : + build_wxagg(ext_modules, packages) + wxagg_backend_status = "yes" + else: + print_message("WxAgg extension not required for wxPython >= 2.8") + rc['backend'] = 'WXAgg' -# These are informational only. We don't build -# any extensions for them. +# These are informational only. We don't build any extensions for them. check_for_qt() check_for_qt4() check_for_cairo() -if check_for_libpng() and BUILD_AGG: +if check_for_libpng() and options['build_agg']: build_agg(ext_modules, packages) - if rc['backend'] == 'PS': rc['backend'] = 'Agg' + rc['backend'] = 'Agg' +else: + rc['backend'] = 'SVG' -if BUILD_WINDOWING and sys.platform=='win32': +if options['build_windowing'] and sys.platform=='win32': build_windowing(ext_modules, packages) -if BUILD_IMAGE: +if options['build_image']: build_image(ext_modules, packages) for mod in ext_modules: @@ -314,12 +246,13 @@ print_raw("[Edit setup.cfg to suppress the above messages]") print_line() -# packagers: set rc['numerix'] and rc['backend'] here to override the auto -# defaults, eg -#rc['numerix'] = numpy -#rc['backend'] = 'GTKAgg' +# Write the default matplotlibrc file if sys.platform=='win32': - rc = dict(backend='TkAgg', numerix='numpy') + rc['backend'] = 'TkAgg' + rc['numerix'] = 'numpy' +else: + if options['backend']: rc['backend'] = options['backend'] + if options['numerix']: rc['numerix'] = options['numerix'] template = file('matplotlibrc.template').read() file('lib/matplotlib/mpl-data/matplotlibrc', 'w').write(template%rc) Modified: trunk/matplotlib/setupext.py =================================================================== --- trunk/matplotlib/setupext.py 2007-11-12 20:45:15 UTC (rev 4238) +++ trunk/matplotlib/setupext.py 2007-11-12 22:00:15 UTC (rev 4239) @@ -97,38 +97,64 @@ # for nonstandard installation/build with --prefix variable numpy_inc_dirs = [] -# Based on the contents of setup.cfg, determine if the status block -# should be displayed, if missing external packages should be provided -display_status = True -provide_pytz = True -provide_dateutil = True -provide_configobj = True -provide_traits = True +# matplotlib build options, which can be altered using setup.cfg +options = {'display_status': True, + 'provide_pytz': 'auto', + 'provide_dateutil': 'auto', + 'provide_configobj': 'auto', + 'provide_traits': 'auto', + 'build_agg': True, + 'build_gtk': 'auto', + 'build_gtkagg': 'auto', + 'build_tkagg': 'auto', + 'build_wxagg': 'auto', + 'build_image': True, + 'build_windowing': True, + 'backend': None, + 'numerix': None} + +# Based on the contents of setup.cfg, determine the build options if os.path.exists("setup.cfg"): config = ConfigParser.SafeConfigParser() config.read("setup.cfg") - try: - display_status = not config.getboolean("status", "suppress") - except: - pass - try: - provide_pytz = config.getboolean("provide_packages", "pytz") - except: - pass - try: - provide_dateutil = config.getboolean("provide_packages", "dateutil") - except: - pass - try: - provide_configobj = config.getboolean("provide_packages", "configobj") - except: - pass - try: - provide_traits = config.getboolean("provide_packages", "enthought.traits") - except: - pass + try: options['display_status'] = not config.getboolean("status", "suppress") + except: pass -if display_status: + try: options['provide_pytz'] = config.getboolean("provide_packages", "pytz") + except: options['provide_pytz'] = 'auto' + + try: options['provide_dateutil'] = config.getboolean("provide_packages", + "dateutil") + except: options['provide_dateutil'] = 'auto' + + try: options['provide_configobj'] = config.getboolean("provide_packages", + "configobj") + except: options['provide_configobj'] = 'auto' + + try: options['provide_traits'] = config.getboolean("provide_packages", + "enthought.traits") + except: options['provide_traits'] = 'auto' + + try: options['build_gtk'] = config.getboolean("gui_support", "gtk") + except: options['build_gtk'] = 'auto' + + try: options['build_gtkagg'] = config.getboolean("gui_support", "gtkagg") + except: options['build_gtkagg'] = 'auto' + + try: options['build_tkagg'] = config.getboolean("gui_support", "tkagg") + except: options['build_tkagg'] = 'auto' + + try: options['build_wxagg'] = config.getboolean("gui_support", "wxagg") + except: options['build_wxagg'] = 'auto' + + try: options['backend'] = config.get("rc_options", "backend") + except: pass + + try: options['numerix'] = config.get("rc_options", "numerix") + except: pass + + +if options['display_status']: def print_line(char='='): print char * 76 @@ -356,24 +382,34 @@ return True def check_provide_pytz(hasdatetime=True): + if hasdatetime and (options['provide_pytz'] is True): + print_status("pytz", "matplotlib will provide") + return True try: import pytz except ImportError: - if hasdatetime and provide_pytz: + if hasdatetime and options['provide_pytz']: print_status("pytz", "matplotlib will provide") return True else: print_status("pytz", "no") return False else: - print_status("pytz", pytz.__version__) - return False + if pytz.__version__.endswith('mpl'): + print_status("pytz", "matplotlib will provide") + return True + else: + print_status("pytz", pytz.__version__) + return False def check_provide_dateutil(hasdatetime=True): + if hasdatetime and (options['provide_dateutil'] is True): + print_status("dateutil", "matplotlib will provide") + return True try: import dateutil except ImportError: - if hasdatetime and provide_dateutil: + if hasdatetime and options['provide_dateutil']: print_status("dateutil", "matplotlib will provide") return True else: @@ -381,26 +417,41 @@ return False else: try: - print_status("dateutil", dateutil.__version__) + if dateutil.__version__.endswith('mpl'): + print_status("dateutil", "matplotlib will provide") + return True + else: + print_status("dateutil", dateutil.__version__) + return False except AttributeError: print_status("dateutil", "present, version unknown") - return False + return False def check_provide_configobj(): + if options['provide_configobj'] is True: + print_status("configobj", "matplotlib will provide") + return True try: import configobj except ImportError: - if provide_configobj: + if options['provide_configobj']: print_status("configobj", "matplotlib will provide") return True else: print_status("configobj", "no") return False else: - print_status("configobj", configobj.__version__) - return False + if configobj.__version__.endswith('mpl'): + print_status("configobj", "matplotlib will provide") + return True + else: + print_status("configobj", configobj.__version__) + return False def check_provide_traits(): + if options['provide_traits'] is True: + print_status("enthought.traits", "matplotlib will provide") + return True try: from enthought import traits try: @@ -416,7 +467,7 @@ print_status("enthought.traits", version.version) return False except ImportError: - if provide_traits: + if options['provide_traits']: print_status("enthought.traits", "matplotlib will provide") return True else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-12 20:45:18
|
Revision: 4238 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4238&view=rev Author: mdboom Date: 2007-11-12 12:45:15 -0800 (Mon, 12 Nov 2007) Log Message: ----------- [ 1358130 ] Cannot get underscore in mathtext Fixed. Modified Paths: -------------- trunk/matplotlib/examples/mathtext_examples.py trunk/matplotlib/lib/matplotlib/_mathtext_data.py trunk/matplotlib/lib/matplotlib/mathtext.py Modified: trunk/matplotlib/examples/mathtext_examples.py =================================================================== --- trunk/matplotlib/examples/mathtext_examples.py 2007-11-12 20:27:33 UTC (rev 4237) +++ trunk/matplotlib/examples/mathtext_examples.py 2007-11-12 20:45:15 UTC (rev 4238) @@ -6,7 +6,7 @@ stests = [ r'Kerning: AVA $AVA$', - r'\$100.00 $\alpha$', + r'\$100.00 $\alpha \_$', r'$\frac{\$100.00}{y}$', r'$x y$', r'$x+y\ x=y\ x<y\ x:y\ x,y\ x@y$', Modified: trunk/matplotlib/lib/matplotlib/_mathtext_data.py =================================================================== --- trunk/matplotlib/lib/matplotlib/_mathtext_data.py 2007-11-12 20:27:33 UTC (rev 4237) +++ trunk/matplotlib/lib/matplotlib/_mathtext_data.py 2007-11-12 20:45:15 UTC (rev 4238) @@ -117,6 +117,7 @@ r'%' : ('cmr10', 48), r'\$' : ('cmr10', 99), r'@' : ('cmr10', 111), + r'\_' : ('cmtt10', 79), r'\Gamma' : ('cmr10', 19), r'\Delta' : ('cmr10', 6), r'\Theta' : ('cmr10', 7), @@ -2236,6 +2237,7 @@ '$': 36, '{': 123, '}': 125, +'_': 95, 'imath': 0x131, 'circumflexaccent' : 770, 'combiningbreve' : 774, Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2007-11-12 20:27:33 UTC (rev 4237) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2007-11-12 20:45:15 UTC (rev 4238) @@ -1975,7 +1975,7 @@ ).setParseAction(self.customspace).setName('customspace') unicode_range = u"\U00000080-\U0001ffff" - symbol =(Regex(UR"([a-zA-Z0-9 +\-*/<>=:,.;!'@()%s])|(\\[%%${}\[\]])" % unicode_range) + symbol =(Regex(UR"([a-zA-Z0-9 +\-*/<>=:,.;!'@()%s])|(\\[%%${}\[\]_])" % unicode_range) | Combine( bslash + oneOf(tex2uni.keys()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-12 20:27:36
|
Revision: 4237 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4237&view=rev Author: mdboom Date: 2007-11-12 12:27:33 -0800 (Mon, 12 Nov 2007) Log Message: ----------- [ 1448342 ] FigureCanvasAgg.print_figure fails with StringIO 'file' Added support to write png to an arbitrary Python file-like object in the agg backend. Will continue to use faster C-only calls if the file-like object is in fact a file. Also, clean up exception handling in write_png. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py trunk/matplotlib/src/_backend_agg.cpp Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2007-11-12 20:08:11 UTC (rev 4236) +++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2007-11-12 20:27:33 UTC (rev 4237) @@ -415,5 +415,5 @@ def print_png(self, filename, *args, **kwargs): self.draw() - self.get_renderer()._renderer.write_png(str(filename), self.figure.dpi.get()) + self.get_renderer()._renderer.write_png(filename, self.figure.dpi.get()) Modified: trunk/matplotlib/src/_backend_agg.cpp =================================================================== --- trunk/matplotlib/src/_backend_agg.cpp 2007-11-12 20:08:11 UTC (rev 4236) +++ trunk/matplotlib/src/_backend_agg.cpp 2007-11-12 20:27:33 UTC (rev 4237) @@ -2256,7 +2256,22 @@ } +static void write_png_data(png_structp png_ptr, png_bytep data, png_size_t length) { + PyObject* py_file_obj = (PyObject*)png_get_io_ptr(png_ptr); + PyObject* write_method = PyObject_GetAttrString(py_file_obj, "write"); + PyObject_CallFunction(write_method, "s#", data, length); + + // MGDTODO: Check NULL on failure +} +static void flush_png_data(png_structp png_ptr) { + PyObject* py_file_obj = (PyObject*)png_get_io_ptr(png_ptr); + PyObject* flush_method = PyObject_GetAttrString(py_file_obj, "write"); + if (flush_method) { + PyObject_CallFunction(flush_method, ""); + } +} + // this code is heavily adapted from the paint license, which is in // the file paint.license (BSD compatible) included in this // distribution. TODO, add license file to MANIFEST.in and CVS @@ -2267,97 +2282,96 @@ args.verify_length(1, 2); - FILE *fp; - Py::Object o = Py::Object(args[0]); - bool fpclose = true; - if (o.isString()) { - std::string fileName = Py::String(o); + FILE *fp = NULL; + Py::Object py_fileobj = Py::Object(args[0]); + if (py_fileobj.isString()) { + std::string fileName = Py::String(py_fileobj); const char *file_name = fileName.c_str(); if ((fp = fopen(file_name, "wb")) == NULL) throw Py::RuntimeError( Printf("Could not open file %s", file_name).str() ); } else { - if ((fp = PyFile_AsFile(o.ptr())) == NULL) - throw Py::TypeError("Could not convert object to file pointer"); - fpclose = false; + if ((fp = PyFile_AsFile(py_fileobj.ptr())) == NULL) { + PyObject* write_method = PyObject_GetAttrString(py_fileobj.ptr(), "write"); + if (!(write_method && PyCallable_Check(write_method))) + throw Py::TypeError("Object does not appear to be a Python file-like object"); + } } + + png_bytep *row_pointers = NULL; + png_structp png_ptr = NULL; + png_infop info_ptr = NULL; - png_structp png_ptr; - png_infop info_ptr; - struct png_color_8_struct sig_bit; - png_uint_32 row; + try { + struct png_color_8_struct sig_bit; + png_uint_32 row; + + row_pointers = new png_bytep[height]; + for (row = 0; row < height; ++row) { + row_pointers[row] = pixBuffer + row * width * 4; + } - png_bytep *row_pointers = new png_bytep[height]; - for (row = 0; row < height; ++row) { - row_pointers[row] = pixBuffer + row * width * 4; - } + png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + if (png_ptr == NULL) { + throw Py::RuntimeError("Could not create write struct"); + } + info_ptr = png_create_info_struct(png_ptr); + if (info_ptr == NULL) { + throw Py::RuntimeError("Could not create info struct"); + } - if (fp == NULL) { - delete [] row_pointers; - throw Py::RuntimeError("Could not open file"); - } + if (setjmp(png_ptr->jmpbuf)) { + throw Py::RuntimeError("Error building image"); + } - - png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); - if (png_ptr == NULL) { - if (fpclose) fclose(fp); - delete [] row_pointers; - throw Py::RuntimeError("Could not create write struct"); - } - - info_ptr = png_create_info_struct(png_ptr); - if (info_ptr == NULL) { - if (fpclose) fclose(fp); - png_destroy_write_struct(&png_ptr, &info_ptr); - delete [] row_pointers; - throw Py::RuntimeError("Could not create info struct"); - } - - if (setjmp(png_ptr->jmpbuf)) { - if (fpclose) fclose(fp); - png_destroy_write_struct(&png_ptr, &info_ptr); - delete [] row_pointers; - throw Py::RuntimeError("Error building image"); - } - - png_init_io(png_ptr, fp); - png_set_IHDR(png_ptr, info_ptr, - width, height, 8, - PNG_COLOR_TYPE_RGB_ALPHA, PNG_INTERLACE_NONE, - PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); + if (fp) { + png_init_io(png_ptr, fp); + } else { + png_set_write_fn(png_ptr, (void*)py_fileobj.ptr(), + &write_png_data, &flush_png_data); + } + png_set_IHDR(png_ptr, info_ptr, + width, height, 8, + PNG_COLOR_TYPE_RGB_ALPHA, PNG_INTERLACE_NONE, + PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); - // Save the dpi of the image in the file - if (args.size() == 2) { - double dpi = Py::Float(args[1]); - size_t dots_per_meter = (size_t)(dpi / (2.54 / 100.0)); - png_set_pHYs(png_ptr, info_ptr, dots_per_meter, dots_per_meter, PNG_RESOLUTION_METER); + // Save the dpi of the image in the file + if (args.size() == 2) { + double dpi = Py::Float(args[1]); + size_t dots_per_meter = (size_t)(dpi / (2.54 / 100.0)); + png_set_pHYs(png_ptr, info_ptr, dots_per_meter, dots_per_meter, PNG_RESOLUTION_METER); + } + + // this a a color image! + sig_bit.gray = 0; + sig_bit.red = 8; + sig_bit.green = 8; + sig_bit.blue = 8; + /* if the image has an alpha channel then */ + sig_bit.alpha = 8; + png_set_sBIT(png_ptr, info_ptr, &sig_bit); + + png_write_info(png_ptr, info_ptr); + png_write_image(png_ptr, row_pointers); + png_write_end(png_ptr, info_ptr); + + /* Changed calls to png_destroy_write_struct to follow + http://www.libpng.org/pub/png/libpng-manual.txt. + This ensures the info_ptr memory is released. + */ + + } catch (...) { + if (fp) fclose(fp); + delete [] row_pointers; + if (png_ptr && info_ptr) png_destroy_write_struct(&png_ptr, &info_ptr); + throw; } - // this a a color image! - sig_bit.gray = 0; - sig_bit.red = 8; - sig_bit.green = 8; - sig_bit.blue = 8; - /* if the image has an alpha channel then */ - sig_bit.alpha = 8; - png_set_sBIT(png_ptr, info_ptr, &sig_bit); - - png_write_info(png_ptr, info_ptr); - png_write_image(png_ptr, row_pointers); - png_write_end(png_ptr, info_ptr); - - /* Changed calls to png_destroy_write_struct to follow - http://www.libpng.org/pub/png/libpng-manual.txt. - This ensures the info_ptr memory is released. - */ - png_destroy_write_struct(&png_ptr, &info_ptr); - delete [] row_pointers; - - if (fpclose) fclose(fp); - + if (fp) fclose(fp); + return Py::Object(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |