Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Different results when performing one to many vs many to many matrix #295

Open
rarearth opened this issue Jun 30, 2023 · 2 comments
Open
Labels
bug Something isn't working feedback Further information is requested

Comments

@rarearth
Copy link

rarearth commented Jun 30, 2023

Describe the bug
I have a data frames of origins and destinations and when I compute the travel times from every origin to every destination I noticed that some of the travel times seemed incredible unrealistic. For example it would say going 3 block by walking + transit would take upwards of 30 minutes.

I then decided to take the specific origin point I was concerned with and do a one to many travel time matrix calculation and I found the results to be much more reasonable, i.e. ~~5 minutes or so.

I also noticed that when I rerun the travel time matrix for the many to many, I get different results every time.

my input shapes are

origins_gdf.shape, destinations_gdf.shape
>>> ((1004, 3), (506, 19))

To Reproduce

transport_network = TransportNetwork(
    "../data/Chicago.osm.pbf",
    [
        "../data/GTFS.zip"
    ]
)

travel_time_matrix_computer = TravelTimeMatrixComputer(
    transport_network,
    origins=origins_gdf,
    destinations=destinations_gdf,
    transport_modes=[TransitMode.TRANSIT, LegMode.WALK],
    breakdown=True
)
travel_time_matrix = travel_time_matrix_computer.compute_travel_times()

# vs
travel_time_matrix_computer = TravelTimeMatrixComputer(
    transport_network,
    origins=origins_gdf[origins_gdf.id == 227],
    destinations=destinations_gdf,
    transport_modes=[TransitMode.TRANSIT, LegMode.WALK],
    breakdown=True
)
travel_time_matrix = travel_time_matrix_computer.compute_travel_times()

I can provide the gdf shape files and the transport network if need be

Expected behavior
I would expect the

Environment:
Apple M1 Max
Ventura 13.4 (22F66)

java zulu-11.jdk

platform: osx-arm64

