message_ix_models.tools.iea.web.IEA_EWEB

class message_ix_models.tools.iea.web.IEA_EWEB(source, source_kw)[source]

Bases: ExoDataSource

Provider of exogenous data from the IEA Extended World Energy Balances.

To use data from this source, call exo_data.prepare_computer() with the source_kw:

  • “provider”: Either “IEA” or “OECD”. See FILES.

  • “edition”: one of “2021”, “2022”, or “2023”. See FILES.

  • “product”: str or list of str.

  • “flow”: str or list of str.

The returned data have the extra dimensions “product” and “flow”, and are not aggregated by year.

Example

>>> keys = prepare_computer(
...     context,
...     computer,
...     source="IEA_EWEB",
...     source_kw=dict(
...         provider="OECD", edition="2022", product="CHARCOAL", flow="RESIDENT"
...     ),
... )
>>> result = computer.get(keys[0])
__init__(source, source_kw)[source]

Initialize the data source.

Methods

__init__(source, source_kw)

Initialize the data source.

raise_on_extra_kw(kwargs)

Helper for subclasses to handle the source_kw argument.

transform(c, base_key)

Aggregate only; do not interpolate on "y".

Attributes

aggregate

True if transform() should aggregate data on the \(n\) dimension.

extra_dims

Optional additional dimensions for the returned Key/Quantity.

id

Identifier for this particular source.

interpolate

True if transform() should interpolate data on the \(y\) dimension.

name

Optional name for the returned Key/Quantity.

aggregate: bool = True

True if transform() should aggregate data on the \(n\) dimension.

extra_dims: Tuple[str, ...] = ('product', 'flow')

Optional additional dimensions for the returned Key/Quantity. If not set by __init__(), the dimensions are \((n, y)\).

id: str = 'IEA_EWEB'

Identifier for this particular source.

interpolate: bool = True

True if transform() should interpolate data on the \(y\) dimension.

name: str = ''

Optional name for the returned Key/Quantity. If not set by __init__(), then the “measure” keyword is used.

raise_on_extra_kw(kwargs) None

Helper for subclasses to handle the source_kw argument.

  1. Store aggregate and interpolate, if they remain in kwargs.

  2. Raise ValueError if there are any other, unhandled keyword arguments in kwargs.

transform(c: genno.Computer, base_key: genno.Key) genno.Key[source]

Aggregate only; do not interpolate on “y”.