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 thesource_kw
:“provider”: Either “IEA” or “OECD”. See
FILES
.“edition”: one of “2021”, “2022”, or “2023”. See
FILES
.
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])
Methods
__init__
(source, source_kw)Initialize the data source.
get_keys
()Return the target keys for the (1) raw and (2) transformed data.
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
True
iftransform()
should aggregate data on the \(n\) dimension.Optional additional dimensions for the returned
Key
/Quantity
.Identifier for this particular source.
True
iftransform()
should interpolate data on the \(y\) dimension.Key for the returned
Quantity
.name
- aggregate: bool = True
True
iftransform()
should aggregate data on the \(n\) dimension.
- extra_dims: tuple[str, ...] = ()
Optional additional dimensions for the returned
Key
/Quantity
. If not set by__init__()
, the dimensions are \((n, y)\).
- get_keys() tuple[genno.core.key.Key, genno.core.key.Key]
Return the target keys for the (1) raw and (2) transformed data.
Subclasses may override this method to provide different targets keys. In the default implementation, the key for the transformed data is:
key
, if any, orConstructed from:
name
ormeasure
in lower-case.The dimensions \((n, y)\), plus any
extra_dims
.
The key for the raw data is the same, with :attr`.id` as an extra tag.
- interpolate: bool = True
True
iftransform()
should interpolate data on the \(y\) dimension.
- key: Key | None = 'energy:n-y-product-flow:iea'
Key for the returned
Quantity
. Optional. Seeget_keys()
.
- raise_on_extra_kw(kwargs) None
Helper for subclasses to handle the source_kw argument.
Store
aggregate
andinterpolate
, if they remain in kwargs.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”.