pygcam.gcam

Functions for running the GCAM model. Provides the functionality of the gcam sub-command.

API

pygcam.gcam.getGcamVersion(exeDir, preferPath=False)

Try to get GCAM version by running gcam with –version flag, but if that fails, try to extract it from the path.

pygcam.gcam.runGCAM(mapper: FileMapper, noRun=False, noWrapper=False)
Parameters
  • mapper – (FileMapper) contains file and directory information

  • scenario – (str) the scenario to run

  • group – (str) the name of the scenario group to use

  • configFile – (str) if scenario is not given, the name of a configuration file to run. If scenario is given, this parameter is ignored.

  • noRun – (bool) if True, don’t run the model, just create the sandbox and display the command that would be executed.

  • noWrapper – (bool) if True, don’t run GCAM inside a “wrapper” that reads output and kills the model run as soon as an error is detected.

Returns

none

Raises

ProgramExecutionError – if GCAM exits with non-zero status

pygcam.gcam.setJavaPath(exeDir)

Update the PATH to be able to find the Java dlls. Modeled on run-gcam.bat in the GCAM distribution.