aequilibrae.project.Matrices#
- class aequilibrae.project.Matrices(project)[source]#
Gateway into the matrices available/recorded in the model
Methods
__init__
(project)check_exists
(name)Checks whether a matrix with a given name exists
Removes records from the matrices database that do not exist in disk
delete_record
(matrix_name)Deletes a Matrix Record from the model and attempts to remove from disk
get_matrix
(matrix_name)Returns an AequilibraE matrix available in the project
get_record
(matrix_name)Returns a model Matrix Record for manipulation in memory
list
()List of all matrices available
new_record
(name, file_name[, matrix])Creates a new record for a matrix in disk, but does not save it
reload
()Discards all memory matrices in memory and loads recreate them
Adds records to the matrices database for matrix files found on disk
- check_exists(name: str) bool [source]#
Checks whether a matrix with a given name exists
- Returns:
exists (
bool
): Does the matrix exist?
- clear_database() None [source]#
Removes records from the matrices database that do not exist in disk
- delete_record(matrix_name: str) None [source]#
Deletes a Matrix Record from the model and attempts to remove from disk
- get_matrix(matrix_name: str) AequilibraeMatrix [source]#
Returns an AequilibraE matrix available in the project
Raises an error if matrix does not exist
- Arguments:
matrix_name (
str
): Name of the matrix to be loaded- Returns:
matrix (
AequilibraeMatrix
): Matrix object
- get_record(matrix_name: str) MatrixRecord [source]#
Returns a model Matrix Record for manipulation in memory
- list() DataFrame [source]#
List of all matrices available
- Returns:
df (
pd.DataFrame
): Pandas DataFrame listing all matrices available in the model
- new_record(name: str, file_name: str, matrix=None) MatrixRecord [source]#
Creates a new record for a matrix in disk, but does not save it
If the matrix file is not already on disk, it will fail
- Arguments:
name (
str
): Name of the matrixfile_name (
str
): Name of the file on disk- Returns:
matrix_record (
MatrixRecord
): A matrix record that can be manipulated in memory before saving