message_ix_models.model.transport.config.DataSourceConfig

class message_ix_models.model.transport.config.DataSourceConfig(emissions: str = '1', non_LDV: str = 'IKARUS')[source]

Bases: ConfigHelper

Sources for input data.

__init__(emissions: str = '1', non_LDV: str = 'IKARUS') None[source]

Methods

__init__([emissions, non_LDV])

from_dict(data)

Construct an instance from data with name manipulation.

hexdigest([length])

Return a hex digest that is unique for distinct settings on the instance.

read_file(path[, key])

Update configuration from file.

replace(**kwargs)

Like dataclasses.replace() with name manipulation.

update([arg])

Update attributes in-place.

Attributes

emissions

ID of a dump from a base scenario.

non_LDV

Non-passenger and non-light-duty vehicles.

emissions: str = '1'[source]

ID of a dump from a base scenario.

Type:

Emissions

classmethod from_dict(data: Mapping)[source]

Construct an instance from data with name manipulation.

hexdigest(length: int = -1) str[source]

Return a hex digest that is unique for distinct settings on the instance.

Uses dataclasses.asdict(). This means that if the names of fields defined by a subclass change—including if fields are added or removed—the result will differ. The returned value should be the same across versions of Python.

Returns:

If length is greater than 0, a string of this length; otherwise a 32-character string from blake2s.hexdigest().

Return type:

str

non_LDV: str = 'IKARUS'[source]

Non-passenger and non-light-duty vehicles.

read_file(path: Path, key: str = '') None[source]

Update configuration from file.

Parameters:
  • path – to a .yaml file containing a top-level mapping.

  • key – if given, read data not from the top level of the file, but from a sub- mapping under the top-level key key.

  • optional – if given, read data not from the top level of the file, but from a sub- mapping under the top-level key key.

replace(**kwargs)[source]

Like dataclasses.replace() with name manipulation.

update(arg: Mapping | None = None, **kwargs) None[source]

Update attributes in-place.

Raises:

AttributeError – Any of the kwargs are not fields in the data class.