From ecdbe1c2ae9fee509d37aed34d81703f7253623d Mon Sep 17 00:00:00 2001 From: sablanchard Date: Thu, 21 Sep 2017 15:32:54 -0700 Subject: [PATCH 01/33] gb integration test dataset is now unavailable - removing test to fix travis build --- .travis.yml | 3 +- .../tests/integration/integration_gb.py | 45 ------------------- 2 files changed, 1 insertion(+), 47 deletions(-) delete mode 100644 urbanaccess/tests/integration/integration_gb.py diff --git a/.travis.yml b/.travis.yml index c370c13..212b2cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,8 +32,7 @@ script: - cd ../urbanaccess/tests/integration; python remove_nb_magic.py -in simple_example.py -out simple_example_clean.py - cd ../../../demo; python simple_example_clean.py - cd ../urbanaccess/tests/integration; python integration_madison.py -- python integration_sandiego.py -- python integration_gb.py && cd $TRAVIS_BUILD_DIR +- python integration_sandiego.py && cd $TRAVIS_BUILD_DIR env: global: diff --git a/urbanaccess/tests/integration/integration_gb.py b/urbanaccess/tests/integration/integration_gb.py deleted file mode 100644 index 9eae3f0..0000000 --- a/urbanaccess/tests/integration/integration_gb.py +++ /dev/null @@ -1,45 +0,0 @@ -import os -import time - -import urbanaccess -from urbanaccess.gtfsfeeds import feeds - -start_time = time.time() - -name = 'gb' -url = 'http://www.gbrail.info/gtfs.zip' - -print ('-------------------------') -print('Starting integration test for {}...'.format(name)) - -new_feed = {name: url} -feeds.add_feed(new_feed) - -script_path = os.path.dirname(os.path.realpath(__file__)) -root_path = os.path.join(script_path, 'data', name) -data_path = os.path.join(root_path, 'gtfsfeed_text') - -urbanaccess.gtfsfeeds.download(data_folder=root_path) - -validation = True -verbose = True -# small bbox for testing purposes -bbox = (-0.5383, 51.3546, 0.2856, 51.7508) -remove_stops_outsidebbox = True -append_definitions = True - -loaded_feeds = urbanaccess.gtfs.load.gtfsfeed_to_df(data_path, - validation, - verbose, - bbox, - remove_stops_outsidebbox, - append_definitions) - -transit_net = urbanaccess.gtfs.network.create_transit_net( - gtfsfeeds_dfs=loaded_feeds, - day='monday', - timerange=['07:00:00', '10:00:00']) - -print('{} integration test completed successfully. Took {:,' - '.2f} seconds'.format(name, time.time() - start_time)) -print ('-------------------------') From 6ba6f415336bac733bdaf7bc358686ed1a4be26f Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Tue, 23 Oct 2018 14:55:23 -0700 Subject: [PATCH 02/33] Updating urllib --- urbanaccess/gtfsfeeds.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/urbanaccess/gtfsfeeds.py b/urbanaccess/gtfsfeeds.py index cc6f0f7..0c609de 100644 --- a/urbanaccess/gtfsfeeds.py +++ b/urbanaccess/gtfsfeeds.py @@ -1,12 +1,11 @@ import yaml import pandas as pd -import urllib -from urllib2 import urlopen import traceback import zipfile import os import logging as lg import time +from six.moves.urllib.request import urlopen from urbanaccess.utils import log from urbanaccess import config @@ -469,7 +468,7 @@ def download(data_folder=os.path.join(config.settings.data_folder), zipfile_path = ''.join([download_folder, '/', feed_name_key, '.zip']) if 'http' in feed_url_value: - status_code = urllib.urlopen(feed_url_value).getcode() + status_code = urlopen(feed_url_value).getcode() if status_code == 200: file = urlopen(feed_url_value) From d707ef79657cb2486416cfca8b08840f0dc45065 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Tue, 23 Oct 2018 15:13:01 -0700 Subject: [PATCH 03/33] .dict -> .get() --- urbanaccess/gtfsfeeds.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/urbanaccess/gtfsfeeds.py b/urbanaccess/gtfsfeeds.py index 0c609de..2d7846f 100644 --- a/urbanaccess/gtfsfeeds.py +++ b/urbanaccess/gtfsfeeds.py @@ -607,8 +607,9 @@ def _zipfile_type_check(file, feed_url_value): ------- nothing """ - if 'zip' not in file.info().dict['content-type'] \ - is True or 'octet' not in file.info().dict['content-type'] is True: + print(file.info()) + if 'zip' not in file.info().get('Content-Type') is True \ + or 'octet' not in file.info().get('Content-Type') is True: raise ValueError( 'data requested at {} is not a zipfile. ' 'Data must be a zipfile'.format(feed_url_value)) From 8e9040be2a20a0bf6aa5ad58a3627019ac64d1cd Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Tue, 23 Oct 2018 15:36:19 -0700 Subject: [PATCH 04/33] Removing text encoding check --- urbanaccess/gtfs/load.py | 100 +++++++++++++++++++-------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/urbanaccess/gtfs/load.py b/urbanaccess/gtfs/load.py index 68bca75..a8eeb00 100644 --- a/urbanaccess/gtfs/load.py +++ b/urbanaccess/gtfs/load.py @@ -31,59 +31,59 @@ def _standardize_txt(csv_rootpath=os.path.join(config.settings.data_folder, 'stop_times.txt', 'calendar.txt', 'agency.txt', 'calendar_dates.txt'] - _txt_encoder_check(gtfsfiles_to_use, csv_rootpath) +# _txt_encoder_check(gtfsfiles_to_use, csv_rootpath) _txt_header_whitespace_check(gtfsfiles_to_use, csv_rootpath) -def _txt_encoder_check(gtfsfiles_to_use, - csv_rootpath=os.path.join( - config.settings.data_folder, - 'gtfsfeed_text')): - """ - Standardize all text files inside a GTFS feed for encoding problems - - Parameters - ---------- - gtfsfiles_to_use : list - list of gtfs feed txt files to utilize - csv_rootpath : str, optional - root path where all gtfs feeds that make up a contiguous metropolitan - area are stored - - Returns - ------- - None - """ - # UnicodeDecodeError - start_time = time.time() - - folderlist = [foldername for foldername in os.listdir(csv_rootpath) if - os.path.isdir(os.path.join(csv_rootpath, foldername))] - - if not folderlist: - folderlist = [csv_rootpath] - - for folder in folderlist: - textfilelist = [textfilename for textfilename in - os.listdir(os.path.join(csv_rootpath, folder)) if - textfilename.endswith(".txt")] - - for textfile in textfilelist: - if textfile in gtfsfiles_to_use: - # Read from file - file_open = open(os.path.join(csv_rootpath, folder, textfile)) - raw = file_open.read() - file_open.close() - if raw.startswith(codecs.BOM_UTF8): - raw = raw.replace(codecs.BOM_UTF8, '', 1) - # Write to file - file_open = open( - os.path.join(csv_rootpath, folder, textfile), 'w') - file_open.write(raw) - file_open.close() - - log('GTFS text file encoding check completed. Took {:,.2f} seconds'.format( - time.time() - start_time)) +# def _txt_encoder_check(gtfsfiles_to_use, +# csv_rootpath=os.path.join( +# config.settings.data_folder, +# 'gtfsfeed_text')): +# """ +# Standardize all text files inside a GTFS feed for encoding problems +# +# Parameters +# ---------- +# gtfsfiles_to_use : list +# list of gtfs feed txt files to utilize +# csv_rootpath : str, optional +# root path where all gtfs feeds that make up a contiguous metropolitan +# area are stored +# +# Returns +# ------- +# None +# """ +# # UnicodeDecodeError +# start_time = time.time() +# +# folderlist = [foldername for foldername in os.listdir(csv_rootpath) if +# os.path.isdir(os.path.join(csv_rootpath, foldername))] +# +# if not folderlist: +# folderlist = [csv_rootpath] +# +# for folder in folderlist: +# textfilelist = [textfilename for textfilename in +# os.listdir(os.path.join(csv_rootpath, folder)) if +# textfilename.endswith(".txt")] +# +# for textfile in textfilelist: +# if textfile in gtfsfiles_to_use: +# # Read from file +# file_open = open(os.path.join(csv_rootpath, folder, textfile)) +# raw = file_open.read() +# file_open.close() +# if raw.startswith(codecs.BOM_UTF8): +# raw = raw.replace(codecs.BOM_UTF8, '', 1) +# # Write to file +# file_open = open( +# os.path.join(csv_rootpath, folder, textfile), 'w') +# file_open.write(raw) +# file_open.close() +# +# log('GTFS text file encoding check completed. Took {:,.2f} seconds'.format( +# time.time() - start_time)) def _txt_header_whitespace_check(gtfsfiles_to_use, From 45d85e9ffc9c4b787072a916639400ddbf52f855 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Wed, 31 Oct 2018 10:02:16 -0700 Subject: [PATCH 05/33] Python 2 detection for text encoding check --- urbanaccess/gtfs/load.py | 103 ++++++++++++++++++++------------------- 1 file changed, 53 insertions(+), 50 deletions(-) diff --git a/urbanaccess/gtfs/load.py b/urbanaccess/gtfs/load.py index a8eeb00..423f419 100644 --- a/urbanaccess/gtfs/load.py +++ b/urbanaccess/gtfs/load.py @@ -3,6 +3,7 @@ import re import time import pandas as pd +import six from urbanaccess import config from urbanaccess.utils import log @@ -31,59 +32,61 @@ def _standardize_txt(csv_rootpath=os.path.join(config.settings.data_folder, 'stop_times.txt', 'calendar.txt', 'agency.txt', 'calendar_dates.txt'] -# _txt_encoder_check(gtfsfiles_to_use, csv_rootpath) + if six.PY2: + _txt_encoder_check(gtfsfiles_to_use, csv_rootpath) _txt_header_whitespace_check(gtfsfiles_to_use, csv_rootpath) -# def _txt_encoder_check(gtfsfiles_to_use, -# csv_rootpath=os.path.join( -# config.settings.data_folder, -# 'gtfsfeed_text')): -# """ -# Standardize all text files inside a GTFS feed for encoding problems -# -# Parameters -# ---------- -# gtfsfiles_to_use : list -# list of gtfs feed txt files to utilize -# csv_rootpath : str, optional -# root path where all gtfs feeds that make up a contiguous metropolitan -# area are stored -# -# Returns -# ------- -# None -# """ -# # UnicodeDecodeError -# start_time = time.time() -# -# folderlist = [foldername for foldername in os.listdir(csv_rootpath) if -# os.path.isdir(os.path.join(csv_rootpath, foldername))] -# -# if not folderlist: -# folderlist = [csv_rootpath] -# -# for folder in folderlist: -# textfilelist = [textfilename for textfilename in -# os.listdir(os.path.join(csv_rootpath, folder)) if -# textfilename.endswith(".txt")] -# -# for textfile in textfilelist: -# if textfile in gtfsfiles_to_use: -# # Read from file -# file_open = open(os.path.join(csv_rootpath, folder, textfile)) -# raw = file_open.read() -# file_open.close() -# if raw.startswith(codecs.BOM_UTF8): -# raw = raw.replace(codecs.BOM_UTF8, '', 1) -# # Write to file -# file_open = open( -# os.path.join(csv_rootpath, folder, textfile), 'w') -# file_open.write(raw) -# file_open.close() -# -# log('GTFS text file encoding check completed. Took {:,.2f} seconds'.format( -# time.time() - start_time)) +def _txt_encoder_check(gtfsfiles_to_use, + csv_rootpath=os.path.join( + config.settings.data_folder, + 'gtfsfeed_text')): + """ + Standardize all text files inside a GTFS feed for encoding problems. + Not yet updated for Python 3. + + Parameters + ---------- + gtfsfiles_to_use : list + list of gtfs feed txt files to utilize + csv_rootpath : str, optional + root path where all gtfs feeds that make up a contiguous metropolitan + area are stored + + Returns + ------- + None + """ + # UnicodeDecodeError + start_time = time.time() + + folderlist = [foldername for foldername in os.listdir(csv_rootpath) if + os.path.isdir(os.path.join(csv_rootpath, foldername))] + + if not folderlist: + folderlist = [csv_rootpath] + + for folder in folderlist: + textfilelist = [textfilename for textfilename in + os.listdir(os.path.join(csv_rootpath, folder)) if + textfilename.endswith(".txt")] + + for textfile in textfilelist: + if textfile in gtfsfiles_to_use: + # Read from file + file_open = open(os.path.join(csv_rootpath, folder, textfile)) + raw = file_open.read() + file_open.close() + if raw.startswith(codecs.BOM_UTF8): + raw = raw.replace(codecs.BOM_UTF8, '', 1) + # Write to file + file_open = open( + os.path.join(csv_rootpath, folder, textfile), 'w') + file_open.write(raw) + file_open.close() + + log('GTFS text file encoding check completed. Took {:,.2f} seconds'.format( + time.time() - start_time)) def _txt_header_whitespace_check(gtfsfiles_to_use, From 402cdda9c301be7bb69eda6f3cca99d0ef263be9 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Wed, 31 Oct 2018 10:54:57 -0700 Subject: [PATCH 06/33] Explicit installation of matplotlib basemap --- setup.py | 5 ++++- urbanaccess/gtfs/load.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 0bc455f..b3f1ae9 100644 --- a/setup.py +++ b/setup.py @@ -32,13 +32,16 @@ packages=find_packages(exclude=['*.tests']), install_requires=[ 'requests >= 2.9.1', + 'six >= 1.11', 'pandas >= 0.17.0', 'numpy >= 1.11', 'osmnet >= 0.1.4', 'pandana >= 0.2.0', 'matplotlib >= 2.0', + 'basemap >= 1.0', + 'basemap-data-hires > 1.0', 'geopy >= 1.11.0', 'pyyaml >= 3.11', - 'scikit-learn >= 0.17.1' + 'scikit-learn >= 0.17.1', ] ) diff --git a/urbanaccess/gtfs/load.py b/urbanaccess/gtfs/load.py index 423f419..0facd16 100644 --- a/urbanaccess/gtfs/load.py +++ b/urbanaccess/gtfs/load.py @@ -43,7 +43,7 @@ def _txt_encoder_check(gtfsfiles_to_use, 'gtfsfeed_text')): """ Standardize all text files inside a GTFS feed for encoding problems. - Not yet updated for Python 3. + Has not been updated for Python 3. Parameters ---------- From caa379dd72251ad89c26596713afea1e70608fc2 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Wed, 31 Oct 2018 10:59:09 -0700 Subject: [PATCH 07/33] Updating version number --- setup.py | 2 +- urbanaccess/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index b3f1ae9..ab05ec7 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ setup( name='urbanaccess', - version='0.1.0', + version='0.2.dev1', license='AGPL', description=description, long_description=long_description, diff --git a/urbanaccess/__init__.py b/urbanaccess/__init__.py index cf73268..f0d5631 100644 --- a/urbanaccess/__init__.py +++ b/urbanaccess/__init__.py @@ -9,6 +9,6 @@ from .gtfsfeeds import * from .plot import * -__version__ = "0.1.0" +__version__ = "0.2.dev1" version = __version__ From 06a41f962169f4326e0f042d11b0499b06d9f3bb Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Wed, 31 Oct 2018 12:18:39 -0700 Subject: [PATCH 08/33] Removing matplotlib basemap --- setup.py | 4 +--- urbanaccess/gtfsfeeds.py | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/setup.py b/setup.py index ab05ec7..063bcb8 100644 --- a/setup.py +++ b/setup.py @@ -38,10 +38,8 @@ 'osmnet >= 0.1.4', 'pandana >= 0.2.0', 'matplotlib >= 2.0', - 'basemap >= 1.0', - 'basemap-data-hires > 1.0', 'geopy >= 1.11.0', 'pyyaml >= 3.11', - 'scikit-learn >= 0.17.1', + 'scikit-learn >= 0.17.1' ] ) diff --git a/urbanaccess/gtfsfeeds.py b/urbanaccess/gtfsfeeds.py index 2d7846f..0eb5373 100644 --- a/urbanaccess/gtfsfeeds.py +++ b/urbanaccess/gtfsfeeds.py @@ -607,7 +607,6 @@ def _zipfile_type_check(file, feed_url_value): ------- nothing """ - print(file.info()) if 'zip' not in file.info().get('Content-Type') is True \ or 'octet' not in file.info().get('Content-Type') is True: raise ValueError( From d080dbc5d33eadd6f9402a83594cfc2c6b77472f Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Wed, 31 Oct 2018 12:32:23 -0700 Subject: [PATCH 09/33] Updating syntax in demo notebook --- demo/simple_example.ipynb | 66 ++++++++++++++++++++++++++++++--------- 1 file changed, 51 insertions(+), 15 deletions(-) diff --git a/demo/simple_example.ipynb b/demo/simple_example.ipynb index 3fad342..425ef67 100644 --- a/demo/simple_example.ipynb +++ b/demo/simple_example.ipynb @@ -13,15 +13,15 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "** Author:** UrbanSim\n", + "**Author:** UrbanSim\n", "\n", "This notebook provides a brief overview of the main functionality of UrbanAccess with examples using AC Transit and BART GTFS data and OpenStreetMap (OSM) pedestrian network data to create an integrated transit and pedestrian network for Oakland, CA for use in Pandana network accessibility queries.\n", "\n", - "** UrbanAccess on UDST:** https://github.com/UDST/urbanaccess\n", + "**UrbanAccess on UDST:** https://github.com/UDST/urbanaccess\n", "\n", - "** UrbanAccess documentation:** https://udst.github.io/urbanaccess/index.html\n", + "**UrbanAccess documentation:** https://udst.github.io/urbanaccess/index.html\n", "\n", - "** UrbanAccess citation:** \n", + "**UrbanAccess citation:** \n", "\n", "`Samuel D. Blanchard and Paul Waddell, 2017, \"UrbanAccess: Generalized Methodology for Measuring Regional Accessibility with an Integrated Pedestrian and Transit Network\" Transportation Research Record: Journal of the Transportation Research Board, 2653: 35–44.`\n", "\n", @@ -1230,7 +1230,7 @@ "blocks = pd.read_hdf('bay_area_demo_data.h5','blocks')\n", "# remove blocks that contain all water\n", "blocks = blocks[blocks['square_meters_land'] != 0]\n", - "print 'Total number of blocks: {:,}'.format(len(blocks))\n", + "print('Total number of blocks: {:,}'.format(len(blocks)))\n", "blocks.head()" ] }, @@ -1252,7 +1252,7 @@ "lng_max, lat_min, lng_min, lat_max = bbox\n", "outside_bbox = blocks.loc[~(((lng_max < blocks[\"x\"]) & (blocks[\"x\"] < lng_min)) & ((lat_min < blocks[\"y\"]) & (blocks[\"y\"] < lat_max)))]\n", "blocks_subset = blocks.drop(outside_bbox.index)\n", - "print 'Total number of subset blocks: {:,}'.format(len(blocks_subset))" + "print('Total number of subset blocks: {:,}'.format(len(blocks_subset)))" ] }, { @@ -1393,9 +1393,9 @@ }, "outputs": [], "source": [ - "print jobs_45.head()\n", - "print jobs_30.head()\n", - "print jobs_15.head()" + "print(jobs_45.head())\n", + "print(jobs_30.head())\n", + "print(jobs_15.head())" ] }, { @@ -1416,7 +1416,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "collapsed": false, + "collapsed": true, "scrolled": true }, "outputs": [], @@ -1441,7 +1441,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "collapsed": false + "collapsed": true }, "outputs": [], "source": [ @@ -1465,7 +1465,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "collapsed": false + "collapsed": true }, "outputs": [], "source": [ @@ -1477,13 +1477,49 @@ " plot_kwargs={'cmap':'gist_heat_r','s':4,'edgecolor':'none'})\n", "print('Took {:,.2f} seconds'.format(time.time() - s_time))" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python [conda env:urbanaccess-py2]", "language": "python", - "name": "python2" + "name": "conda-env-urbanaccess-py2-py" }, "language_info": { "codemirror_mode": { @@ -1495,7 +1531,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", - "version": "2.7.11" + "version": "2.7.15" } }, "nbformat": 4, From 3572f3ee607696099146d18ebc87f248f914b793 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Wed, 31 Oct 2018 12:41:27 -0700 Subject: [PATCH 10/33] Adding python 3 to setup and travis --- .travis.yml | 3 +++ setup.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/.travis.yml b/.travis.yml index 212b2cc..a3f55a9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,9 @@ language: python sudo: false python: - '2.7' +- '3.5' +- '3.6' +- '3.7' install: - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh diff --git a/setup.py b/setup.py index 063bcb8..cb958e7 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,12 @@ author='UrbanSim Inc. and Samuel D. Blanchard', url='https://github.com/UDST/urbanaccess', classifiers=[ + 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: GNU Affero General Public License v3' ], From 58eaaad83f71441f3c4c1bf3fae399e7c9716bf7 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Wed, 31 Oct 2018 13:02:24 -0700 Subject: [PATCH 11/33] Cleaning up travis script --- .travis.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a3f55a9..603eaae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,9 +7,7 @@ python: - '3.7' install: -- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh - -O miniconda.sh; else wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh - -O miniconda.sh; fi +- wget http://bit.ly/miniconda -O miniconda.sh - bash miniconda.sh -b -p $HOME/miniconda - export PATH="$HOME/miniconda/bin:$PATH" - hash -r @@ -19,7 +17,7 @@ install: - conda config --add channels udst - conda config --add channels conda-forge - | - conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION pip numpy=1.11 pandas pytest ipython-notebook pycodestyle matplotlib scikit-learn pyyaml basemap basemap-data-hires + conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION pip numpy pandas pytest jupyter pycodestyle matplotlib scikit-learn pyyaml basemap basemap-data-hires - source activate test-environment - conda list - pip install pandana==0.3.0 geopy osmnet From 2db8f314185a97589a1935aab7e422bae3f4889d Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Wed, 31 Oct 2018 13:55:07 -0700 Subject: [PATCH 12/33] Fixes for Python 3 Travis builds --- demo/simple_example.ipynb | 42 +++++++++---------- .../tests/integration/integration_madison.py | 4 +- .../tests/integration/integration_sandiego.py | 4 +- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/demo/simple_example.ipynb b/demo/simple_example.ipynb index 425ef67..9b80f5c 100644 --- a/demo/simple_example.ipynb +++ b/demo/simple_example.ipynb @@ -1421,13 +1421,13 @@ }, "outputs": [], "source": [ - "s_time = time.time()\n", - "transit_ped_net.plot(jobs_15, \n", - " plot_type='scatter',\n", - " fig_kwargs={'figsize':[20,20]},\n", - " bmap_kwargs={'epsg':'26943','resolution':'h'},\n", - " plot_kwargs={'cmap':'gist_heat_r','s':4,'edgecolor':'none'})\n", - "print('Took {:,.2f} seconds'.format(time.time() - s_time))" + "# s_time = time.time()\n", + "# transit_ped_net.plot(jobs_15, \n", + "# plot_type='scatter',\n", + "# fig_kwargs={'figsize':[20,20]},\n", + "# bmap_kwargs={'epsg':'26943','resolution':'h'},\n", + "# plot_kwargs={'cmap':'gist_heat_r','s':4,'edgecolor':'none'})\n", + "# print('Took {:,.2f} seconds'.format(time.time() - s_time))" ] }, { @@ -1445,13 +1445,13 @@ }, "outputs": [], "source": [ - "s_time = time.time()\n", - "transit_ped_net.plot(jobs_30, \n", - " plot_type='scatter',\n", - " fig_kwargs={'figsize':[20,20]},\n", - " bmap_kwargs={'epsg':'26943','resolution':'h'},\n", - " plot_kwargs={'cmap':'gist_heat_r','s':4,'edgecolor':'none'})\n", - "print('Took {:,.2f} seconds'.format(time.time() - s_time))" + "# s_time = time.time()\n", + "# transit_ped_net.plot(jobs_30, \n", + "# plot_type='scatter',\n", + "# fig_kwargs={'figsize':[20,20]},\n", + "# bmap_kwargs={'epsg':'26943','resolution':'h'},\n", + "# plot_kwargs={'cmap':'gist_heat_r','s':4,'edgecolor':'none'})\n", + "# print('Took {:,.2f} seconds'.format(time.time() - s_time))" ] }, { @@ -1469,13 +1469,13 @@ }, "outputs": [], "source": [ - "s_time = time.time()\n", - "transit_ped_net.plot(jobs_45, \n", - " plot_type='scatter',\n", - " fig_kwargs={'figsize':[20,20]},\n", - " bmap_kwargs={'epsg':'26943','resolution':'h'},\n", - " plot_kwargs={'cmap':'gist_heat_r','s':4,'edgecolor':'none'})\n", - "print('Took {:,.2f} seconds'.format(time.time() - s_time))" + "# s_time = time.time()\n", + "# transit_ped_net.plot(jobs_45, \n", + "# plot_type='scatter',\n", + "# fig_kwargs={'figsize':[20,20]},\n", + "# bmap_kwargs={'epsg':'26943','resolution':'h'},\n", + "# plot_kwargs={'cmap':'gist_heat_r','s':4,'edgecolor':'none'})\n", + "# print('Took {:,.2f} seconds'.format(time.time() - s_time))" ] }, { diff --git a/urbanaccess/tests/integration/integration_madison.py b/urbanaccess/tests/integration/integration_madison.py index e1ad7b8..9ebeaf9 100644 --- a/urbanaccess/tests/integration/integration_madison.py +++ b/urbanaccess/tests/integration/integration_madison.py @@ -9,7 +9,7 @@ name = 'madison' url = 'http://www.gtfs-data-exchange.com/agency/city-of-madison/latest.zip' -print ('-------------------------') +print('-------------------------') print('Starting integration test for {}...'.format(name)) new_feed = {name: url} @@ -88,4 +88,4 @@ print('{} integration test completed successfully. Took {:,' '.2f} seconds'.format(name, time.time() - start_time)) -print ('-------------------------') +print('-------------------------') diff --git a/urbanaccess/tests/integration/integration_sandiego.py b/urbanaccess/tests/integration/integration_sandiego.py index d15b155..1342164 100644 --- a/urbanaccess/tests/integration/integration_sandiego.py +++ b/urbanaccess/tests/integration/integration_sandiego.py @@ -8,7 +8,7 @@ name = 'san diego' -print ('-------------------------') +print('-------------------------') print('Starting integration test for {}...'.format(name)) script_path = os.path.dirname(os.path.realpath(__file__)) @@ -69,4 +69,4 @@ print('{} integration test completed successfully. Took {:,' '.2f} seconds'.format(name, time.time() - start_time)) -print ('-------------------------') +print('-------------------------') From 99b1d97dbf83cc6e7e9543c2dc9367dde5fb3eaf Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Wed, 31 Oct 2018 14:36:11 -0700 Subject: [PATCH 13/33] Removing Python 3.7 from Travis --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 603eaae..5a9bb62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,6 @@ python: - '2.7' - '3.5' - '3.6' -- '3.7' install: - wget http://bit.ly/miniconda -O miniconda.sh From d9f7f520bfad03ec7c4a2f8f7735da256ea8f6e0 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Wed, 31 Oct 2018 15:07:46 -0700 Subject: [PATCH 14/33] Making reserve_num_graphs conditional on pandana version --- urbanaccess/osm/load.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/urbanaccess/osm/load.py b/urbanaccess/osm/load.py index c2a7693..05c2c17 100644 --- a/urbanaccess/osm/load.py +++ b/urbanaccess/osm/load.py @@ -2,14 +2,15 @@ import time from osmnet.load import network_from_bbox -from pandana.network import reserve_num_graphs +import pandana from pandana import Network from urbanaccess.utils import log # set the number of Pandana Networks in memory to arbitrary 40 for -# removing low connectivity nodes -reserve_num_graphs(40) +# removing low connectivity nodes (not needed beginning v0.4) +if pandana.__version__[:3] in ['0.1', '0.2', '0.3']: + pandana.network.reserve_num_graphs(40) def ua_network_from_bbox(lat_min=None, lng_min=None, lat_max=None, From 69fe4e629a3812c404ab04e8a56c111170c45031 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Wed, 31 Oct 2018 16:02:35 -0700 Subject: [PATCH 15/33] Updating travis script --- .travis.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5a9bb62..127a48e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,11 +15,9 @@ install: - conda info -a - conda config --add channels udst - conda config --add channels conda-forge -- | - conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION pip numpy pandas pytest jupyter pycodestyle matplotlib scikit-learn pyyaml basemap basemap-data-hires -- source activate test-environment +- conda create -q -n test-env python=$TRAVIS_PYTHON_VERSION pip numpy pandas pytest jupyter pycodestyle matplotlib scikit-learn pyyaml basemap basemap-data-hires pandana=0.4 geopy osmnet +- source activate test-env - conda list -- pip install pandana==0.3.0 geopy osmnet - pip install . after_success: From 89f1332ad92e5e6af6e7a0367afeb8ef34385c19 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Wed, 31 Oct 2018 16:02:52 -0700 Subject: [PATCH 16/33] Updating version number --- setup.py | 2 +- urbanaccess/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index cb958e7..a9d12c0 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ setup( name='urbanaccess', - version='0.2.dev1', + version='0.2.dev2', license='AGPL', description=description, long_description=long_description, diff --git a/urbanaccess/__init__.py b/urbanaccess/__init__.py index f0d5631..50b4cdc 100644 --- a/urbanaccess/__init__.py +++ b/urbanaccess/__init__.py @@ -9,6 +9,6 @@ from .gtfsfeeds import * from .plot import * -__version__ = "0.2.dev1" +__version__ = "0.2.dev2" version = __version__ From a9da6931a3f902bdc92206593bd84c6b9048ab39 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Wed, 31 Oct 2018 16:04:13 -0700 Subject: [PATCH 17/33] Updating demo notebook --- demo/simple_example.ipynb | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/demo/simple_example.ipynb b/demo/simple_example.ipynb index 9b80f5c..0b5b038 100644 --- a/demo/simple_example.ipynb +++ b/demo/simple_example.ipynb @@ -76,7 +76,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "collapsed": true + "collapsed": false }, "outputs": [], "source": [ @@ -1409,14 +1409,16 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Note how the radius of the number of jobs accessible expands as the time threshold increases where high accessibility is indicated in dark red. You can easily see downtown Oakland has the highest accessibility due to a convergence of transit routes and because downtown is where the majority of jobs in the area are located. Other high accessibility areas are visible elsewhere directly adjacent to BART metro rail stations of West Oakland, Fruitvale, and Coliseum and AC Transit bus routes on the main arterial road corridors." + "Note how the radius of the number of jobs accessible expands as the time threshold increases where high accessibility is indicated in dark red. You can easily see downtown Oakland has the highest accessibility due to a convergence of transit routes and because downtown is where the majority of jobs in the area are located. Other high accessibility areas are visible elsewhere directly adjacent to BART metro rail stations of West Oakland, Fruitvale, and Coliseum and AC Transit bus routes on the main arterial road corridors.\n", + "\n", + "**NOTE**: Plotting may be unreliable with versions of Pandana earlier than 0.4. There is also a temporary problem in Matplotlib 3.0.1 that raises an error as the figure is printed." ] }, { "cell_type": "code", "execution_count": null, "metadata": { - "collapsed": true, + "collapsed": false, "scrolled": true }, "outputs": [], @@ -1441,7 +1443,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "collapsed": true + "collapsed": false }, "outputs": [], "source": [ @@ -1465,7 +1467,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "collapsed": true + "collapsed": false }, "outputs": [], "source": [ @@ -1517,21 +1519,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python [conda env:urbanaccess-py2]", + "display_name": "Python [conda env:urbanaccess-py3-pdna4]", "language": "python", - "name": "conda-env-urbanaccess-py2-py" + "name": "conda-env-urbanaccess-py3-pdna4-py" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.15" + "pygments_lexer": "ipython3", + "version": "3.6.6" } }, "nbformat": 4, From 850f7b927f9f8bd0ff7203b49e9bdc68a82d1ff4 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Thu, 1 Nov 2018 10:39:45 -0700 Subject: [PATCH 18/33] Forcing osmnet 0.1.5 for travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 127a48e..afa6ab5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ install: - conda info -a - conda config --add channels udst - conda config --add channels conda-forge -- conda create -q -n test-env python=$TRAVIS_PYTHON_VERSION pip numpy pandas pytest jupyter pycodestyle matplotlib scikit-learn pyyaml basemap basemap-data-hires pandana=0.4 geopy osmnet +- conda create -q -n test-env python=$TRAVIS_PYTHON_VERSION pip numpy pandas pytest jupyter pycodestyle matplotlib scikit-learn pyyaml basemap basemap-data-hires pandana=0.4 geopy osmnet=0.1.5 - source activate test-env - conda list - pip install . From f6a2533befbaeaebab1e5240aa75e03a6e71a3b0 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Thu, 1 Nov 2018 11:02:31 -0700 Subject: [PATCH 19/33] Cleaning up log syntax --- urbanaccess/gtfs/utils_format.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/urbanaccess/gtfs/utils_format.py b/urbanaccess/gtfs/utils_format.py index 8750fe9..6ed694d 100644 --- a/urbanaccess/gtfs/utils_format.py +++ b/urbanaccess/gtfs/utils_format.py @@ -799,20 +799,17 @@ def _timetoseconds(df, time_cols): h = pd.to_numeric(df[col].str[0:2]) if h.any() > 48: - log( - 'Warning: {} hour value is large and may be incorrect, ' + log('Warning: {} hour value is large and may be incorrect, ' 'please check this.'.format( df[col].str[0:2].max()), level=lg.WARNING) m = pd.to_numeric(df[col].str[3:5]) if m.any() > 60: - log( - 'Warning: {} minute value is large and may be incorrect, ' + log('Warning: {} minute value is large and may be incorrect, ' 'please check this.'.format( df[col].str[3:5].max()), level=lg.WARNING) s = pd.to_numeric(df[col].str[6:8]) if s.any() > 60: - log( - 'Warning: {} second value is large and may be incorrect, ' + log('Warning: {} second value is large and may be incorrect, ' 'please check this.'.format( df[col].str[6:8].max()), level=lg.WARNING) col_series = (h * 60 * 60) + (m * 60) + s @@ -830,8 +827,7 @@ def _timetoseconds(df, time_cols): final_df = pd.merge(df, concat_series_df, how='left', left_index=True, right_index=True, sort=False, copy=False) - log( - 'Successfully converted {} to seconds past midnight and appended new ' + log('Successfully converted {} to seconds past midnight and appended new ' 'columns to stop_times. Took {:,.2f} seconds'.format( time_cols, time.time() - start_time)) From aaa88ab48496f6573e71d9c7b28c9a2e68f17e45 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Thu, 1 Nov 2018 11:31:31 -0700 Subject: [PATCH 20/33] Travis experiment --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index afa6ab5..ac921c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ install: - conda info -a - conda config --add channels udst - conda config --add channels conda-forge -- conda create -q -n test-env python=$TRAVIS_PYTHON_VERSION pip numpy pandas pytest jupyter pycodestyle matplotlib scikit-learn pyyaml basemap basemap-data-hires pandana=0.4 geopy osmnet=0.1.5 +- conda create -q -n test-env python=$TRAVIS_PYTHON_VERSION pip numpy pandas pytest jupyter pycodestyle matplotlib scikit-learn pyyaml basemap basemap-data-hires pandana=0.3 geopy osmnet - source activate test-env - conda list - pip install . From be52db016fe0227ac7e0bd6d9abc8c059e875c82 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Thu, 1 Nov 2018 11:44:45 -0700 Subject: [PATCH 21/33] Switching travis pandana to pip --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ac921c5..272a32f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,9 +15,10 @@ install: - conda info -a - conda config --add channels udst - conda config --add channels conda-forge -- conda create -q -n test-env python=$TRAVIS_PYTHON_VERSION pip numpy pandas pytest jupyter pycodestyle matplotlib scikit-learn pyyaml basemap basemap-data-hires pandana=0.3 geopy osmnet +- conda create -q -n test-env python=$TRAVIS_PYTHON_VERSION pip numpy pandas pytest jupyter pycodestyle matplotlib scikit-learn pyyaml basemap basemap-data-hires - source activate test-env - conda list +- pip install pandana==0.4 geopy osmnet - pip install . after_success: From 16b2890c4848575cf0bf6cbda0b24655637ecc0c Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Thu, 1 Nov 2018 12:01:56 -0700 Subject: [PATCH 22/33] Pandana version fix --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 272a32f..2890028 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ install: - conda create -q -n test-env python=$TRAVIS_PYTHON_VERSION pip numpy pandas pytest jupyter pycodestyle matplotlib scikit-learn pyyaml basemap basemap-data-hires - source activate test-env - conda list -- pip install pandana==0.4 geopy osmnet +- pip install pandana==0.4.1 geopy osmnet - pip install . after_success: From 1f17d64411ec0e9decbf79b45ece0640ef241d8d Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Thu, 1 Nov 2018 12:02:21 -0700 Subject: [PATCH 23/33] Pandana version fix --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2890028..87dbbfd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ install: - conda create -q -n test-env python=$TRAVIS_PYTHON_VERSION pip numpy pandas pytest jupyter pycodestyle matplotlib scikit-learn pyyaml basemap basemap-data-hires - source activate test-env - conda list -- pip install pandana==0.4.1 geopy osmnet +- pip install pandana geopy osmnet - pip install . after_success: From 881be9a26b32e669a83da368252a116c0a39dcca Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Thu, 1 Nov 2018 13:44:00 -0700 Subject: [PATCH 24/33] Setting up multiple travis builds --- .travis.yml | 59 ++++++--- demo/simple_example.ipynb | 249 +++++++++++--------------------------- 2 files changed, 113 insertions(+), 195 deletions(-) diff --git a/.travis.yml b/.travis.yml index 87dbbfd..46ac493 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,38 +1,61 @@ language: python sudo: false + python: - '2.7' -- '3.5' - '3.6' -install: +env: +- TEST_SUITE=unit_tests +- TEST_SUITE=demo_notebook +- TEST_SUITE=integration + global: + secure: SW6dfeQen1oZUYa2pr/qMdJGDK5c3tIbJsF1POLSMtgpbYaRQvogCkCd7sFXiTkxTCaNnz/eQyT2nDyUZJyDmYpntZmRthuN1zDgNk8ziDpmy/PF1bD4eshDr3MeoI4HgNYryl5qD8brEP0up0P/rvaAMoi26w4eyk0r+sO3PDVF6Jy4MwTufY4a4B4qYpi7V8yhExExytshHOEjD8C2IqEQDkwyR9oto2Gx8EpoCJEvxETG+aqLw1xj2UnXnbWND10Ni6pkeRpjAHFv4qM0i35griG2RKu9075Dubz/6UPMvpIEy581Zx5cqaSuOSUzde1L172vLTgOH31lnFXe1flHau1wI2gxOiamSdlVTAnVtL5P1aEtm1L5FjBcPlIs9rHmNGnydByX1Qe16HRLUopgAVm+jLZqWxrlesC5ax3uJ6Q3g0ZyKfmTJ5uWDeRusMVZswBT3NJc0BhkHDq7tE+3fokBfFApJcQwoXIplvRwXPkGFtKnL2IgCMTrKbDzGEYfdm/v7eV2xYe5hrEUIC9cUhkC1Ns2azAERXSgWcyM7ciFH3r1Jz9ixT+fuw9bTXibqcMjAmxdcQAW9y/rIPRJ3GMSdT7WEzYX19naGr+oyKqVMgsHFQ+wL7U5iblAGIy8VLNpE7Aa67dyG6SVAPTGzp0RouYLY9LYiRIybrI= + +matrix: + allow_failures: + - python: '3.6' + env: TEST_SUITE=demo_notebook + +before_install: - wget http://bit.ly/miniconda -O miniconda.sh - bash miniconda.sh -b -p $HOME/miniconda - export PATH="$HOME/miniconda/bin:$PATH" - hash -r -- conda config --set always_yes yes --set changeps1 no -- conda update -q conda -- conda info -a +- conda config --set always_yes yes --set show_channel_urls true +- conda update conda - conda config --add channels udst - conda config --add channels conda-forge -- conda create -q -n test-env python=$TRAVIS_PYTHON_VERSION pip numpy pandas pytest jupyter pycodestyle matplotlib scikit-learn pyyaml basemap basemap-data-hires +- conda create -quiet -name test-env python=$TRAVIS_PYTHON_VERSION pip numpy pandas pytest jupyter pycodestyle matplotlib scikit-learn pyyaml pandana geopy osmnet - source activate test-env +- if [["$TEST_SUITE" == "demo_notebook"]]; then conda install basemap basemap-data-hires; fi +- conda info -all - conda list -- pip install pandana geopy osmnet -- pip install . -after_success: -- bin/build_docs.sh +install: +- pip install . +- pip show urbanaccess script: +- if [["$TEST_SUITE" == "unit_tests"]] +- then - pycodestyle urbanaccess - py.test -- cd demo; jupyter nbconvert --to python simple_example.ipynb -- cd ../urbanaccess/tests/integration; python remove_nb_magic.py -in simple_example.py -out simple_example_clean.py -- cd ../../../demo; python simple_example_clean.py -- cd ../urbanaccess/tests/integration; python integration_madison.py -- python integration_sandiego.py && cd $TRAVIS_BUILD_DIR +- fi +- if [["$TEST_SUITE" == "demo_notebook"]] +- then +- jupyter nbconvert --to python demo/simple_example.ipynb +- python urbanaccess/tests/integration/remove_nb_magic.py -in simple_example.py -out simple_example_clean.py +- python demo/simple_example_clean.py +- fi +- if [["$TEST_SUITE" == "integration"]] +- then +- python urbanaccess/tests/integration/integration_madison.py +- python urbanaccess/tests/integration/integration_sandiego.py +- fi -env: - global: - secure: SW6dfeQen1oZUYa2pr/qMdJGDK5c3tIbJsF1POLSMtgpbYaRQvogCkCd7sFXiTkxTCaNnz/eQyT2nDyUZJyDmYpntZmRthuN1zDgNk8ziDpmy/PF1bD4eshDr3MeoI4HgNYryl5qD8brEP0up0P/rvaAMoi26w4eyk0r+sO3PDVF6Jy4MwTufY4a4B4qYpi7V8yhExExytshHOEjD8C2IqEQDkwyR9oto2Gx8EpoCJEvxETG+aqLw1xj2UnXnbWND10Ni6pkeRpjAHFv4qM0i35griG2RKu9075Dubz/6UPMvpIEy581Zx5cqaSuOSUzde1L172vLTgOH31lnFXe1flHau1wI2gxOiamSdlVTAnVtL5P1aEtm1L5FjBcPlIs9rHmNGnydByX1Qe16HRLUopgAVm+jLZqWxrlesC5ax3uJ6Q3g0ZyKfmTJ5uWDeRusMVZswBT3NJc0BhkHDq7tE+3fokBfFApJcQwoXIplvRwXPkGFtKnL2IgCMTrKbDzGEYfdm/v7eV2xYe5hrEUIC9cUhkC1Ns2azAERXSgWcyM7ciFH3r1Jz9ixT+fuw9bTXibqcMjAmxdcQAW9y/rIPRJ3GMSdT7WEzYX19naGr+oyKqVMgsHFQ+wL7U5iblAGIy8VLNpE7Aa67dyG6SVAPTGzp0RouYLY9LYiRIybrI= +after_success: +- if [["$TEST_SUITE" == "integration"]] +- then +- bin/build_docs.sh +- fi \ No newline at end of file diff --git a/demo/simple_example.ipynb b/demo/simple_example.ipynb index 0b5b038..a8088c1 100644 --- a/demo/simple_example.ipynb +++ b/demo/simple_example.ipynb @@ -75,9 +75,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", @@ -127,9 +125,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "settings.to_dict()" @@ -192,9 +188,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "feeds.to_dict()" @@ -226,9 +220,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "gtfsfeeds.search(search_text='Bay Area Rapid Transit',\n", @@ -246,9 +238,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "gtfsfeeds.search(search_text='Bay Area Rapid Transit',\n", @@ -276,9 +266,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "feeds.add_feed(add_dict={'ac transit': 'http://www.actransit.org/wp-content/uploads/GTFSJune182017B.zip'})" @@ -294,9 +282,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "feeds.to_dict()" @@ -321,9 +307,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "gtfsfeeds.download()" @@ -351,9 +335,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "validation = True\n", @@ -388,9 +370,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "loaded_feeds.stops.head()" @@ -406,9 +386,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "loaded_feeds.stops.unique_agency_id.unique()" @@ -424,9 +402,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "loaded_feeds.stops.plot(kind='scatter', x='stop_lon', y='stop_lat', s=0.1)" @@ -435,9 +411,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "loaded_feeds.routes.head()" @@ -446,9 +420,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "loaded_feeds.stop_times.head()" @@ -457,9 +429,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "loaded_feeds.trips.head()" @@ -468,9 +438,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "loaded_feeds.calendar.head()" @@ -502,9 +470,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "ua.gtfs.network.create_transit_net(gtfsfeeds_dfs=loaded_feeds,\n", @@ -548,9 +514,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "urbanaccess_net.transit_edges.head()" @@ -559,9 +523,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "urbanaccess_net.transit_nodes.head()" @@ -570,9 +532,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "urbanaccess_net.transit_nodes.plot(kind='scatter', x='x', y='y', s=0.1)" @@ -597,9 +557,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "nodes, edges = ua.osm.load.ua_network_from_bbox(bbox=bbox,\n", @@ -627,9 +585,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "ua.osm.network.create_osm_net(osm_edges=edges,\n", @@ -647,9 +603,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "urbanaccess_net.osm_nodes.head()" @@ -658,9 +612,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "urbanaccess_net.osm_edges.head()" @@ -669,9 +621,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "urbanaccess_net.osm_nodes.plot(kind='scatter', x='x', y='y', s=0.1)" @@ -696,9 +646,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "ua.network.integrate_network(urbanaccess_network=urbanaccess_net,\n", @@ -715,9 +663,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "urbanaccess_net.net_nodes.head()" @@ -726,9 +672,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "urbanaccess_net.net_edges.head()" @@ -737,9 +681,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "urbanaccess_net.net_edges[urbanaccess_net.net_edges['net_type'] == 'transit'].head()" @@ -764,9 +706,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "ua.network.save_network(urbanaccess_network=urbanaccess_net,\n", @@ -793,9 +733,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "urbanaccess_net = ua.network.load_network(filename='final_net.h5')" @@ -829,9 +767,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "ua.plot.plot_net(nodes=urbanaccess_net.net_nodes,\n", @@ -868,9 +804,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "edgecolor = ua.plot.col_colors(df=urbanaccess_net.net_edges, col='weight', cmap='gist_heat_r', num_bins=5)\n", @@ -892,9 +826,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "edgecolor = ua.plot.col_colors(df=urbanaccess_net.net_edges, col='weight', cmap='gist_heat_r', num_bins=5)\n", @@ -925,9 +857,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "ua.plot.plot_net(nodes=urbanaccess_net.net_nodes,\n", @@ -950,9 +880,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "ua.plot.plot_net(nodes=urbanaccess_net.net_nodes,\n", @@ -989,9 +917,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "urbanaccess_net.net_edges['unique_route_id'].unique()" @@ -1000,9 +926,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "ua.plot.plot_net(nodes=urbanaccess_net.net_nodes,\n", @@ -1034,9 +958,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "urbanaccess_net.net_edges['unique_agency_id'].unique()" @@ -1045,9 +967,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "ua.plot.plot_net(nodes=urbanaccess_net.net_nodes,\n", @@ -1095,9 +1015,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "ua.gtfs.headways.headways(gtfsfeeds_df=loaded_feeds,\n", @@ -1107,9 +1025,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "loaded_feeds.headways.head()" @@ -1134,9 +1050,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "ua.network.integrate_network(urbanaccess_network=urbanaccess_net,\n", @@ -1155,9 +1069,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "edgecolor = ua.plot.col_colors(df=urbanaccess_net.net_edges, col='weight', cmap='gist_heat_r', num_bins=5)\n", @@ -1222,7 +1134,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "collapsed": false, "scrolled": true }, "outputs": [], @@ -1244,9 +1155,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "lng_max, lat_min, lng_min, lat_max = bbox\n", @@ -1259,7 +1168,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "collapsed": false, "scrolled": false }, "outputs": [], @@ -1284,9 +1192,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "s_time = time.time()\n", @@ -1366,9 +1272,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "s_time = time.time()\n", @@ -1388,9 +1292,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "print(jobs_45.head())\n", @@ -1409,27 +1311,24 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Note how the radius of the number of jobs accessible expands as the time threshold increases where high accessibility is indicated in dark red. You can easily see downtown Oakland has the highest accessibility due to a convergence of transit routes and because downtown is where the majority of jobs in the area are located. Other high accessibility areas are visible elsewhere directly adjacent to BART metro rail stations of West Oakland, Fruitvale, and Coliseum and AC Transit bus routes on the main arterial road corridors.\n", - "\n", - "**NOTE**: Plotting may be unreliable with versions of Pandana earlier than 0.4. There is also a temporary problem in Matplotlib 3.0.1 that raises an error as the figure is printed." + "Note how the radius of the number of jobs accessible expands as the time threshold increases where high accessibility is indicated in dark red. You can easily see downtown Oakland has the highest accessibility due to a convergence of transit routes and because downtown is where the majority of jobs in the area are located. Other high accessibility areas are visible elsewhere directly adjacent to BART metro rail stations of West Oakland, Fruitvale, and Coliseum and AC Transit bus routes on the main arterial road corridors." ] }, { "cell_type": "code", "execution_count": null, "metadata": { - "collapsed": false, "scrolled": true }, "outputs": [], "source": [ - "# s_time = time.time()\n", - "# transit_ped_net.plot(jobs_15, \n", - "# plot_type='scatter',\n", - "# fig_kwargs={'figsize':[20,20]},\n", - "# bmap_kwargs={'epsg':'26943','resolution':'h'},\n", - "# plot_kwargs={'cmap':'gist_heat_r','s':4,'edgecolor':'none'})\n", - "# print('Took {:,.2f} seconds'.format(time.time() - s_time))" + "s_time = time.time()\n", + "transit_ped_net.plot(jobs_15, \n", + " plot_type='scatter',\n", + " fig_kwargs={'figsize':[20,20]},\n", + " bmap_kwargs={'epsg':'26943','resolution':'h'},\n", + " plot_kwargs={'cmap':'gist_heat_r','s':4,'edgecolor':'none'})\n", + "print('Took {:,.2f} seconds'.format(time.time() - s_time))" ] }, { @@ -1442,18 +1341,16 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ - "# s_time = time.time()\n", - "# transit_ped_net.plot(jobs_30, \n", - "# plot_type='scatter',\n", - "# fig_kwargs={'figsize':[20,20]},\n", - "# bmap_kwargs={'epsg':'26943','resolution':'h'},\n", - "# plot_kwargs={'cmap':'gist_heat_r','s':4,'edgecolor':'none'})\n", - "# print('Took {:,.2f} seconds'.format(time.time() - s_time))" + "s_time = time.time()\n", + "transit_ped_net.plot(jobs_30, \n", + " plot_type='scatter',\n", + " fig_kwargs={'figsize':[20,20]},\n", + " bmap_kwargs={'epsg':'26943','resolution':'h'},\n", + " plot_kwargs={'cmap':'gist_heat_r','s':4,'edgecolor':'none'})\n", + "print('Took {:,.2f} seconds'.format(time.time() - s_time))" ] }, { @@ -1466,18 +1363,16 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ - "# s_time = time.time()\n", - "# transit_ped_net.plot(jobs_45, \n", - "# plot_type='scatter',\n", - "# fig_kwargs={'figsize':[20,20]},\n", - "# bmap_kwargs={'epsg':'26943','resolution':'h'},\n", - "# plot_kwargs={'cmap':'gist_heat_r','s':4,'edgecolor':'none'})\n", - "# print('Took {:,.2f} seconds'.format(time.time() - s_time))" + "s_time = time.time()\n", + "transit_ped_net.plot(jobs_45, \n", + " plot_type='scatter',\n", + " fig_kwargs={'figsize':[20,20]},\n", + " bmap_kwargs={'epsg':'26943','resolution':'h'},\n", + " plot_kwargs={'cmap':'gist_heat_r','s':4,'edgecolor':'none'})\n", + "print('Took {:,.2f} seconds'.format(time.time() - s_time))" ] }, { From f5144ae34532f6a9906cf71026cd39b2f6678346 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Thu, 1 Nov 2018 13:52:01 -0700 Subject: [PATCH 25/33] Yaml fix --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 46ac493..da4fe50 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ env: - TEST_SUITE=unit_tests - TEST_SUITE=demo_notebook - TEST_SUITE=integration - global: +- global: secure: SW6dfeQen1oZUYa2pr/qMdJGDK5c3tIbJsF1POLSMtgpbYaRQvogCkCd7sFXiTkxTCaNnz/eQyT2nDyUZJyDmYpntZmRthuN1zDgNk8ziDpmy/PF1bD4eshDr3MeoI4HgNYryl5qD8brEP0up0P/rvaAMoi26w4eyk0r+sO3PDVF6Jy4MwTufY4a4B4qYpi7V8yhExExytshHOEjD8C2IqEQDkwyR9oto2Gx8EpoCJEvxETG+aqLw1xj2UnXnbWND10Ni6pkeRpjAHFv4qM0i35griG2RKu9075Dubz/6UPMvpIEy581Zx5cqaSuOSUzde1L172vLTgOH31lnFXe1flHau1wI2gxOiamSdlVTAnVtL5P1aEtm1L5FjBcPlIs9rHmNGnydByX1Qe16HRLUopgAVm+jLZqWxrlesC5ax3uJ6Q3g0ZyKfmTJ5uWDeRusMVZswBT3NJc0BhkHDq7tE+3fokBfFApJcQwoXIplvRwXPkGFtKnL2IgCMTrKbDzGEYfdm/v7eV2xYe5hrEUIC9cUhkC1Ns2azAERXSgWcyM7ciFH3r1Jz9ixT+fuw9bTXibqcMjAmxdcQAW9y/rIPRJ3GMSdT7WEzYX19naGr+oyKqVMgsHFQ+wL7U5iblAGIy8VLNpE7Aa67dyG6SVAPTGzp0RouYLY9LYiRIybrI= matrix: From b1489c88c92cc3166d6d08020da33e21e947c273 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Thu, 1 Nov 2018 14:00:40 -0700 Subject: [PATCH 26/33] Bash fixes --- .travis.yml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index da4fe50..be9d176 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,10 +6,11 @@ python: - '3.6' env: -- TEST_SUITE=unit_tests -- TEST_SUITE=demo_notebook -- TEST_SUITE=integration -- global: + matrix: + - TEST_SUITE=unit_tests + - TEST_SUITE=demo_notebook + - TEST_SUITE=integration + global: secure: SW6dfeQen1oZUYa2pr/qMdJGDK5c3tIbJsF1POLSMtgpbYaRQvogCkCd7sFXiTkxTCaNnz/eQyT2nDyUZJyDmYpntZmRthuN1zDgNk8ziDpmy/PF1bD4eshDr3MeoI4HgNYryl5qD8brEP0up0P/rvaAMoi26w4eyk0r+sO3PDVF6Jy4MwTufY4a4B4qYpi7V8yhExExytshHOEjD8C2IqEQDkwyR9oto2Gx8EpoCJEvxETG+aqLw1xj2UnXnbWND10Ni6pkeRpjAHFv4qM0i35griG2RKu9075Dubz/6UPMvpIEy581Zx5cqaSuOSUzde1L172vLTgOH31lnFXe1flHau1wI2gxOiamSdlVTAnVtL5P1aEtm1L5FjBcPlIs9rHmNGnydByX1Qe16HRLUopgAVm+jLZqWxrlesC5ax3uJ6Q3g0ZyKfmTJ5uWDeRusMVZswBT3NJc0BhkHDq7tE+3fokBfFApJcQwoXIplvRwXPkGFtKnL2IgCMTrKbDzGEYfdm/v7eV2xYe5hrEUIC9cUhkC1Ns2azAERXSgWcyM7ciFH3r1Jz9ixT+fuw9bTXibqcMjAmxdcQAW9y/rIPRJ3GMSdT7WEzYX19naGr+oyKqVMgsHFQ+wL7U5iblAGIy8VLNpE7Aa67dyG6SVAPTGzp0RouYLY9LYiRIybrI= matrix: @@ -26,10 +27,10 @@ before_install: - conda update conda - conda config --add channels udst - conda config --add channels conda-forge -- conda create -quiet -name test-env python=$TRAVIS_PYTHON_VERSION pip numpy pandas pytest jupyter pycodestyle matplotlib scikit-learn pyyaml pandana geopy osmnet +- conda create --quiet --name test-env python=$TRAVIS_PYTHON_VERSION pip numpy pandas pytest jupyter pycodestyle matplotlib scikit-learn pyyaml pandana geopy osmnet - source activate test-env - if [["$TEST_SUITE" == "demo_notebook"]]; then conda install basemap basemap-data-hires; fi -- conda info -all +- conda info --all - conda list install: @@ -44,14 +45,19 @@ script: - fi - if [["$TEST_SUITE" == "demo_notebook"]] - then -- jupyter nbconvert --to python demo/simple_example.ipynb -- python urbanaccess/tests/integration/remove_nb_magic.py -in simple_example.py -out simple_example_clean.py -- python demo/simple_example_clean.py +- cd demo +- jupyter nbconvert --to python simple_example.ipynb +- cd ../urbanaccess/tests/integration +- python remove_nb_magic.py -in simple_example.py -out simple_example_clean.py +- cd ../../../demo +- python simple_example_clean.py - fi - if [["$TEST_SUITE" == "integration"]] - then -- python urbanaccess/tests/integration/integration_madison.py -- python urbanaccess/tests/integration/integration_sandiego.py +- cd ../urbanaccess/tests/integration +- python integration_madison.py +- python integration_sandiego.py +- cd $TRAVIS_BUILD_DIR - fi after_success: From 8ea1a77f472fb652d7abe43a0166bde636f9e9d2 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Thu, 1 Nov 2018 14:25:05 -0700 Subject: [PATCH 27/33] Fixing travis conditionals --- .travis.yml | 54 +++++++++++++++++++++++++---------------------------- 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index be9d176..3cd2c91 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,13 +10,14 @@ env: - TEST_SUITE=unit_tests - TEST_SUITE=demo_notebook - TEST_SUITE=integration - global: - secure: SW6dfeQen1oZUYa2pr/qMdJGDK5c3tIbJsF1POLSMtgpbYaRQvogCkCd7sFXiTkxTCaNnz/eQyT2nDyUZJyDmYpntZmRthuN1zDgNk8ziDpmy/PF1bD4eshDr3MeoI4HgNYryl5qD8brEP0up0P/rvaAMoi26w4eyk0r+sO3PDVF6Jy4MwTufY4a4B4qYpi7V8yhExExytshHOEjD8C2IqEQDkwyR9oto2Gx8EpoCJEvxETG+aqLw1xj2UnXnbWND10Ni6pkeRpjAHFv4qM0i35griG2RKu9075Dubz/6UPMvpIEy581Zx5cqaSuOSUzde1L172vLTgOH31lnFXe1flHau1wI2gxOiamSdlVTAnVtL5P1aEtm1L5FjBcPlIs9rHmNGnydByX1Qe16HRLUopgAVm+jLZqWxrlesC5ax3uJ6Q3g0ZyKfmTJ5uWDeRusMVZswBT3NJc0BhkHDq7tE+3fokBfFApJcQwoXIplvRwXPkGFtKnL2IgCMTrKbDzGEYfdm/v7eV2xYe5hrEUIC9cUhkC1Ns2azAERXSgWcyM7ciFH3r1Jz9ixT+fuw9bTXibqcMjAmxdcQAW9y/rIPRJ3GMSdT7WEzYX19naGr+oyKqVMgsHFQ+wL7U5iblAGIy8VLNpE7Aa67dyG6SVAPTGzp0RouYLY9LYiRIybrI= +# global: +# secure: SW6dfeQen1oZUYa2pr/qMdJGDK5c3tIbJsF1POLSMtgpbYaRQvogCkCd7sFXiTkxTCaNnz/eQyT2nDyUZJyDmYpntZmRthuN1zDgNk8ziDpmy/PF1bD4eshDr3MeoI4HgNYryl5qD8brEP0up0P/rvaAMoi26w4eyk0r+sO3PDVF6Jy4MwTufY4a4B4qYpi7V8yhExExytshHOEjD8C2IqEQDkwyR9oto2Gx8EpoCJEvxETG+aqLw1xj2UnXnbWND10Ni6pkeRpjAHFv4qM0i35griG2RKu9075Dubz/6UPMvpIEy581Zx5cqaSuOSUzde1L172vLTgOH31lnFXe1flHau1wI2gxOiamSdlVTAnVtL5P1aEtm1L5FjBcPlIs9rHmNGnydByX1Qe16HRLUopgAVm+jLZqWxrlesC5ax3uJ6Q3g0ZyKfmTJ5uWDeRusMVZswBT3NJc0BhkHDq7tE+3fokBfFApJcQwoXIplvRwXPkGFtKnL2IgCMTrKbDzGEYfdm/v7eV2xYe5hrEUIC9cUhkC1Ns2azAERXSgWcyM7ciFH3r1Jz9ixT+fuw9bTXibqcMjAmxdcQAW9y/rIPRJ3GMSdT7WEzYX19naGr+oyKqVMgsHFQ+wL7U5iblAGIy8VLNpE7Aa67dyG6SVAPTGzp0RouYLY9LYiRIybrI= matrix: allow_failures: - python: '3.6' env: TEST_SUITE=demo_notebook + fast_finish: true before_install: - wget http://bit.ly/miniconda -O miniconda.sh @@ -37,31 +38,26 @@ install: - pip install . - pip show urbanaccess -script: -- if [["$TEST_SUITE" == "unit_tests"]] -- then -- pycodestyle urbanaccess -- py.test -- fi -- if [["$TEST_SUITE" == "demo_notebook"]] -- then -- cd demo -- jupyter nbconvert --to python simple_example.ipynb -- cd ../urbanaccess/tests/integration -- python remove_nb_magic.py -in simple_example.py -out simple_example_clean.py -- cd ../../../demo -- python simple_example_clean.py -- fi -- if [["$TEST_SUITE" == "integration"]] -- then -- cd ../urbanaccess/tests/integration -- python integration_madison.py -- python integration_sandiego.py -- cd $TRAVIS_BUILD_DIR -- fi +jobs: + include: + - if: env(TEST_SUITE) = unit_tests + script: + - pycodestyle urbanaccess + - py.test + - if: env(TEST_SUITE) = demo_notebook + script: + - cd demo + - jupyter nbconvert --to python simple_example.ipynb + - cd ../urbanaccess/tests/integration + - python remove_nb_magic.py -in simple_example.py -out simple_example_clean.py + - cd ../../../demo + - python simple_example_clean.py + - if: env(TEST_SUITE) = integration + script: + - cd ../urbanaccess/tests/integration + - python integration_madison.py + - python integration_sandiego.py + - cd $TRAVIS_BUILD_DIR -after_success: -- if [["$TEST_SUITE" == "integration"]] -- then -- bin/build_docs.sh -- fi \ No newline at end of file +#after_success: +#- if [["$TEST_SUITE" == "integration"]]; then bin/build_docs.sh; fi \ No newline at end of file From a3c157681586c41c717b353ab206b9779d439139 Mon Sep 17 00:00:00 2001 From: sablanchard Date: Thu, 1 Nov 2018 14:33:50 -0700 Subject: [PATCH 28/33] updates to docs and readme --- README.rst | 28 +++++++++++++--------------- docs/source/installation.rst | 12 ++++++------ 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/README.rst b/README.rst index e5ea25a..660eaac 100644 --- a/README.rst +++ b/README.rst @@ -46,16 +46,21 @@ Let us know what you are working on or if you think you have a great use case by tweeting us at ``@urbansim`` or post on the UrbanSim `forum `__. +Citation and academic literature +-------------------------------- + +To cite this tool and for a complete description of the UrbanAccess methodology see the paper below: + +`Samuel D. Blanchard and Paul Waddell. 2017. "UrbanAccess: Generalized Methodology for Measuring Regional Accessibility with an Integrated Pedestrian and Transit Network." Transportation Research Record: Journal of the Transportation Research Board. No. 2653. pp. 35–44. `__ + +For other related literature see `here `__. + Current status -------------- -UrbanAccess is currently in a alpha release and only compatible with -Python 2.x. Further code refinements are expected. - *Forthcoming improvements:* - Unit tests -- Python 3 Reporting bugs -------------- @@ -77,7 +82,9 @@ Install the latest release conda ~~~~~~ -conda installation is forthcoming. +UrbanAccess is available on conda and can be installed with:: + + conda install -c udst urbanaccess pip ~~~~~~ @@ -88,7 +95,7 @@ UrbanAccess is available on PyPI and can be installed with:: Development Installation ------------------------ -UrbanAccess is currently in a alpha release and further code refinements are expected. As such, it is suggested to install using 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. +Developers contributing code can install using 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. To install UrbanAccess follow these steps: @@ -117,15 +124,6 @@ UrbanAccess are: ``stop_times``, ``stops``, ``routes``, ``calendar``, and ``trips`` however if there is no ``calendar``, ``calendar_dates`` can be used as a replacement. -Citation and academic literature --------------------------------- - -To cite this tool and for a complete description of the UrbanAccess methodology see the paper below: - -`Samuel D. Blanchard and Paul Waddell. 2017. "UrbanAccess: Generalized Methodology for Measuring Regional Accessibility with an Integrated Pedestrian and Transit Network." Transportation Research Record: Journal of the Transportation Research Board. No. 2653. pp. 35–44. `__ - -For other related literature see `here `__. - Related UDST libraries ---------------------- diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 4097e2a..9b577cc 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -7,9 +7,10 @@ Dependencies ------------ * requests >= 2.9.1 +* six >= 1.11 * pandas >= 0.17.0 * numpy >= 1.11 -* osmnet >= 0.1a +* osmnet >= 0.1.4 * pandana >= 0.2.0 * matplotlib >= 2.0 * geopy >= 1.11.0 @@ -24,19 +25,18 @@ Dependencies can be installed through the ``conda-forge`` and ``udst`` channels. Current status -------------- -UrbanAccess is currently in a alpha release and only compatible with Python 2.x. Further code refinements are expected. - *Forthcoming improvements:* * Unit tests -* Python 3 Install the latest release -------------------------- conda ~~~~~~ -conda installation is forthcoming. +UrbanAccess is available on conda and can be installed with:: + + conda install -c udst urbanaccess pip ~~~~~~ @@ -47,7 +47,7 @@ UrbanAccess is available on PyPI and can be installed with:: Development Installation ------------------------ -UrbanAccess is currently in a alpha release and further code refinements are expected. As such, it is suggested to install using 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. +Developers contributing code can install using 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. To install UrbanAccess follow these steps: From 3e00230eedb9de9310706aec47fccbc78bac0d56 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Thu, 1 Nov 2018 14:44:42 -0700 Subject: [PATCH 29/33] Overriding main travis script --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 3cd2c91..d13466a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,5 +59,7 @@ jobs: - python integration_sandiego.py - cd $TRAVIS_BUILD_DIR +script: + #after_success: #- if [["$TEST_SUITE" == "integration"]]; then bin/build_docs.sh; fi \ No newline at end of file From 0594da9334e117f375115911aff80d6161773afd Mon Sep 17 00:00:00 2001 From: sablanchard Date: Thu, 1 Nov 2018 15:03:45 -0700 Subject: [PATCH 30/33] updated comment --- urbanaccess/osm/load.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/urbanaccess/osm/load.py b/urbanaccess/osm/load.py index 05c2c17..567b1d6 100644 --- a/urbanaccess/osm/load.py +++ b/urbanaccess/osm/load.py @@ -8,7 +8,9 @@ from urbanaccess.utils import log # set the number of Pandana Networks in memory to arbitrary 40 for -# removing low connectivity nodes (not needed beginning v0.4) +# removing low connectivity nodes +# Note: reserve_num_graphs was removed in Pandana beginning in v0.4 but is +# required for prior versions if pandana.__version__[:3] in ['0.1', '0.2', '0.3']: pandana.network.reserve_num_graphs(40) From 4ce163b5c0bd882e6c2f07a76127d3a7ebdb9dd2 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Thu, 1 Nov 2018 15:08:58 -0700 Subject: [PATCH 31/33] Reverting Travis changes --- .travis.yml | 60 ++++++++++++++++------------------------------------- 1 file changed, 18 insertions(+), 42 deletions(-) diff --git a/.travis.yml b/.travis.yml index d13466a..0a251ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,65 +1,41 @@ language: python sudo: false - python: - '2.7' - '3.6' -env: - matrix: - - TEST_SUITE=unit_tests - - TEST_SUITE=demo_notebook - - TEST_SUITE=integration -# global: -# secure: SW6dfeQen1oZUYa2pr/qMdJGDK5c3tIbJsF1POLSMtgpbYaRQvogCkCd7sFXiTkxTCaNnz/eQyT2nDyUZJyDmYpntZmRthuN1zDgNk8ziDpmy/PF1bD4eshDr3MeoI4HgNYryl5qD8brEP0up0P/rvaAMoi26w4eyk0r+sO3PDVF6Jy4MwTufY4a4B4qYpi7V8yhExExytshHOEjD8C2IqEQDkwyR9oto2Gx8EpoCJEvxETG+aqLw1xj2UnXnbWND10Ni6pkeRpjAHFv4qM0i35griG2RKu9075Dubz/6UPMvpIEy581Zx5cqaSuOSUzde1L172vLTgOH31lnFXe1flHau1wI2gxOiamSdlVTAnVtL5P1aEtm1L5FjBcPlIs9rHmNGnydByX1Qe16HRLUopgAVm+jLZqWxrlesC5ax3uJ6Q3g0ZyKfmTJ5uWDeRusMVZswBT3NJc0BhkHDq7tE+3fokBfFApJcQwoXIplvRwXPkGFtKnL2IgCMTrKbDzGEYfdm/v7eV2xYe5hrEUIC9cUhkC1Ns2azAERXSgWcyM7ciFH3r1Jz9ixT+fuw9bTXibqcMjAmxdcQAW9y/rIPRJ3GMSdT7WEzYX19naGr+oyKqVMgsHFQ+wL7U5iblAGIy8VLNpE7Aa67dyG6SVAPTGzp0RouYLY9LYiRIybrI= - matrix: allow_failures: - - python: '3.6' - env: TEST_SUITE=demo_notebook + python: '3.6' fast_finish: true -before_install: +install: - wget http://bit.ly/miniconda -O miniconda.sh - bash miniconda.sh -b -p $HOME/miniconda - export PATH="$HOME/miniconda/bin:$PATH" - hash -r -- conda config --set always_yes yes --set show_channel_urls true -- conda update conda +- conda config --set always_yes yes --set changeps1 no +- conda update -q conda +- conda info -a - conda config --add channels udst - conda config --add channels conda-forge -- conda create --quiet --name test-env python=$TRAVIS_PYTHON_VERSION pip numpy pandas pytest jupyter pycodestyle matplotlib scikit-learn pyyaml pandana geopy osmnet +- conda create -q -n test-env python=$TRAVIS_PYTHON_VERSION pip numpy pandas pytest jupyter pycodestyle matplotlib scikit-learn pyyaml basemap basemap-data-hires pandana geopy osmnet - source activate test-env -- if [["$TEST_SUITE" == "demo_notebook"]]; then conda install basemap basemap-data-hires; fi -- conda info --all - conda list - -install: - pip install . -- pip show urbanaccess -jobs: - include: - - if: env(TEST_SUITE) = unit_tests - script: - - pycodestyle urbanaccess - - py.test - - if: env(TEST_SUITE) = demo_notebook - script: - - cd demo - - jupyter nbconvert --to python simple_example.ipynb - - cd ../urbanaccess/tests/integration - - python remove_nb_magic.py -in simple_example.py -out simple_example_clean.py - - cd ../../../demo - - python simple_example_clean.py - - if: env(TEST_SUITE) = integration - script: - - cd ../urbanaccess/tests/integration - - python integration_madison.py - - python integration_sandiego.py - - cd $TRAVIS_BUILD_DIR +after_success: +- bin/build_docs.sh script: +- pycodestyle urbanaccess +- py.test +- cd demo; jupyter nbconvert --to python simple_example.ipynb +- cd ../urbanaccess/tests/integration; python remove_nb_magic.py -in simple_example.py -out simple_example_clean.py +- cd ../../../demo; python simple_example_clean.py +- cd ../urbanaccess/tests/integration; python integration_madison.py +- python integration_sandiego.py && cd $TRAVIS_BUILD_DIR -#after_success: -#- if [["$TEST_SUITE" == "integration"]]; then bin/build_docs.sh; fi \ No newline at end of file +env: + global: + secure: SW6dfeQen1oZUYa2pr/qMdJGDK5c3tIbJsF1POLSMtgpbYaRQvogCkCd7sFXiTkxTCaNnz/eQyT2nDyUZJyDmYpntZmRthuN1zDgNk8ziDpmy/PF1bD4eshDr3MeoI4HgNYryl5qD8brEP0up0P/rvaAMoi26w4eyk0r+sO3PDVF6Jy4MwTufY4a4B4qYpi7V8yhExExytshHOEjD8C2IqEQDkwyR9oto2Gx8EpoCJEvxETG+aqLw1xj2UnXnbWND10Ni6pkeRpjAHFv4qM0i35griG2RKu9075Dubz/6UPMvpIEy581Zx5cqaSuOSUzde1L172vLTgOH31lnFXe1flHau1wI2gxOiamSdlVTAnVtL5P1aEtm1L5FjBcPlIs9rHmNGnydByX1Qe16HRLUopgAVm+jLZqWxrlesC5ax3uJ6Q3g0ZyKfmTJ5uWDeRusMVZswBT3NJc0BhkHDq7tE+3fokBfFApJcQwoXIplvRwXPkGFtKnL2IgCMTrKbDzGEYfdm/v7eV2xYe5hrEUIC9cUhkC1Ns2azAERXSgWcyM7ciFH3r1Jz9ixT+fuw9bTXibqcMjAmxdcQAW9y/rIPRJ3GMSdT7WEzYX19naGr+oyKqVMgsHFQ+wL7U5iblAGIy8VLNpE7Aa67dyG6SVAPTGzp0RouYLY9LYiRIybrI= \ No newline at end of file From 50e89b8b270aae538c1afc059679736d4bb2b853 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Thu, 1 Nov 2018 15:11:07 -0700 Subject: [PATCH 32/33] Allow travis failures --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0a251ff..c4cfcb3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ python: matrix: allow_failures: - python: '3.6' + - python: '3.6' fast_finish: true install: From 4930773ce057e7dae546a364e1ac5f6f07ee58b2 Mon Sep 17 00:00:00 2001 From: sablanchard Date: Thu, 1 Nov 2018 15:48:01 -0700 Subject: [PATCH 33/33] bumped version to 0.2.0 and updated history.rst --- HISTORY.rst | 12 ++++++++++++ setup.py | 2 +- urbanaccess/__init__.py | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 3b765cb..245419e 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,3 +1,15 @@ +v0.2.0 +====== + +2018/11/02 + +* Python 3 compatibility (preserving compatibility with Python 2) + * Updated demo for cross compatibility + * Added Python 3 to travis +* Support latest version of Pandana v0.4.1 (preserving compatibility with prior versions) +* Removed integration test using Great Britain dataset as data no longer available for download +* Updated readme and docs + v0.1.0 ====== diff --git a/setup.py b/setup.py index a9d12c0..032de19 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ setup( name='urbanaccess', - version='0.2.dev2', + version='0.2.0', license='AGPL', description=description, long_description=long_description, diff --git a/urbanaccess/__init__.py b/urbanaccess/__init__.py index 50b4cdc..4c16e9e 100644 --- a/urbanaccess/__init__.py +++ b/urbanaccess/__init__.py @@ -9,6 +9,6 @@ from .gtfsfeeds import * from .plot import * -__version__ = "0.2.dev2" +__version__ = "0.2.0" version = __version__