Reporting / postprocessing provides features for computing derived values from the contents of a ixmp.Scenario, after it has been solved using a model and the solution data has been stored. It is built on the genno package, which has its own, separate documentation. This page provides only API documentation.

Top-level classes and functions

The following top-level objects from genno may also be imported from


Wrapper to print intelligible exception information for Computer.get().

Key(name_or_value[, dims, tag, _fast])

A hashable key for a quantity that includes its dimensionality.


Raised by Computer.add() when the target key exists.


Raised by Computer.add() when a required input key is missing.


alias of AttrSeries


Configure genno globally. additionally defines:

Reporter(*args, **kwargs)

Class for describing and executing computations.

class*args, **kwargs)[source]

Class for describing and executing computations.

A Reporter extends a genno.Computer to postprocess data from one or more ixmp.Scenario objects.

Using the from_scenario(), a Reporter is automatically populated with:

  • Keys that retrieve the data for every ixmp item (parameter, variable, equation, or scalar) available in the Scenario.


Prepare the Reporter to act on scenario.

from_scenario(scenario, **kwargs)

Create a Reporter by introspecting scenario.


Apply filters ex ante (before computations occur).

The Reporter class inherits from Computer the following methods:

add(data, *args, **kwargs)

General-purpose method to add computations.

add_queue(queue[, max_tries, fail])

Add tasks from a list or queue.

add_single(key, *computation[, strict, index])

Add a single computation at key.

apply(generator, *keys, **kwargs)

Add computations by applying generator to keys.

check_keys(*keys[, predicate, action])

Check that keys are in the Computer.

configure([path, fail, config])

Configure the Computer.

describe([key, quiet])

Return a string describing the computations that produce key.


Return the full-dimensionality key for name_or_key.


Execute and return the result of the computation key.

infer_keys(key_or_keys[, dims])

Infer complete key_or_keys.


Return the keys of graph.

visualize(filename[, key, optimize_graph])

Generate an image describing the Computer structure.

write(key, path, **kwargs)

Compute key and write the result directly to path.

The following methods are deprecated; equivalent or better functionality is available through Reporter.add. See the genno documentation for each method for suggested changes/migrations.

add_file(*args, **kwargs)


add_product(*args, **kwargs)


aggregate(qty, tag, dims_or_groups[, ...])


convert_pyam(*args, **kwargs)


disaggregate(qty, new_dim[, method, args])


finalize(scenario: Scenario) None[source]

Prepare the Reporter to act on scenario.

The TimeSeries (thus also Scenario or message_ix.Scenario) object scenario is stored with the key 'scenario'. All subsequent processing will act on data from this Scenario.

classmethod from_scenario(scenario: Scenario, **kwargs) Reporter[source]

Create a Reporter by introspecting scenario.


A Reporter instance containing:

  • A ‘scenario’ key referring to the scenario object.

  • Each parameter, equation, and variable in the scenario.

  • All possible aggregations across different sets of dimensions.

  • Each set in the scenario.

Return type:


set_filters(**filters) None[source]

Apply filters ex ante (before computations occur).

See the description of filters() under Configuration.

Configuration adds handlers for two configuration sections, and modifies the behaviour of one from genno Computer, filters: dict)[source]

Handle the entire filters: config section.

Reporter-specific configuration.

Affects data loaded from a Scenario using data_for_quantity(), which filters the data before any other computation takes place. Filters are stored at Reporter.graph["config"]["filters"].

If no arguments are provided, all filters are cleared. Otherwise, filters is a mapping of str → (list of str or None. Keys are dimension IDs. Values are either lists of allowable labels along the respective dimension or None to clear any existing filters for that dimension.

This configuration can be applied through Reporter.set_filters(); Reporter.configure, or in a configuration file:

  # Exclude a label "x2" on the "x" dimension, etc.
  x: [x1, x3, x4]
  technology: [coal_ppl, wind_ppl]
  # Clear existing filters for the "commodity" dimension
  commodity: null
report.rename_dims(info: dict)[source]

Handle the entire rename_dims: config section.

Reporter-specific configuration.

Affects data loaded from a Scenario using data_for_quantity(). Native dimension names are mapped; in the example below, the dimension “i” is present in the Reporter as “i_renamed” on all quantities/keys in which it appears.

  i: i_renamed
report.units(info: dict)[source]

Handle the entire units: config section.

The only difference from genno.config.units() is that this handler keeps the configuration values stored in Reporter.graph["config"]. This is so that data_for_quantity() can make use of ["units"]["apply"]


Configure genno globally.

Modifies global variables that affect the behaviour of all Computers and operators. Configuration keys loaded from file are superseded by keyword arguments. Messages are logged at level logging.INFO if config contains unhandled sections.

  • path (pathlib.Path, optional) – Path to a configuration file in JSON or YAML format.

  • **config – Configuration keys/sections and values.

This is the same as genno.configure().


More than 30 operators are defined by genno.operator and its compatibility modules including genno.compat.plotnine and genno.compat.sdmx. See the genno documentation for details. defines these additional operators:

data_for_quantity(ix_type, name, column, ...)

Retrieve data from scenario.

from_url(url[, cls])

Return a ixmp.TimeSeries or subclass instance, given its url.

get_ts(ts[, filters, iamc, subannual])

Retrieve timeseries data from ts.

map_as_qty(set_df, full_set)

Convert set_df to a Quantity.

remove_ts(ts[, data, after])

Remove all time series data from ts.

store_ts(scenario, *data[, strict])

Store time series data on scenario.

update_scenario(scenario, *quantities[, params])

Update scenario with computed data from reporting quantities. Literal['equ', 'par', 'var'], name: str, column: Literal['mrg', 'lvl', 'value'], scenario: Scenario, config: Mapping[str, Mapping]) AnyQuantity[source]

