tag module

class tag.Tag(mapping: Mapping[str, object])[source]

Bases: object

A class for adding metadata to the output data in the form of a key to value mapping

Parameters:
mappingMapping[str, object]

The key to value mapping for the tag

Methods

get_dcc_state_tag(dcc_state)

Return a tag indicating the associated data is generated for a DCC state

get_global_tag()

Return a tag indicating the associated data is generated over a whole run

get_key_value()

Return the metadata contained in this tag as (key, value) tuple

get_mapping()

Return the Mapping object holding the metadata

get_module_tag(module)

Return a tag indicating the associated data is generated for a module

get_roadtype_tag(roadtype)

Return a tag indicating the associated data is generated for a roadtype

get_scale_tag(scale)

Return a tag indicating the associated data is scaled by this factor

static get_dcc_state_tag(dcc_state: int)[source]

Return a tag indicating the associated data is generated for a DCC state

Parameters:
dcc_stateint

the DCC state

Returns:
Tag

the tag

static get_global_tag()[source]

Return a tag indicating the associated data is generated over a whole run

Returns:
Tag

the tag

get_key_value() Tuple[str, object][source]

Return the metadata contained in this tag as (key, value) tuple

Returns:
tuple

the encapsulated (key, value) pair

get_mapping() Mapping[str, object][source]

Return the Mapping object holding the metadata

Returns:
Mapping[str, object]

the encapsulated (key, value) mapping

static get_module_tag(module: str)[source]

Return a tag indicating the associated data is generated for a module

Parameters:
modulestr

the module of the input data

Returns:
Tag

the tag

static get_roadtype_tag(roadtype: float)[source]

Return a tag indicating the associated data is generated for a roadtype

Parameters:
roadtypefloat

the roadtype

Returns:
Tag

the tag

static get_scale_tag(scale: float)[source]

Return a tag indicating the associated data is scaled by this factor

Parameters:
scalefloat

the scaling factor

Returns:
Tag

the tag