message_ix_models.model.transport.build.get_computer

message_ix_models.model.transport.build.get_computer(context: Context, obj: Computer | None = None, *, visualize: bool = True, scenario: Scenario | None = None, options: dict | None = None) Computer[source]

Return a genno.Computer set up for model-building computations.

The returned computer contains:

  • Everything added by add_structure(), add_exogenous_data(), and add_debug().

  • For each module in transport.config.Config.modules, everything added by the prepare_computer() function in that module.

  • “context”: a reference to context.

  • “scenario”: a reference to scenario.

  • “add transport data”: a list of keys which, when computed, causes all data for MESSAGEix-Transport to be computed and added to the “scenario”.

Parameters:
  • obj – If obj is an existing Computer (or subclass, such as :class`.Reporter`), tasks are added the existing tasks in its graph. Otherwise, a new Computer is created and populated.

  • visualize – If True (the default), a file transport/build.svg is written in the local data directory with a visualization of the “add transport data” key.

  • options – Passed to transport.Config.from_context() except if the single key “config” is present: if so, the corresponding value must be an instance of transport.Config, and this is used directly.