iduedu.TransportRegistry¶
- class iduedu.TransportRegistry(specs=None)[source]¶
Registry of available public-transport modes and their specifications.
The registry stores
TransportSpecobjects indexed by normalized transport type names (lowercase). It provides utilities for validating transport types, updating parameters, and ensuring that unknown types encountered during parsing are assigned reasonable defaults.The registry is used throughout graph construction to compute per-edge travel times consistently across different transport modes.
- Parameters:
specs (dict[str, TransportSpec] | None)
- __init__(specs=None)[source]¶
Initialize the registry with optional transport specifications.
- Parameters:
specs (dict[str, TransportSpec] | None)
Methods
__init__([specs])Initialize the registry with optional transport specifications.
add(spec, *[, overwrite])Add a transport specification to the registry.
ensure(name, *[, defaults])Return an existing spec or create one from defaults.
get(name)Return a transport specification by name.
list_types()Return registered transport type names.
remove(name)Remove a transport specification by name.
try_get(name)Return a transport specification, or
Noneif it is unknown.update(transport_type, **fields)Update fields of an existing transport specification.