Skip to content

Make pyshp and pyproj external dependencies #234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Dec 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
900c28e
mostly removes pyproj.py
micahcochran Nov 30, 2015
ad5cf0e
mostly removes shapefile.py
micahcochran Nov 30, 2015
7d7303d
Update to import pyproj and pyshp "shapefile"
micahcochran Nov 30, 2015
12b182e
update shapefile (pyshp) import location
micahcochran Nov 30, 2015
1208d44
update to pyproj import location
micahcochran Nov 30, 2015
788af31
Update pyproj import location
micahcochran Nov 30, 2015
3c4521b
Update import location for pyproj
micahcochran Nov 30, 2015
66269cf
Deleting LICENSE_pyshp
micahcochran Nov 30, 2015
16092f4
Updates README.md: pyproj and pyshp requirements
micahcochran Nov 30, 2015
faf2a2e
pip install -r requirements.txt added .travis.yml
micahcochran Nov 30, 2015
82d77b5
Created requirements.txt
micahcochran Nov 30, 2015
fef60e7
Update setup.py: removing PROJ.4
micahcochran Nov 30, 2015
fc9ab79
Updating Changelog
micahcochran Dec 1, 2015
f3f31fa
__init__.py: corrected spelling of import
micahcochran Dec 1, 2015
6e11c3c
proj.py: update import location for pyproj
micahcochran Dec 1, 2015
a990838
Update setup.py: _geoslib.c
micahcochran Dec 1, 2015
9de9ac8
Deleting pyproj.py
micahcochran Dec 1, 2015
3329b83
skip tests under certain conditions
micahcochran Dec 4, 2015
b25591c
forgot import pyproj
micahcochran Dec 4, 2015
8a3a8cb
adding pip install nose
micahcochran Dec 4, 2015
a35f92c
removed skipif, using SkipTest Exception
micahcochran Dec 4, 2015
616ec79
requirements for Python 2.6
micahcochran Dec 5, 2015
09f5f27
added requirements for Python 2.6, removed nose
micahcochran Dec 5, 2015
d4c3848
added @skipIf to skip tests
micahcochran Dec 5, 2015
5600a3f
Delete shapefile.py
micahcochran Dec 5, 2015
4cacb5b
Bumped to Python 2.6 removed comment for pyproj
micahcochran Dec 7, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .requirements-2.6.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
unittest2
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ install:
pip install --upgrade setuptools
pip install $NUMPY
pip install $MPL
pip install -r requirements.txt

- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install -r .requirements-2.6.txt; fi

- |
cd geos-3.3.3
export GEOS_DIR=$HOME/.local/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if the GEOS stuff can be eliminated? Wasn't only for pyproj? (I could be wrong, though).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is failing because I removed the code from setup.py to compile _geoslib.c which is for GEOS library. Oops.

At first glance, shapely looks like it could be replaced GEOS. Also, that would put the burden of installing GEOS onto shapely package.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I suspect we don't need to compile geos anymore. So try taking that
out of the travis yaml. As for shapely, there are definite benefits to
updating the codebase to depend on that very nice package, but I think that
is orthogonal to the problem at hand.

On Tue, Dec 1, 2015 at 1:18 PM, Micah Cochran notifications@github.com
wrote:

In .travis.yml
#234 (comment):

@@ -32,6 +32,7 @@ install:
pip install --upgrade setuptools
pip install $NUMPY
pip install $MPL

  • pip install -r requirements.txt
  • |
    cd geos-3.3.3
    export GEOS_DIR=$HOME/.local/

This is failing because I removed the code from setup.py to compile
_geoslib.c which is for GEOS library. Oops.

At first glance, shapely http://toblerity.org/shapely/manual.html looks
like it could be replaced GEOS. Also, that would put the burden of
installing GEOS onto shapely package.


Reply to this email directly or view it on GitHub
https://github.com/matplotlib/basemap/pull/234/files#r46316025.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume compiling GEOS isn't a huge issue.

Migrating to shapely should be done at a later point in time.

Expand Down
2 changes: 2 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
version 1.0.8 (not yet released)
--------------------------------
* removes inline pyshp and pyproj code and uses makes these packages required
external dependencies (handling issue 230).
* add 'textcolor' kwarg to drawmeridians and drawparallels (issue 145).
* don't assume grid is regular when adding cyclic point in addcyclic.
New kwargs 'axis' and 'cyclic' added. More than one array
Expand Down
3 changes: 0 additions & 3 deletions LICENSE_pyshp

This file was deleted.

7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ using matplotlib.

* numpy

* [pyproj](https://github.com/jswhit/pyproj)

* [pyshp](https://github.com/GeospatialPython/pyshp)

* The GEOS (Geometry Engine - Open Source) library (version 3.1.1 or higher).
Source code is included in the geos-3.3.3 directory.

Expand All @@ -31,9 +35,6 @@ source code for the GEOS library is
included in the 'geos-3.3.3' directory under the terms given in
LICENSE_geos.

shapefile.py from pyshp.googlecode.com is included under the terms given
in LICENSE_pyshp.

the land-sea mask, coastline, lake, river and political boundary data are extracted
from datasets provided with the [Generic Mapping Tools (GMT)](http://gmt.soest.hawaii.edu)
and are included under the terms given in LICENSE_data.
Expand Down
5 changes: 3 additions & 2 deletions examples/allskymap.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
from numpy import *
import matplotlib.pyplot as pl
from matplotlib.pyplot import *
from mpl_toolkits.basemap import Basemap, pyproj
from mpl_toolkits.basemap.pyproj import Geod
from mpl_toolkits.basemap import Basemap
import pyproj
from pyproj import Geod

__all__ = ['AllSkyMap']

Expand Down
3 changes: 2 additions & 1 deletion examples/testwmsimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from a WMS server and display it on a map (using the
wmsimage convenience method)
"""
from mpl_toolkits.basemap import Basemap, pyproj
from mpl_toolkits.basemap import Basemap
import pyproj
from datetime import datetime
import numpy as np
import matplotlib.pyplot as plt
Expand Down
2 changes: 1 addition & 1 deletion examples/utmtest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import print_function
from mpl_toolkits.basemap import pyproj
import pyproj
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
# proj4 definition of UTM zone 17.
Expand Down
4 changes: 2 additions & 2 deletions lib/mpl_toolkits/basemap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from matplotlib.patches import Ellipse, Circle, Polygon, FancyArrowPatch
from matplotlib.lines import Line2D
from matplotlib.transforms import Bbox
from . import pyproj
import pyproj
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib.image import imread
import sys, os, math
Expand Down Expand Up @@ -2128,7 +2128,7 @@ def readshapefile(self,shapefile,name,drawbounds=True,zorder=None,
matplotlib.patches.LineCollection object is appended to the tuple.
"""
import shapefile as shp
from .shapefile import Reader
from shapefile import Reader
shp.default_encoding = default_encoding
if not os.path.exists('%s.shp'%shapefile):
raise IOError('cannot locate %s.shp'%shapefile)
Expand Down
2 changes: 1 addition & 1 deletion lib/mpl_toolkits/basemap/proj.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
from . import pyproj
import pyproj
import math
from matplotlib.cbook import dedent

Expand Down
Loading