caf.toolkit.translation#

Tools to convert numpy/pandas vectors/matrices between different index systems.

In transport, these tools are very useful for translating data between different zoning systems.

Functions

Field(...)

!!! abstract "Usage Documentation"

TypedDict(typename[, fields, total])

A simple typed namespace.

matrix_translation_from_file(matrix_path, ...)

Translate zoning system of matrix CSV file.

model_validator(...)

!!! abstract "Usage Documentation"

numpy_matrix_zone_translation(matrix, ...[, ...])

Efficiently translates a matrix between index systems.

numpy_vector_zone_translation(vector, ...[, ...])

Efficiently translates a vector between index systems.

overload(func)

Decorator for overloaded functions/methods.

pandas_long_matrix_zone_translation(matrix, ...)

Efficiently translates a pandas matrix between index systems.

pandas_matrix_zone_translation(matrix, ...)

Efficiently translates a pandas matrix between index systems.

pandas_vector_zone_translation(...)

Efficiently translate a pandas vector between index systems.

vector_translation_from_file(vector_path, ...)

Translate zoning system of vector CSV file.

Classes

Any(*args, **kwargs)

Special type indicating an unconstrained type.

Collection()

ConfigDict

A TypedDict for configuring Pydantic behaviour.

Sequence()

All the operations on a read-only sequence.

TypeVar(name, *constraints[, bound, ...])

Type variable.

ZoneCorrespondence(vector[, from_col_name, ...])

Container for a pandas based translation.

ZoneCorrespondencePath(path[, ...])

Defines the path and columns to use for a translation.