You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request updates the trip destination model to improve compatibility with the "sharrow" mode by ensuring that all TAZs (Traffic Analysis Zones) are represented in aggregated data structures, even if some TAZs have no associated MAZs (Micro Analysis Zones). This change helps align the model's alternatives with TAZ-based skim matrices, which is particularly important when using the sharrow framework.
Sharrow compatibility and TAZ completeness:
Updated aggregate_size_term_matrix to accept an optional all_tazs parameter, ensuring that the resulting TAZ size term matrix includes all TAZs, filling in zeros for any TAZs without MAZs.
Modified destination_presample to pass the complete set of TAZs to aggregate_size_term_matrix when sharrow is enabled, guaranteeing all TAZs are present in the matrix.
Ensured that the alternatives DataFrame in destination_presample is reindexed to include all TAZs with zero fill when sharrow is active, so that the alternatives vector aligns with the TAZ skim structure.
In writing a unit tests for this PR, I discovered a second problem: for two zone systems, thedtype for imported MAZ-to-MAZ data was not being controlled to match the dtype of the similarly named TAZ-to-TAZ skim, e.g. the MAZ data could be stored as float64 while the TAZ data is stored as float32. This has minor impacts on runtime, but can cause subtle bugs in handling 2-zone skim data with sharrow with the "fastmath" option turned on. This is not the first time that "fastmath" has tripped us up (there is already a note in the documentation about turning it off when finding these exact kinds of errors. It is super hard to diagnose these problems when they do occur so I decided the best course is to change the default on "fastmath" to False. Users can easily turn it back on for individual components when the performance gains are useful.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the trip destination model to improve compatibility with the "sharrow" mode by ensuring that all TAZs (Traffic Analysis Zones) are represented in aggregated data structures, even if some TAZs have no associated MAZs (Micro Analysis Zones). This change helps align the model's alternatives with TAZ-based skim matrices, which is particularly important when using the sharrow framework.
Sharrow compatibility and TAZ completeness:
aggregate_size_term_matrixto accept an optionalall_tazsparameter, ensuring that the resulting TAZ size term matrix includes all TAZs, filling in zeros for any TAZs without MAZs.destination_presampleto pass the complete set of TAZs toaggregate_size_term_matrixwhen sharrow is enabled, guaranteeing all TAZs are present in the matrix.alternativesDataFrame indestination_presampleis reindexed to include all TAZs with zero fill when sharrow is active, so that the alternatives vector aligns with the TAZ skim structure.Closes #1022.