ActivitySim / activitysim

An Open Platform for Activity-Based Travel Modeling
https://activitysim.github.io
BSD 3-Clause "New" or "Revised" License
189 stars 96 forks source link

los.py expecting number of TAZs in land use to match length of skim index #837

Open aletzdy opened 3 months ago

aletzdy commented 3 months ago

The current beta release of ActivitySim expects the length of TAZs in the land use data to match the length of skim indices. This can cause a crash if the skims include external stations, but the land use data only contains internal zones. This is the case with SEMCOG implementation and might be with other models too.

I am brining this up here so others be aware of it, and we can discuss it if needed.

@JilanChen

i-am-sijia commented 2 months ago

The source code already provides a solution to this issue. See code snippet below. When the TAZs in the land use data mismatch the skims (which is reasonable as you said re: externals), Users can specify a land_use_taz table in the input_table_list in settings.yaml. The land_use_taz just need to have a TAZ column including all the TAZs in skims, increasing monotonically, see example here.

https://github.com/ActivitySim/activitysim/blob/739c2e428856eb401b42e95cedf9fd88bfcb02c6/activitysim/abm/tables/landuse.py#L50-L61