diff --git a/.coveragerc b/.coveragerc index 8d32801..d2e2dfb 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,4 +1,4 @@ [run] omit = - osmnet/**/tests/* + osmnet/tests/* */__init__.py diff --git a/.travis.yml b/.travis.yml index c68e101..e66eb8f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,10 @@ language: python python: - - '2.7' - '3.5' - '3.6' - -matrix: - include: - - python: "3.7" # temp solution to test in python 3.7 - dist: xenial - sudo: true + - '3.7' + - '3.8' install: - pip install . @@ -18,9 +13,8 @@ install: - pip show osmnet script: - - pycodestyle osmnet + - pycodestyle --max-line-length=100 osmnet - py.test --cov osmnet --cov-report term-missing after_success: - coveralls - - bin/build_docs.sh diff --git a/HISTORY.rst b/CHANGELOG.rst similarity index 87% rename from HISTORY.rst rename to CHANGELOG.rst index d5959cc..56aa18f 100644 --- a/HISTORY.rst +++ b/CHANGELOG.rst @@ -1,3 +1,11 @@ +v0.1.6 +====== + +2020/7/13 + +* adds support for GeoPandas v0.7 and later +* ends support for Python 2.7 and Win32 + v0.1.5 ====== diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5a58914..a6d2d20 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,12 +1,56 @@ -#### If you have found an error: +## If you have found an error: - check the error message and [documentation](https://udst.github.io/osmnet/index.html) - search the previously opened and closed issues to see if the problem has already been reported - if the problem is with a dependency of OSMnet, please open an issue on the dependency's repo - if the problem is with OSMnet and you think you may have a fix, please submit a PR, otherwise please open an issue in the [issue tracker](https://github.com/UDST/osmnet/issues) following the issue template -#### Making a feature proposal or contributing code: +## Making a feature proposal or contributing code: - post your requested feature on the [issue tracker](https://github.com/UDST/osmnet/issues) and mark it with a `New feature` label so it can be reviewed - fork the repo, make your change (your code should attempt to conform to OSMnet's existing coding, commenting, and docstring styles), add new or update [unit tests](https://github.com/UDST/osmnet/tree/master/osmnet/tests), and submit a PR - respond to the code review +## Updating the documentation: + +- See instructions in `docs/README.md` + + +## Preparing a release: + +- Make a new branch for release prep + +- Update the version number and changelog + - `CHANGELOG.md` + - `setup.py` + - `osmnet/__init__.py` + - `docs/source/index.rst` + +- Make sure all the tests are passing, and check if updates are needed to `README.md` or to the documentation + +- Open a pull request to the master branch to finalize it + +- After merging, tag the release on GitHub and follow the distribution procedures below + + +## Distributing a release on PyPI (for pip installation): + +- Register an account at https://pypi.org, ask one of the current maintainers to add you to the project, and `pip install twine` + +- Check out the copy of the code you'd like to release + +- Run `python setup.py sdist bdist_wheel --universal` + +- This should create a `dist` directory containing two package files -- delete any old ones before the next step + +- Run `twine upload dist/*` -- this will prompt you for your pypi.org credentials + +- Check https://pypi.org/project/osmnet/ for the new version + + +## Distributing a release on Conda Forge (for conda installation): + +- The [conda-forge/osmnet-feedstock](https://github.com/conda-forge/osmnet-feedstock) repository controls the Conda Forge release + +- Conda Forge bots usually detect new releases on PyPI and set in motion the appropriate feedstock updates, which a current maintainer will need to approve and merge + +- Check https://anaconda.org/conda-forge/osmnet for the new version (may take a few minutes for it to appear) \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt index 5b16623..cf92d5c 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,7 +1,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 - Copyright (C) 2017 UrbanSim Inc. + Copyright (C) 2020 UrbanSim Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. diff --git a/MANIFEST.in b/MANIFEST.in index 3b667ca..355a7ea 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ # files to include in the source distribution on pypi (setup and README are included automatically) -include HISTORY.rst +include CHANGELOG.rst include LICENSE.txt diff --git a/README.rst b/README.rst index a7b630b..c2df2e1 100644 --- a/README.rst +++ b/README.rst @@ -59,11 +59,7 @@ OSMnet can be installed via PyPI: Development Installation ^^^^^^^^^^^^^^^^^^^^^^^^ -To install use the ``develop`` command rather than ``install``. Make sure you -are using the latest version of the code base by using git’s ``git pull`` -inside the cloned repository. - -To install OSMnet follow these steps: +To install OSMnet from source code, follow these steps: 1. Git clone the `OSMnet repo`_ 2. in the cloned directory run: ``python setup.py develop`` diff --git a/appveyor.yml b/appveyor.yml index fac07e8..9f74f0a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,33 +2,24 @@ build: false environment: matrix: - - PYTHON_VERSION: 2.7 - MINICONDA: C:\Miniconda - - PYTHON_VERSION: 3.5 - MINICONDA: C:\Miniconda3 + - PYTHON: 3.6 init: - - "ECHO %PYTHON_VERSION% %MINICONDA%" + - "ECHO %PYTHON%" + +# The goal here is to make sure updates to OSMnet don't introduce any Windows-specific +# runtime errors; the Travis tests running in Linux are more comprehensive. Dependencies +# are installed manually here because the shapely/geopandas stack doesn't install well +# via Pip on Windows. Only using one Python version because AppVeyor builds don't run in +# parallel and can be slow. install: - - "set PATH=%MINICONDA%;%MINICONDA%\\Scripts;%PATH%" - - conda config --set always_yes yes --set changeps1 no - - conda update -q conda - - conda info -a - - "conda create -q -n test-environment python=%PYTHON_VERSION% numpy pandas pytest pyyaml" - - activate test-environment - - conda install -c conda-forge shapely geopandas - - pip install pycodestyle + - "set PATH=C:\\Miniconda36-x64;C:\\Miniconda36-x64\\Scripts;%PATH%" + - conda config --append channels conda-forge + - "conda create --name test-env python=%PYTHON% pip geopandas numpy pandas pytest requests shapely --yes --quiet" + - activate test-env - pip install . - - pip install wheel + - conda list test_script: - - pycodestyle osmnet - py.test - -after_test: - - "python.exe setup.py bdist_wheel" - -artifacts: - # bdist_wheel puts your built wheel in the dist directory - - path: dist\* diff --git a/bin/build_docs.sh b/bin/build_docs.sh deleted file mode 100755 index 55c0d5c..0000000 --- a/bin/build_docs.sh +++ /dev/null @@ -1,59 +0,0 @@ -#! /usr/bin/env bash - -# Copied from github.com/sympy/sympy -# -# This file automatically deploys changes to http://udst.github.io/osmnet/. -# This will only happen when building a non-pull request build on the master -# branch of Pandana. -# It requires an access token which should be present in .travis.yml file. -# -# Following is the procedure to get the access token: -# -# $ curl -X POST -u -H "Content-Type: application/json" -d\ -# "{\"scopes\":[\"public_repo\"],\"note\":\"token for pushing from travis\"}"\ -# https://api.github.com/authorizations -# -# It'll give you a JSON response having a key called "token". -# -# $ gem install travis -# $ travis encrypt -r sympy/sympy GH_TOKEN= env.global -# -# This will give you an access token("secure"). This helps in creating an -# environment variable named GH_TOKEN while building. -# -# Add this secure code to .travis.yml as described here http://docs.travis-ci.com/user/encryption-keys/ - -# Exit on error -set -e - -ACTUAL_TRAVIS_JOB_NUMBER=`echo $TRAVIS_JOB_NUMBER| cut -d'.' -f 2` - -if [ "$TRAVIS_REPO_SLUG" == "UDST/osmnet" ] && \ - [ "$TRAVIS_BRANCH" == "master" ] && \ - [ "$TRAVIS_PULL_REQUEST" == "false" ] && \ - [ "$ACTUAL_TRAVIS_JOB_NUMBER" == "1" ]; then - - echo "Building docs" - cd docs - make clean - make html - - cd ../../ - echo "Setting git attributes" - git config --global user.email "fernandez@urbansim.com" - git config --global user.name "udst-documentator" - - echo "Cloning repository" - git clone --quiet --single-branch --branch=gh-pages https://${GH_TOKEN}@github.com/udst/osmnet.git gh-pages > /dev/null 2>&1 - - cd gh-pages - rm -rf * - cp -R ../osmnet/docs/build/html/* ./ - git add -A . - - git commit -am "Update dev docs after building $TRAVIS_BUILD_NUMBER" - echo "Pushing commit" - git push -fq origin gh-pages - echo "Commit pushed" -#> /dev/null 2>&1 -fi diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 6f44cb0..0000000 --- a/docs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -SPHINXPROJ = OSMnet -SOURCEDIR = source -BUILDDIR = build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..ab8ccf0 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,31 @@ +This folder generates the OSMNet online documentation, hosted at https://udst.github.io/osmnet/. + +### How it works + +HTML files are generated using [Sphinx](http://sphinx-doc.org) and hosted with GitHub Pages from the `gh-pages` branch of the repository. The online documentation is rendered and updated **manually**. + +### Editing the documentation + +The files in `docs/source`, along with docstrings in the source code, determine what appears in the rendered documentation. Here's a [good tutorial](https://pythonhosted.org/an_example_pypi_project/sphinx.html) for Sphinx. + +### Previewing changes locally + +Install the copy of OSMNet that the documentation is meant to reflect. Install the documentation tools. + +``` +pip install . +pip install sphinx sphinx_rtd_theme numpydoc +``` + +Build the documentation. There should be status messages and warnings, but no errors. + +``` +cd docs +sphinx-build -b html source build +``` + +The HTML files will show up in `docs/build/`. + +### Uploading changes + +Clone a second copy of the repository and check out the `gh-pages` branch. Copy over the updated HTML files, commit them, and push the changes to GitHub. diff --git a/docs/build/.gitignore b/docs/build/.gitignore new file mode 100644 index 0000000..df3359d --- /dev/null +++ b/docs/build/.gitignore @@ -0,0 +1 @@ +*/* \ No newline at end of file diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index bbf11d0..0000000 --- a/docs/make.bat +++ /dev/null @@ -1,36 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=source -set BUILDDIR=build -set SPHINXPROJ=OSMnet - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% - -:end -popd diff --git a/docs/source/conf.py b/docs/source/conf.py index f0619e5..067367a 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -28,10 +28,10 @@ source_suffix = '.rst' master_doc = 'index' project = u'OSMnet' -copyright = u'2019, UrbanSim Inc.' +copyright = u'2020, UrbanSim Inc.' author = u'UrbanSim Inc.' -version = u'0.1.5' -release = u'0.1.5' +version = u'0.1.6' +release = u'0.1.6' language = None nitpicky = True diff --git a/docs/source/index.rst b/docs/source/index.rst index 1e6c9e2..450fba2 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -3,6 +3,8 @@ OSMnet Tools for the extraction of `OpenStreetMap`_ (OSM) street network data. Intended to be used in tandem with `Pandana`_ and `UrbanAccess`_ libraries to extract street network nodes and edges. +v0.1.6, released July 13, 2020. + Contents -------- diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 388987c..6257b36 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -1,68 +1,65 @@ Installation -===================== +============ -OSMnet relies on a number of libraries in the scientific Python stack which can be easily installed using the `Anaconda`_ python distribution. +OSMnet is built on top of the Python data science stack, making use of libraries like NumPy and Pandas, plus geospatial packages such as GeoPandas and Shapely. -Dependencies -~~~~~~~~~~~~~~~~~~ +OSMnet v0.1.6 (July 2020) dropped support for Python 2.7 and 32-bit Windows environments. In these older environments, v0.1.5 should install automatically -- but if not, you can get it with ``conda install osmnet=0.1.5 ...`` or ``pip install osmnet==0.1.5``. -* requests >= 2.9.1 -* pandas >= 0.16.0 -* numpy >= 1.10 -* geopandas >= 0.2.1 -* Shapely >= 1.5 -Installation -~~~~~~~~~~~~~~~~~~ - -conda -^^^^^^^^^^^^^ +Conda +^^^^^ -OSMnet is available on conda and can be installed with: +OSMnet is distributed on Conda Forge and can be installed with: ``conda install osmnet --channel conda-forge`` -It is recommended to install via conda and the conda-forge channel especially if you find you are having issues installing some of the spatial dependencies. +This is generally the smoothest installation route. Although OSMnet itself is pure Python code (no compilation needed), the geospatial dependencies often cause installation problems using the default Pip package manager, especially in Windows. You can obtain the Conda package manager by installing the `Anaconda `_ Python distribution. -pip -^^^^^^^^^^^^^ -OSMnet can be installed via PyPI: +Pip +^^^ -``pip install osmnet`` +OSMnet is also distributed on PyPI: -Development Installation -^^^^^^^^^^^^^^^^^^^^^^^^^^ +``pip install osmnet`` -To install use the ``develop`` command rather than ``install``. Make sure you -are using the latest version of the codebase by using git’s ``git pull`` -inside the cloned repository. +If you run into errors related to dependency installation, try (a) setting up a clean environment and installing again, or (b) using Conda instead of Pip. -To install OSMnet follow these steps: -1. Git clone the `OSMnet repo`_ -2. in the cloned directory run: ``python setup.py develop`` or without dependencies: ``python setup.py develop --no-deps`` +Installing from source code +^^^^^^^^^^^^^^^^^^^^^^^^^^^ -To update to the latest version: +You can install a development version of OSMnet by cloning the GitHub repository (or a fork or branch) and running this: -Use ``git pull`` inside the cloned repository +``pip install -e .`` -Note for Windows Users when Installing Dependencies -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -If you are a Windows user, dependency installation issues can be minimized by using conda and the conda-forge channel. However, if you find you are still having issues with dependencies such as when importing osmnet you see an error like this: ``ImportError: DLL load failed: The specified module could not be found.`` Most likely one of osmnet's dependencies did not install or compile correctly on your Windows machine. ``geopandas`` requires the dependency package ``fiona`` which requires the dependency package ``gdal``. Windows users could try installing these dependencies via `Christoph Gohlke Windows python wheels`_: `GDAL Windows Wheel`_ and `Fiona Windows Wheel`_. Download the package that matches your Python version and Windows system architecture, then cd into the download directory and install each package for example using: ``pip install Fiona-1.7.6-cp27-cp27m-win_amd64.whl`` and -``pip install GDAL-2.1.3-cp27-cp27m-win_amd64.whl`` -If you have already installed these packaged via conda or pip, force a reinstall: ``pip install Fiona-1.7.6-cp27-cp27m-win_amd64.whl --upgrade --force-reinstall`` and -``pip install GDAL-2.1.3-cp27-cp27m-win_amd64.whl --upgrade --force-reinstall`` +Windows troubleshooting +^^^^^^^^^^^^^^^^^^^^^^^ -Current status -~~~~~~~~~~~~~~~~~~ +.. note:: + If you are a Windows user, dependency installation issues can be minimized by using Conda. However, if you find you are still having issues with dependencies -- such as when importing OSMnet you see an error like the one below -- most likely one of OSMnet's dependencies did not install or compile correctly on your machine. GeoPandas requires the dependency package Fiona, which in turn requires the dependency package GDAL. + + .. code-block:: + + ImportError: DLL load failed: The specified module could not be found + + You can try installing these dependencies via `Christoph Gohlke Windows python wheels`_: `GDAL Windows Wheel`_ and `Fiona Windows Wheel`_. Download the package that matches your Python version and Windows system architecture, then ``cd`` into the download directory and install each package like this, changing the file names as appropriate: + + .. code-block:: + + pip install Fiona-1.7.6-cp27-cp27m-win_amd64.whl + pip install GDAL-2.1.3-cp27-cp27m-win_amd64.whl + + If you have already installed these via Conda or Pip, force a reinstall: + + .. code-block:: + + pip install Fiona-1.7.6-cp27-cp27m-win_amd64.whl --upgrade --force-reinstall + pip install GDAL-2.1.3-cp27-cp27m-win_amd64.whl --upgrade --force-reinstall -*Forthcoming improvements:* -* Tutorial/demo -.. _Anaconda: http://docs.continuum.io/anaconda/ .. _OSMnet repo: https://github.com/udst/osmnet .. _Christoph Gohlke Windows python wheels: http://www.lfd.uci.edu/~gohlke/pythonlibs/ .. _GDAL Windows Wheel: http://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal diff --git a/osmnet/__init__.py b/osmnet/__init__.py index 2e6ae7b..7b32f76 100644 --- a/osmnet/__init__.py +++ b/osmnet/__init__.py @@ -1,5 +1,5 @@ from .load import * -__version__ = "0.1.5" +__version__ = "0.1.6" version = __version__ diff --git a/osmnet/load.py b/osmnet/load.py index 66a0335..a4e7ec4 100644 --- a/osmnet/load.py +++ b/osmnet/load.py @@ -451,67 +451,59 @@ def project_geometry(geometry, crs, to_latlong=False): return geometry_proj, gdf_proj.crs -def project_gdf(gdf, to_latlong=False, verbose=False): +def project_gdf(gdf, to_crs=None, to_latlong=False): """ - Project a GeoDataFrame to the UTM zone appropriate for its geometries' - centroid. The calculation works well for most latitudes, - however it will not work well for some far northern locations. + Project a GeoDataFrame from its current CRS to another. + If to_crs is None, project to the UTM CRS for the UTM zone in which the + GeoDataFrame's centroid lies. Otherwise project to the CRS defined by + to_crs. The simple UTM zone calculation in this function works well for + most latitudes, but may not work for some extreme northern locations like + Svalbard or far northern Norway. If the GeoDataFrame is already in UTM, it + will be returned untouched. Parameters ---------- - gdf : GeoDataFrame - the gdf to be projected to UTM - to_latlong : bool, optional - if True, projects to WGS84 instead of to UTM - verbose : bool, optional - if False, turns off log and print statements for this function + gdf : geopandas.GeoDataFrame + the GeoDataFrame to be projected + to_crs : dict or string or pyproj.CRS + if None, project to UTM zone in which gdf's centroid lies, otherwise + project to this CRS + to_latlong : bool + if True, project to epsg:4326 and ignore to_crs Returns ------- - projected_gdf : GeoDataFrame + gdf_proj : geopandas.GeoDataFrame + the projected GeoDataFrame """ - assert len(gdf) > 0, 'You cannot project an empty GeoDataFrame.' - start_time = time.time() + if gdf.crs is None or len(gdf) < 1: + raise ValueError("GeoDataFrame must have a valid CRS and cannot be empty") + # if to_latlong is True, project the gdf to latlong if to_latlong: - # if to_latlong is True, project the gdf to WGS84 - latlong_crs = {'init': 'epsg:4326'} - projected_gdf = gdf.to_crs(latlong_crs) - if not hasattr(gdf, 'name'): - gdf.name = 'unnamed' - if verbose: - log('Projected the GeoDataFrame "{}" to EPSG 4326 in {:,.2f} ' - 'seconds'.format(gdf.name, time.time()-start_time)) + gdf_proj = gdf.to_crs(4326) + + # else if to_crs was passed-in, project gdf to this CRS + elif to_crs is not None: + gdf_proj = gdf.to_crs(to_crs) + + # otherwise, automatically project the gdf to UTM else: - # else, project the gdf to UTM - # if GeoDataFrame is already in UTM, return it - if (gdf.crs is not None) and ('proj' in gdf.crs) \ - and (gdf.crs['proj'] == 'utm'): - return gdf - - # calculate the centroid of the union of all the geometries in the - # GeoDataFrame - avg_longitude = gdf['geometry'].unary_union.centroid.x - - # calculate the UTM zone from this avg longitude and define the - # UTM CRS to project - utm_zone = int(math.floor((avg_longitude + 180) / 6.) + 1) - utm_crs = {'datum': 'NAD83', - 'ellps': 'GRS80', - 'proj': 'utm', - 'zone': utm_zone, - 'units': 'm'} + if gdf.crs.is_projected: + raise ValueError("Geometry must be unprojected to calculate UTM zone") + + # calculate longitude of centroid of union of all geometries in gdf + avg_lng = gdf["geometry"].unary_union.centroid.x + + # calculate UTM zone from avg longitude to define CRS to project to + utm_zone = int(math.floor((avg_lng + 180) / 6.0) + 1) + utm_crs = ('+proj=utm +zone={} +ellps=WGS84 +datum=WGS84 +units=m +no_defs' + .format(utm_zone)) # project the GeoDataFrame to the UTM CRS - projected_gdf = gdf.to_crs(utm_crs) - if not hasattr(gdf, 'name'): - gdf.name = 'unnamed' - if verbose: - log('Projected the GeoDataFrame "{}" to UTM-{} in {:,.2f} ' - 'seconds'.format(gdf.name, utm_zone, time.time()-start_time)) + gdf_proj = gdf.to_crs(utm_crs) - projected_gdf.name = gdf.name - return projected_gdf + return gdf_proj def process_node(e): @@ -708,8 +700,8 @@ def node_pairs(nodes, ways, waynodes, two_way=True): """ start_time = time.time() - def pairwise(l): - return zip(islice(l, 0, len(l)), islice(l, 1, None)) + def pairwise(ls): + return zip(islice(ls, 0, len(ls)), islice(ls, 1, None)) intersections = intersection_nodes(waynodes) waymap = waynodes.groupby(level=0, sort=False) pairs = [] @@ -838,8 +830,8 @@ def network_from_bbox(lat_min=None, lng_min=None, lat_max=None, lng_max=None, and len(bbox) == 4, 'bbox must be a 4 element tuple' assert (lat_min is None) and (lng_min is None) and \ (lat_max is None) and (lng_max is None), \ - 'lat_min, lng_min, lat_max and lng_max must be None ' \ - 'if you are using bbox' + 'lat_min, lng_min, lat_max and lng_max must be None ' \ + 'if you are using bbox' lng_max, lat_min, lng_min, lat_max = bbox diff --git a/requirements-dev.txt b/requirements-dev.txt index d6dab9a..168dbed 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,9 +1,12 @@ -# requirements for development and testing +# Additional requirements for development and testing +# testing coveralls -numpydoc pycodestyle pytest -pytest-cov +pytest-cov < 2.10 + +# building documentation +numpydoc sphinx sphinx_rtd_theme diff --git a/setup.py b/setup.py index 3473523..d10ffcf 100644 --- a/setup.py +++ b/setup.py @@ -1,20 +1,12 @@ -# Install setuptools if not installed. -try: - import setuptools -except ImportError: - from ez_setup import use_setuptools - use_setuptools() - from setuptools import setup, find_packages - # read README as the long description with open('README.rst', 'r') as f: long_description = f.read() setup( name='osmnet', - version='0.1.5', + version='0.1.6', license='AGPL', description=('Tools for the extraction of OpenStreetMap street network ' 'data for use in Pandana accessibility analyses.'), @@ -22,19 +14,23 @@ author='UrbanSim Inc.', url='https://github.com/UDST/osmnet', classifiers=[ - 'Programming Language :: Python :: 2.7', + 'Intended Audience :: Science/Research', + 'Topic :: Scientific/Engineering :: Information Analysis', + 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: GNU Affero General Public License v3' ], packages=find_packages(exclude=['*.tests']), + python_requires='>=3', install_requires=[ + 'geopandas >= 0.7', + 'numpy >= 1.10', + 'pandas >= 0.23', 'requests >= 2.9.1', - 'pandas >= 0.16.0', - 'numpy>=1.10', - 'geopandas>=0.2.1', - 'Shapely>=1.5' + 'shapely >= 1.5' ] )