MatricesBase#
- class caf.mat.matrices.MatricesBase(segmentation_, zoning, type_)[source]#
Bases:
ABCAbstract base class for handling matrices split by segmentation.
- Parameters:
segmentation – Segmentation for the matrices.
zoning (ZoningSystem) – ZoningSystem for all the matrices.
type (MatrixType) – Type of the matrices.
segmentation_ (Segmentation)
type_ (MatrixType)
Attributes
Return True if the segmentation contains time periods.
Return True if segmentation contains correct direction segment.
Return True if segmentation contains home-based direction only.
Return True if segmentation contains non-home-based direction only.
Name of the matrices.
Copy of the matrix segmentation.
Type of matrix, either PA or OD.
Copy of the matrix zoning system.
Methods
__init__(segmentation_, zoning, type_)aggregate(segmentation_[, output_name, ...])Aggregate matrices to target segmentation.
disaggregate(targets[, from_segment, ...])Disaggregate matrices to a target segmentation.
exists()Check if matrices exist for all slices.
get_matrix(slice_)Load the data for a single matrix.
new(name, *[, segmentation_, zoning, type_])Create a new instance of the matrices class with a new name.
set_matrix(matrix, slice_)Save the data for a single matrix.
validate_matrix(matrix[, name])Validate the matrix zoning is correct.
validate_slice(slice_)Raise ValueError if slice not present in segmentation.
Attributes Documentation
- has_time_periods#
Return True if the segmentation contains time periods.
- has_type_segment#
Return True if segmentation contains correct direction segment.
- is_home_based_only#
Return True if segmentation contains home-based direction only.
- is_non_home_based_only#
Return True if segmentation contains non-home-based direction only.
- name#
Name of the matrices.
- segmentation#
Copy of the matrix segmentation.
- type#
Type of matrix, either PA or OD.
- zoning#
Copy of the matrix zoning system.