Skip to content

Model configuration schema

Calliope configuration class.

  • init (object): All configuration options used when initialising a Calliope model. Cannot contain additional properties.

    • name: Model name. Default: null.

      • Any of

        • string

        • null

    • calliope_version: Calliope framework version this model is intended for. Default: null.

      • Any of

        • string

        • null

    • broadcast_param_data (boolean): If True, single data entries in YAML indexed parameters will be broadcast across all index items. Otherwise, the number of data entries needs to match the number of index items. Defaults to False to mitigate unexpected broadcasting when applying overrides. Default: false.

    • time_subset: Subset of timesteps as an two-element list giving the inclusive range. For example, ["2005-01", "2005-04"] will create a time subset from "2005-01-01 00:00:00" to "2005-04-31 23:59:59".
      Strings must be ISO8601-compatible, i.e. of the form YYYY-mm-dd HH:MM:SS (e.g, '2005-01 ', '2005-01-01', '2005-01-01 00:00', ...). Default: null.

      • Any of

        • array: Length must be equal to 2.

        • null

    • time_resample: Setting to adjust time resolution, e.g. '2h' for 2-hourly. Default: null.

      • Any of

        • string

        • null

    • time_cluster: Setting to cluster the timeseries. Must be a path to a file where each date is linked to a representative date that also exists in the timeseries. Default: null.

      • Any of

        • string

        • null

    • time_format (string): Timestamp format of all time series data when read from file. 'ISO8601' means '%Y-%m-%d %H:%M:%S'. Default: "ISO8601".

    • distance_unit (string): Unit of transmission link distance (m - metres, km - kilometres). Automatically derived distances from lat/lon coordinates will be given in this unit. Must be one of: ["km", "m"]. Default: "km".

  • build (object): Base configuration options used when building a Calliope optimisation problem (calliope.Model.build). Cannot contain additional properties.

    • mode (string): Mode in which to run the optimisation. Must be one of: ["plan", "operate", "spores"]. Default: "plan".

    • add_math (array): List of references to files which contain additional mathematical formulations to be applied on top of or instead of the base mode math. If referring to an pre-defined Calliope math file (see documentation for available files), do not append the reference with ".yaml". If referring to your own math file, ensure the file type is given as a suffix (".yaml" or ".yml"). Relative paths will be assumed to be relative to the model definition file given when creating a calliope Model (calliope.Model(model_definition=...)). Default: [].

      • Items (string)
    • ignore_mode_math (boolean): If True, do not initialise the mathematical formulation with the pre-defined math for the given run mode. This option can be used to completely re-define the Calliope mathematical formulation. Default: false.

    • backend (string): Module with which to build the optimisation problem. Must be one of: ["pyomo", "gurobi"]. Default: "pyomo".

    • ensure_feasibility (boolean): Whether to include decision variables in the model which will meet unmet demand or consume unused supply in the model so that the optimisation solves successfully. This should only be used as a debugging option (as any unmet demand/unused supply is a sign of improper model formulation). Default: false.

    • objective (string): Name of internal objective function to use, from those defined in the pre-defined math and any applied additional math. Default: "min_cost_optimisation".

    • pre_validate_math_strings (boolean): If true, the Calliope math definition will be scanned for parsing errors before undertaking the much more expensive operation of building the optimisation problem. You can switch this off (e.g., if you know there are no parsing errors) to reduce overall build time. Default: true.

    • operate (object): Operate mode configuration options used when building a Calliope optimisation problem (calliope.Model.build). Cannot contain additional properties.

      • window (string): Operate mode rolling window, given as a pandas frequency string. See here for a list of frequency aliases. Default: "24h".

      • horizon (string): Operate mode rolling horizon, given as a pandas frequency string. See here for a list of frequency aliases. Must be ≥ window. Default: "48h".

      • use_cap_results (boolean): If the model already contains plan mode results, use those optimal capacities as input parameters to the operate mode run. Default: false.

  • solve (object): Base configuration options used when solving a Calliope optimisation problem (calliope.Model.solve). Cannot contain additional properties.

    • save_logs: If given, should be a path to a directory in which to save optimisation logs. Default: null.

      • Any of

        • string

        • null

    • solver_io: Some solvers have different interfaces that perform differently. For instance, setting solver_io="python" when using the solver gurobi tends to reduce the time to send the optimisation problem to the solver. Default: null.

      • Any of

        • string

        • null

    • solver_options (object): Any solver options, as key-value pairs, to pass to the chosen solver. Default: {}.

    • solver (string): Solver to use. Any solvers that have Pyomo interfaces can be used. Refer to the Pyomo documentation for the latest list. Default: "cbc".

    • zero_threshold (number): On postprocessing the optimisation results, values smaller than this threshold will be considered as optimisation artefacts and will be set to zero. Default: 1e-10.

    • shadow_prices (array): Names of model constraints. Default: [].

      • Items (string)
    • spores (object): SPORES configuration options used when solving a Calliope optimisation problem (calliope.Model.solve). Cannot contain additional properties.

      • number (integer): SPORES mode number of iterations after the initial base run. Default: 3.

      • score_cost_class (string): SPORES mode cost class to vary between iterations after the initial base run. Default: "score".

      • slack_cost_group (string): SPORES mode cost class to keep below the given slack (usually "monetary"). Default: "monetary".

      • save_per_spore (boolean): Whether or not to save the result of each SPORES mode run between iterations. If False, will consolidate all iterations into one dataset after completion of N iterations (defined by number) and save that one dataset. Default: false.

      • save_per_spore_path: If saving per spore, the path to save to. Default: null.

        • Any of

          • string

          • null

      • skip_cost_op (boolean): If the model already contains plan mode results, use those as the initial base run results and start with SPORES iterations immediately. Default: false.