activitysim icon indicating copy to clipboard operation
activitysim copied to clipboard

Skim offset hardwired to -1

Open mattwigway opened this issue 4 years ago • 1 comments
trafficstars

On the develop2 branch, the skim offset is hardwired to -1 on Line 185 of skim_dictionary.py:

            # assume this is a one-based skim map
            offset_mapper.set_offset_int(-1)

This causes activitysim to fail when run with 0-based TAZ input data. Workaround for now is to add a mapping to the skims file that is just the output of np.arange(n_zones). This may be the issue underlying #388 as well.

mattwigway avatar Mar 10 '21 01:03 mattwigway

Yes, activitysim assumes that any omx that has no mapentries (as returned by listMappings) has skim offset of -1.

We might consider allowing the skim offset to be specified in the netwoek_los.yaml config file - but this leads to a somewhat inelegant separation of the skim metadata from the skims themselves. And if we do support it, should this be a global setting, or might it differ from file to file.

In the meantime, you can simply add a mapentry array to your skims file. This should not result in a performance hit as activitysim will notice that there is a static offset and assign it (in your case 0) rather than using an offset_series.

toliwaga avatar Mar 15 '21 16:03 toliwaga