worldbank / GOSTnetsraster

Calculating market access using raster surfaces of friction or travel time
MIT License
6 stars 5 forks source link

TypeError: generate_feature_vectors() missing 1 required positional argument: 'featIdx' #3

Closed ajuang closed 4 months ago

ajuang commented 2 years ago

TypeError Traceback (most recent call last) in () 1 drive_time_thresholds = [60, 120, 180, 240] # minutes ----> 2 drive_vectors = ma.generate_feature_vectors(inR, mcp, inD, drive_time_thresholds) 3 drive_vectors.to_file(os.path.join('/content/drive/Shareddrives/Applied Data Science/Engagements/Stanford Community Health Resilience Project/Travel Time/drive_vectors.shp'))

TypeError: generate_feature_vectors() missing 1 required positional argument: 'featIdx'

I am getting this error when trying to generate drive time vectors

chapmanjacobd commented 2 years ago

In the function documentation they say they are using tempID for default but they don't set featIdx as a kwarg.

https://github.com/worldbank/GOSTNets_Raster/blob/ec96520b3d4e7d7f4b2c8d0a17016d696af3d100/src/GOSTNetsRaster/market_access.py#L168

so you'll need to add the name of the column like this:

drive_vectors = ma.generate_feature_vectors(inR, mcp, inD, drive_time_thresholds, 'tempID')