GeoDaCenter / spatial_access

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

Handling of 'optional' fields in source data sets #77

Open gyoliver opened 5 years ago

gyoliver commented 5 years ago

Issue: The BaseModel method "reload_sources" requires that you pass in "skip" for the source dataset's population field when instantiating any model, even those models do not require population data (i.e., AccessModel, AccessCount, AccessTime, and AccessSum).

Similarly, the BaseModel method "reload_dests" makes the same requirement for a capacity field in the destination dataset, while AccessModel, AccessCount, AccessTime don't require capacity data.

If you don't pass in "skip" for these fields, the code throws an error. I think users will go on the assumption that you only have to pass in/deal with fields that are required for a model, so this could be confusing. It took me a while to pinpoint what the issue was. Debugging is also confusing since (as of v0.1.10), the errors thrown are quite general--SourceDataNotParsableException and DestDataNotParsableException.

The lines in v0.1.17 triggering the error are:

Recommended modifications: Could we modify the logic so it doesn't require passing in "skip" for these fields? Also, it'd be good to replace the "skip" value with None and/or blank string.