GeoDaCenter / spatial_access

https://spatial.uchicago.edu
37 stars 11 forks source link

source_column_names syntax #75

Closed ifarah closed 5 years ago

ifarah commented 5 years ago

If I don't want to type "lat", "lon", "ID" everytime when running the matrices. That's why source_column_names is there, right @lmnoel ?

I'm calling it like this, but I think it's bad syntax since it gives me this error:

w_asym_mat = TransitMatrix(network_type='walk', primary_input='ORIG/tracts_chi.csv', source_column_names={'lon','lat','ID'}, dest_column_names={'lon','lat','ID'}, secondary_input='DEST/nets_ws/chi_nets90.csv', configs=custom_config)

w_asym_mat.process()

TypeError: init() got an unexpected keyword argument 'source_column_names'

lmnoel commented 5 years ago

Close, the arg name for the transit matrix is primary_hints and secondary_hints, not source_column_names and dest_column_nmaes -- Logan Noel University of Chicago '19 Computer Science M.S.

On May 16, 2019, at 11:25, Irene Farah notifications@github.com wrote:

If I don't want to type "lat", "lon", "ID" everytime when running the matrices. That's why source_column_names is there, right @lmnoel https://github.com/lmnoel ?

I'm calling it like this, but I think it's bad syntax since it gives me this error:

w_asym_mat = TransitMatrix(network_type='walk', primary_input='ORIG/tracts_chi.csv', source_column_names={'lon','lat','ID'}, dest_column_names={'lon','lat','ID'}, secondary_input='DEST/nets_ws/chi_nets90.csv', configs=custom_config)

w_asym_mat.process()

TypeError: init() got an unexpected keyword argument 'source_column_names'

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/GeoDaCenter/spatial_access/issues/75?email_source=notifications&email_token=AE533KWSIMG2DYAF6TOYTGDPVWDHLA5CNFSM4HNOGTM2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GUG5DFQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AE533KXK5FWDNRYNP4DPNILPVWDHLANCNFSM4HNOGTMQ.

ifarah commented 5 years ago
Screen Shot 2019-05-16 at 11 46 17 AM
lmnoel commented 5 years ago

You’re passing in a set of the dataset’s column names, as opposed to a dictionary mapping the expected column names to the dataset’s column names.

On Thu, May 16, 2019 at 11:46 Irene Farah notifications@github.com wrote:

[image: Screen Shot 2019-05-16 at 11 46 17 AM] https://user-images.githubusercontent.com/22567155/57871986-479ec080-77d0-11e9-9001-04c787a23480.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/GeoDaCenter/spatial_access/issues/75?email_source=notifications&email_token=AE533KWQ6DC2EBN4UTELR53PVWFXVA5CNFSM4HNOGTM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVSMZYY#issuecomment-493145315, or mute the thread https://github.com/notifications/unsubscribe-auth/AE533KU7LRY66KDK73TG7Y3PVWFXVANCNFSM4HNOGTMQ .

-- Logan Noel University of Chicago Class of 2019 Economics Major | Computer Science Minor lnoel@uchicago.edu

ifarah commented 5 years ago

Perfect! Done!

w_asym_mat = TransitMatrix(network_type='walk', primary_input='ORIG/tracts_chi.csv', primary_hints={'lon': 'lon', 'lat': 'lat', 'idx': 'ID'}, secondary_hints={'lon': 'lon', 'lat': 'lat', 'idx': 'ID'}, secondary_input='DEST/nets_ws/chi_nets90.csv', configs=custom_config)

w_asym_mat.process()