affine=2.4.0=pyhd8ed1ab_0
anyio=3.7.0=pyhd8ed1ab_1
appnope=0.1.3=pyhd8ed1ab_0
argon2-cffi=21.3.0=pyhd8ed1ab_0
argon2-cffi-bindings=21.2.0=py310h8e9501a_3
asttokens=2.2.1=pyhd8ed1ab_0
attrs=23.1.0=pyh71513ae_1
backcall=0.2.0=pyh9f0ad1d_0
backports=1.0=pyhd8ed1ab_3
backports.functools_lru_cache=1.6.4=pyhd8ed1ab_0
beautifulsoup4=4.12.2=pyha770c72_0
bleach=6.0.0=pyhd8ed1ab_0
blinker=1.6.2=pyhd8ed1ab_0
blosc=1.21.4=hc338f07_0
boost-cpp=1.78.0=h9ed8d21_3
branca=0.6.0=pyhd8ed1ab_0
brotli=1.0.9=h1a8c8d9_8
brotli-bin=1.0.9=h1a8c8d9_8
bzip2=1.0.8=h3422bc3_4
c-ares=1.19.1=hb547adb_0
ca-certificates=2023.5.7=hf0a4a13_0
cairo=1.16.0=h1e71087_1016
cartopy=0.21.1=py310h57af6c4_1
census=0.8.20=pyhd8ed1ab_0
certifi=2023.5.7=pyhd8ed1ab_0
cffi=1.15.1=py310h2399d43_3
cfitsio=4.2.0=h2f961c4_0
charset-normalizer=3.1.0=pyhd8ed1ab_0
click=8.1.3=unix_pyhd8ed1ab_2
click-plugins=1.1.1=py_0
cligj=0.7.2=pyhd8ed1ab_1
comm=0.1.3=pyhd8ed1ab_0
configargparse=1.5.3=pyhd8ed1ab_0
contextily=1.3.0=pyhd8ed1ab_0
contourpy=1.0.7=py310h2887b22_0
curl=8.1.2=h912dcd9_0
cycler=0.11.0=pyhd8ed1ab_0
cykhash=2.0.1=py310h0f1eb42_1
cython=0.29.35=py310h1253130_0
debugpy=1.6.7=py310h0f1eb42_0
decorator=5.1.1=pyhd8ed1ab_0
defusedxml=0.7.1=pyhd8ed1ab_0
entrypoints=0.4=pyhd8ed1ab_0
exceptiongroup=1.1.1=pyhd8ed1ab_0
executing=1.2.0=pyhd8ed1ab_0
expat=2.5.0=hb7217d7_1
fiona=1.9.4=py310h602ed27_0
flask=2.3.2=pyhd8ed1ab_0
flit-core=3.9.0=pyhd8ed1ab_0
folium=0.14.0=pyhd8ed1ab_0
font-ttf-dejavu-sans-mono=2.37=hab24e00_0
font-ttf-inconsolata=3.000=h77eed37_0
font-ttf-source-code-pro=2.038=h77eed37_0
font-ttf-ubuntu=0.83=hab24e00_0
fontconfig=2.14.2=h82840c6_0
fonts-conda-ecosystem=1=0
fonts-conda-forge=1=0
fonttools=4.40.0=py310h2aa6e3c_0
freetype=2.12.1=hd633e50_1
freexl=1.0.6=h1a8c8d9_1
future=0.18.3=pyhd8ed1ab_0
gdal=3.7.0=py310hb912514_1
geodatasets=2023.3.0=pyhd8ed1ab_0
geographiclib=1.52=pyhd8ed1ab_0
geopandas=0.13.2=pyhd8ed1ab_1
geopandas-base=0.13.2=pyha770c72_1
geoplot=0.5.1=pyhd8ed1ab_0
geopy=2.3.0=pyhd8ed1ab_0
geos=3.11.2=hb7217d7_0
geotiff=1.7.1=hea8fa61_8
gettext=0.21.1=h0186832_0
giflib=5.2.1=h1a8c8d9_3
h3=3.7.6=pypi_0
hdf4=4.2.15=h8111dcc_6
hdf5=1.14.0=nompi_h6b85c65_103
icu=72.1=he12128b_0
idna=3.4=pyhd8ed1ab_0
importlib-metadata=6.6.0=pyha770c72_0
importlib_metadata=6.6.0=hd8ed1ab_0
importlib_resources=5.12.0=pyhd8ed1ab_0
ipykernel=6.23.1=pyh736e0ef_0
ipython=8.14.0=pyhd1c38e8_0
ipython_genutils=0.2.0=py_1
ipywidgets=8.0.6=pyhd8ed1ab_0
itsdangerous=2.1.2=pyhd8ed1ab_0
jedi=0.18.2=pyhd8ed1ab_0
jellyfish=0.11.2=pypi_0
jinja2=3.1.2=pyhd8ed1ab_1
joblib=1.2.0=pyhd8ed1ab_0
jpype1=1.4.1=py310h2887b22_1
json-c=0.16=hc449e50_0
jsonschema=4.17.3=pyhd8ed1ab_0
jupyter=1.0.0=py310hbe9552e_8
jupyter_client=8.2.0=pyhd8ed1ab_0
jupyter_console=6.6.3=pyhd8ed1ab_0
jupyter_core=5.3.0=py310hbe9552e_0
jupyter_events=0.6.3=pyhd8ed1ab_0
jupyter_server=2.6.0=pyhd8ed1ab_0
jupyter_server_terminals=0.4.4=pyhd8ed1ab_1
jupyterlab_pygments=0.2.2=pyhd8ed1ab_0
jupyterlab_widgets=3.0.7=pyhd8ed1ab_1
kealib=1.5.1=hc851fbe_3
kiwisolver=1.4.4=py310h2887b22_1
krb5=1.20.1=h69eda48_0
lcms2=2.15=hd835a16_1
lerc=4.0.0=h9a09cb3_0
libaec=1.0.6=hb7217d7_1
libarchive=3.6.2=h82b9b87_1
libblas=3.9.0=17_osxarm64_openblas
libbrotlicommon=1.0.9=h1a8c8d9_8
libbrotlidec=1.0.9=h1a8c8d9_8
libbrotlienc=1.0.9=h1a8c8d9_8
libcblas=3.9.0=17_osxarm64_openblas
libcurl=8.1.2=h912dcd9_0
libcxx=16.0.5=h4653b0c_0
libdeflate=1.18=h1a8c8d9_0
libedit=3.1.20191231=hc8eb9b7_2
libev=4.33=h642e427_1
libexpat=2.5.0=hb7217d7_1
libffi=3.4.2=h3422bc3_5
libgdal=3.7.0=h33c4f09_1
libgfortran=5.0.0=12_2_0_hd922786_31
libgfortran5=12.2.0=h0eea778_31
libglib=2.76.3=h24e9cb9_0
libiconv=1.17=he4db4b2_0
libjpeg-turbo=2.1.5.1=h1a8c8d9_0
libkml=1.3.0=h41464e4_1015
liblapack=3.9.0=17_osxarm64_openblas
libnetcdf=4.9.2=nompi_h0a2dbf5_105
libnghttp2=1.52.0=hae82a92_0
libopenblas=0.3.23=openmp_hc731615_0
libpng=1.6.39=h76d750c_0
libpq=15.3=h7126958_1
librttopo=1.1.0=h6ecf6d2_13
libsodium=1.0.18=h27ca646_1
libspatialindex=1.9.3=hbdafb3b_4
libspatialite=5.0.1=h229630b_26
libsqlite=3.42.0=hb31c410_0
libssh2=1.11.0=h7a5bd25_0
libtiff=4.5.0=h4f7d55c_6
libwebp-base=1.3.0=h1a8c8d9_0
libxcb=1.15=hf346824_0
libxml2=2.11.4=he3bdae6_0
libzip=1.9.2=h76ab92c_1
libzlib=1.2.13=h53f4e23_5
llvm-openmp=16.0.5=h1c12783_0
lz4-c=1.9.4=hb7217d7_0
lzo=2.10=h642e427_1000
mapclassify=2.5.0=pyhd8ed1ab_1
markupsafe=2.1.3=py310h2aa6e3c_0
matplotlib-base=3.7.1=py310h78c5c2f_0
matplotlib-inline=0.1.6=pyhd8ed1ab_0
mercantile=1.2.1=pyhd8ed1ab_0
mistune=2.0.5=pyhd8ed1ab_0
munch=3.0.0=pyhd8ed1ab_0
munkres=1.1.4=pyh9f0ad1d_0
nbclassic=1.0.0=pyhb4ecaf3_1
nbclient=0.8.0=pyhd8ed1ab_0
nbconvert=7.4.0=pyhd8ed1ab_0
nbconvert-core=7.4.0=pyhd8ed1ab_0
nbconvert-pandoc=7.4.0=pyhd8ed1ab_0
nbformat=5.9.0=pyhd8ed1ab_0
ncurses=6.4=h7ea286d_0
nest-asyncio=1.5.6=pyhd8ed1ab_0
networkx=3.1=pyhd8ed1ab_0
notebook=6.5.4=pyha770c72_0
notebook-shim=0.2.3=pyhd8ed1ab_0
nspr=4.35=hb7217d7_0
nss=3.89=h789eff7_0
numpy=1.24.3=py310haa1e00c_0
openjpeg=2.5.0=hbc2ba62_2
openssl=3.1.1=h53f4e23_1
osmnx=1.4.0=pyhd8ed1ab_0
overrides=7.3.1=pyhd8ed1ab_0
packaging=23.1=pyhd8ed1ab_0
pandas=2.0.2=py310h1cdf563_0
pandoc=2.19.2=hce30654_2
pandocfilters=1.5.0=pyhd8ed1ab_0
parso=0.8.3=pyhd8ed1ab_0
pcre2=10.40=hb34f9b4_0
pexpect=4.8.0=pyh1a96a4e_2
pickleshare=0.7.5=py_1003
pillow=9.5.0=py310h60ecbdf_1
pip=23.1.2=pyhd8ed1ab_0
pixman=0.40.0=h27ca646_0
pkgutil-resolve-name=1.3.10=pyhd8ed1ab_0
platformdirs=3.5.3=pyhd8ed1ab_0
pooch=1.7.0=pyha770c72_3
poppler=23.05.0=h16d8c84_1
poppler-data=0.4.12=hd8ed1ab_0
postgresql=15.3=hb5ad9d5_1
proj=9.2.0=h13f728c_0
prometheus_client=0.17.0=pyhd8ed1ab_0
prompt-toolkit=3.0.38=pyha770c72_0
prompt_toolkit=3.0.38=hd8ed1ab_0
psutil=5.9.5=py310h8e9501a_0
pthread-stubs=0.4=h27ca646_1001
ptyprocess=0.7.0=pyhd3deb0d_0
pure_eval=0.2.2=pyhd8ed1ab_0
pycparser=2.21=pyhd8ed1ab_0
pygeos=0.14=py310h605c0e7_1
pygments=2.15.1=pyhd8ed1ab_0
pyobjc-core=9.2=py310hd07e440_0
pyobjc-framework-cocoa=9.2=py310hd07e440_0
pyparsing=3.0.9=pyhd8ed1ab_0
pyproj=3.5.0=py310h45dcc9d_1
pyrobuf=0.9.3=py310h0f1eb42_5
pyrosm=0.6.1=py310h1105856_1
pyrsistent=0.19.3=py310h8e9501a_0
pyshp=2.3.1=pyhd8ed1ab_0
pysocks=1.7.1=pyha2e5f31_6
python=3.10.11=h3ba56d0_0_cpython
python-dateutil=2.8.2=pyhd8ed1ab_0
python-fastjsonschema=2.17.1=pyhd8ed1ab_0
python-json-logger=2.0.7=pyhd8ed1ab_0
python-rapidjson=1.10=py310h0f1eb42_0
python-tzdata=2023.3=pyhd8ed1ab_0
python_abi=3.10=3_cp310
pytz=2023.3=pyhd8ed1ab_0
pyyaml=6.0=py310h8e9501a_5
pyzmq=25.1.0=py310h30b7201_0
r5py=0.0.4=pyhd8ed1ab_1
rasterio=1.3.7=py310hc2f3cf7_1
readline=8.2=h92ec313_1
requests=2.31.0=pyhd8ed1ab_0
rfc3339-validator=0.1.4=pyhd8ed1ab_0
rfc3986-validator=0.1.1=pyh9f0ad1d_0
rtree=1.0.1=py310ha3239f5_1
scikit-learn=1.2.2=py310h02d4e2a_2
scipy=1.10.1=py310h0975f3d_3
seaborn-base=0.12.2=pyhd8ed1ab_0
send2trash=1.8.2=pyhd1c38e8_0
setuptools=67.7.2=pyhd8ed1ab_0
shapely=2.0.1=py310h605c0e7_1
six=1.16.0=pyh6c4a22f_0
snappy=1.1.10=h17c5cce_0
sniffio=1.3.0=pyhd8ed1ab_0
snuggs=1.4.7=py_0
sodapy=2.2.0=pypi_0
soupsieve=2.3.2.post1=pyhd8ed1ab_0
sqlite=3.42.0=h203b68d_0
stack_data=0.6.2=pyhd8ed1ab_0
terminado=0.17.1=pyhd1c38e8_0
threadpoolctl=3.1.0=pyh8a188c0_0
tiledb=2.13.2=h9bd36d0_0
tinycss2=1.2.1=pyhd8ed1ab_0
tk=8.6.12=he1e0b03_0
tornado=6.3.2=py310h2aa6e3c_0
tqdm=4.65.0=pypi_0
traitlets=5.9.0=pyhd8ed1ab_0
typing-extensions=4.6.3=hd8ed1ab_0
typing_extensions=4.6.3=pyha770c72_0
typing_utils=0.1.0=pyhd8ed1ab_0
tzcode=2023c=h1a8c8d9_0
tzdata=2023c=h71feb2d_0
unicodedata2=15.0.0=py310h8e9501a_0
urllib3=2.0.3=pyhd8ed1ab_0
us=3.1.1=pypi_0
wcwidth=0.2.6=pyhd8ed1ab_0
webencodings=0.5.1=py_1
websocket-client=1.5.3=pyhd8ed1ab_0
werkzeug=2.3.6=pyhd8ed1ab_0
wheel=0.40.0=pyhd8ed1ab_0
widgetsnbextension=4.0.7=pyhd8ed1ab_0
xerces-c=3.2.4=h68f8447_2
xorg-libxau=1.0.11=hb547adb_0
xorg-libxdmcp=1.1.3=h27ca646_0
xyzservices=2023.5.0=pyhd8ed1ab_1
xz=5.2.6=h57fd34a_0
yaml=0.2.5=h3422bc3_2
zeromq=4.3.4=hbdafb3b_1
zipp=3.15.0=pyhd8ed1ab_0
zlib=1.2.13=h53f4e23_5
zstd=1.5.2=hf913c23_6

additional context
I get hundreds of this warning when ever I run the calculation

self._regional_task.fromLat = origin.y
/opt/homebrew/Caskroom/miniconda/base/envs/rarearth/lib/python3.10/site-packages/r5py/r5/regional_task.py:395: FutureWarning: Calling float on a single element Series is deprecated and will raise a TypeError in the future. Use float(ser.iloc[0]) instead
@christophfink
Copy link
Member

Hi!
Thanks for the bug report. There have been extensive changes to the code base of R5py over the last months. Could you try whether the issue persists on the current development version? You can install the latest git main branch using pip:

pip install git+https://github.com/r5py/r5py.git

@christophfink christophfink added bug Something isn't working feedback Further information is requested labels Jul 6, 2023
@christophfink
Copy link
Member

@rarearth have you had the chance to test the development branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feedback Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants