urbansim
urbansim copied to clipboard
Transition model, preserve index name?
When running transition model, the resulting data frame loses the index name (I'm guessing because of the concat). Is this worth preserving? This would be a simple fix, but not sure if it would break existing implementations.
We came across this too. Our transition model handles it by running these lines after the full_transition()
(for HTM):
orca.get_table("persons").index.name = persons.index.name
orca.get_table("households").index.name = households.index.name
But this should be handled by the urbansim_defaults.utils.full_transition()
function.
Hi @bridwell, thanks for pointing this out. I agree that it should be fixed. It seems unlikely to break anything (and worth doing even if it did).
Is the concat you're referring to the one in transition.py#L468? I'm not sure exactly what's happening there, but it looks like the second DataFrame doesn't have a named index, which would as you say lead to the index name of the main table being dropped.
And probably fixing it at the source would fix urbansim_defaults
too.