Bondify / gtfs_functions

Package with useful functions to create geo-spatial visualizations from a GTFS.
MIT License
116 stars 32 forks source link

No versions specified for some dependencies #38

Open willandersson1 opened 11 months ago

willandersson1 commented 11 months ago

Hi, thanks for the great library. I noticed that there are no versions specified for some of the dependencies (pandas, geopandas, numpy). This caused issues for me because my project's requirements installs pandas 1.4.4. I can then install gtfs_functions with no issues, but when I try to run the code I get runtime errors due to gtfs_functions relying on newer syntax of pandas.

For example, with pandas 1.4.4, gtfs_functions 2.1:

from gtfs_functions import Feed
GTFS_PATH = 'https://data.stadt-zuerich.ch/dataset/vbz_fahrplandaten_gtfs/download/2024_google_transit.zip'
feed =  Feed(GTFS_PATH, patterns=False)
concatted_ids_names = feed.stop_times.groupby('trip_id', as_index=False)

produces an error on line 4:

Traceback (most recent call last):
  File XXX, line 4, in <module>
    concatted_ids_names = feed.stop_times.groupby('trip_id', as_index=False)
  File "venv/lib/python3.10/site-packages/gtfs_functions/gtfs_functions.py", line 203, in stop_times
    self._stop_times = self.get_stop_times()
  File "venv/lib/python3.10/site-packages/gtfs_functions/gtfs_functions.py", line 647, in get_stop_times
    trips = self.trips
  File "venv/lib/python3.10/site-packages/gtfs_functions/gtfs_functions.py", line 173, in trips
    self._trips = self.get_trips()
  File "venv/lib/python3.10/site-packages/gtfs_functions/gtfs_functions.py", line 589, in get_trips
    trips = trips.set_index('service_id').join(
  File "venv/lib/python3.10/site-packages/pandas/util/_decorators.py", line 311, in wrapper
    return func(*args, **kwargs)
TypeError: DataFrame.reset_index() got an unexpected keyword argument 'names'

There's no issue if I install the latest version of pandas (or install gtfs_functions before installing pandas).

Thanks for your time!

Bondify commented 10 months ago

hi @willandersson1 , it makes sense. I'll pin specific versions of the packages.