Retrieve data from scenario.

  • ix_type – Type of the ixmp object.

  • name (str) – Name of the ixmp object.

  • column – Data to retrieve. ‘mrg’ and ‘lvl’ are valid only for ix_type='equ',and ‘level’ otherwise.

  • scenario (ixmp.Scenario) – Scenario containing data to be retrieved.

  • config – Configuration. The key ‘filters’ may contain a mapping from dimensions to iterables of allowed values along each dimension. The key ‘units’/’apply’ may contain units to apply to the quantity; any such units overwrite existing units, without conversion.


Data for name.

Return type:

Quantity str, cls=<class 'ixmp.core.timeseries.TimeSeries'>) TimeSeries[source]

Return a ixmp.TimeSeries or subclass instance, given its url.


cls (type, optional) – Subclass to instantiate and return; for instance, Scenario. TimeSeries, filters: dict | None = None, iamc: bool = False, subannual: bool | str = 'auto') DataFrame[source]

Retrieve timeseries data from ts.

Corresponds to TimeSeries.timeseries().


filters – Names and values for the region, variable, unit, and year keyword arguments to timeseries(). DataFrame, full_set) AnyQuantity[source]

Convert set_df to a Quantity.

For the MESSAGE sets named cat_* (see Category types and mappings) ixmp.Scenario.set() returns a DataFrame with two columns: the category set (S1) elements and the category member set (S2, also required as the argument full_set) elements.

map_as_qty converts such a DataFrame (set_df) into a Quantity with two dimensions. At the coordinates (s₁, s₂), the value is 1 if s₂ is mapped from s₁; otherwise 0.

A category named ‘all’, containing all elements of full_set, is added automatically.

See also

broadcast_map TimeSeries, data: DataFrame | None = None, after: int | None = None) None[source]

Remove all time series data from ts.

Note that data stored with add_timeseries() using meta=True as a keyword argument cannot be removed using TimeSeries.remove_timeseries(), and thus also not with this operator.

  • data (pandas.DataFrame, optional) – Specific data to be removed. If not given, all time series data is removed.

  • after (int, optional) – If given, only data with year labels equal to or greater than after are removed., *data, strict: bool = False) None[source]

Store time series data on scenario.

The data is stored using add_timeseries(); scenario is checked out and then committed.

Parameters:, *quantities, params=[]) None[source]

Update scenario with computed data from reporting quantities.

  • scenario (Scenario) –

  • quantities (Quantity or pandas.DataFrame) – If DataFrame, must be valid input to Scenario.add_par().

  • params (list of str, optional) – For every element of quantities that is a pd.DataFrame, the element of params at the same index gives the name of the parameter to update.

Utilities Dict[str, str] = {}

Dimensions to rename when extracting raw data from Scenario objects. Mapping from Scenario dimension name -> preferred dimension name.

User code should avoid directly manipulating RENAME_DIMS. Instead, call configure():

# Rename dimension "long_dimension_name" to "ldn"
configure(rename_dims={"long_dimension_name": "ldn"})

As well, importing the variable into the global namespace of another module creates a copy of the dictionary that may become out of sync with other changes. Thus, instead of:

from import RENAME_DIMS

def my_operator(...):
    # Code that references RENAME_DIMS

Do this:

def my_operator(...):
    from import common

    # Code that references common.RENAME_DIMS[source]

Return the list of dimensions for data.

If data is a pandas.DataFrame, its columns are processed; otherwise it must be a list.

RENAME_DIMS is used to rename dimensions., name, scenario)[source]

Return keys for name in scenario.