Skip to content

Commit

Permalink
Merge pull request #39 from ljwolf/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
ljwolf authored Mar 15, 2019
2 parents d142291 + 2713bcc commit 92552fc
Show file tree
Hide file tree
Showing 9 changed files with 1,977 additions and 1,607 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ install:
- python setup.py install

script:
- python -c 'import cenpy; print(cenpy._version)'
- python -c 'import cenpy; print(cenpy.__version__)'
- python setup.py sdist > /dev/null
- nosetests cenpy/

Expand Down
3 changes: 1 addition & 2 deletions cenpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
__version__ == '0.9.9dev'
__version__ = '0.9.9dev'
__author__ = 'Levi John Wolf [email protected]'

from . import explorer
from . import base
from ._version import version as _version
from .tools import _load_sitekey

SITEKEY = _load_sitekey()
Expand Down
5 changes: 3 additions & 2 deletions cenpy/explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ def fips_table(kind, in_state = ''):

print('reading {}'.format(qurl))
if kind in ['PLACE', 'VTD']:
return pd.read_table(qurl, sep='|', header=None) #thanks uscb :)
sep = '|'
else:
return pd.read_csv(qurl, header=None)
sep = ','
return pd.read_csv(qurl, sep = sep, header=None)
5 changes: 3 additions & 2 deletions cenpy/geoparser.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pandas as pd
import numpy as np
from libpysal.cg import is_clockwise as _is_cw

def esriGeometryPolygon(egpoly):
feature = {'type':'Feature'}
Expand Down Expand Up @@ -82,17 +83,17 @@ def convert_geometries(df, pkg='shapely', strict=False):
for e in df['geometry']])
elif 'Point' in first['type']:
df['geometry'] = pd.Series([g.Point(e['coordinates'][0])\
for e in df['geometry']])
else:
raise KeyError('Geometry type {} not understood by geoparser.'.format(first['type']))
for e in df['geometry']])
return df

def parse_polygon_to_pysal(raw_feature):
"""
get an OGC polygon from an input ESRI ring array.
"""
pgon_type, ogc_nest = _get_polygon_type(raw_feature)
from libpysal.cg import Polygon, is_clockwise as _is_cw
from libpysal.cg import Polygon
if pgon_type == 'Polygon':
return Polygon([(c[0],c[1]) for c in ogc_nest])
elif pgon_type == 'MultiPolygon':
Expand Down
Loading

0 comments on commit 92552fc

Please sign in to comment.