reVReports.configs.Config#

class Config(*, tech: str, scenarios: list[SupplyCurveScenario] = [], plots: Plots = Plots(site_lcoe_max=70, total_lcoe_max=100), map_vars: list[MapVar] = [], exclude_maps: list[str] = [], map_layout: str = 'horizontal', lcoe_site_col: str = 'lcoe_site_usd_per_mwh', lcoe_all_in_col: str = 'lcoe_all_in_usd_per_mwh', cf_col: str = None, prefix_outputs: bool = False)[source]#

Bases: BaseModelStrict

Configuration settings for creating plots

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Methods

default_scenario_colors(value)

Set default colors for scenarios

from_json(json_path)

Load configuration from a JSON file.

valid_map_layout(value)

Check that the input value for map_layout is valid

valid_tech(value)

Check that the input value for tech is valid

Attributes

scenario_palette

Get a dictionary mapping scenario names to colors.

tech

Technology type (e.g. 'wind', 'osw', 'pv', 'geo').

scenarios

List of supply curve scenarios to include in plots

plots

Plot settings (see Plots)

map_vars

List of mapping variable settings (see MapVar)

exclude_maps

List of mapping variables to exclude from mapping

map_layout

Map layout for scenario grids (horizontal or vertical)

lcoe_site_col

Column name for site LCOE values (in USD/MWh)

lcoe_all_in_col

Column name for total LCOE values (in USD/MWh)

cf_col

Column name for capacity factor values (if applicable)

prefix_outputs

Optional prefix to add to output filenames (e.g. 'map_').

tech: str#

Technology type (e.g. ‘wind’, ‘osw’, ‘pv’, ‘geo’)

scenarios: list[SupplyCurveScenario]#

List of supply curve scenarios to include in plots

plots: Plots#

Plot settings (see Plots)

map_vars: list[MapVar]#

List of mapping variable settings (see MapVar)

exclude_maps: list[str]#

List of mapping variables to exclude from mapping

map_layout: str#

Map layout for scenario grids (horizontal or vertical)

lcoe_site_col: str#

Column name for site LCOE values (in USD/MWh)

lcoe_all_in_col: str#

Column name for total LCOE values (in USD/MWh)

cf_col: str#

Column name for capacity factor values (if applicable)

prefix_outputs: bool#

Optional prefix to add to output filenames (e.g. 'map_')

classmethod default_scenario_colors(value)[source]#

Set default colors for scenarios

If input scenarios do not have a color set, this function sets them to values from the tab10 colormap. This is handled at the Config level rather than the SupplyCurveScenario level so that the colormap can be incremented for each scenario.

Parameters:

value (list) – List of SupplyCurveScenario models.

Returns:

list – List of SupplyCurveScenarios with default colors set, if needed.

classmethod valid_tech(value)[source]#

Check that the input value for tech is valid

Parameters:

value (str) – Input value for ‘tech’

Returns:

str – Returns the input value (as long as it is one of the valid options)

Raises:

reVReportsValueError – A reVReportsValueError will be raised if the input value is not a valid option.

classmethod valid_map_layout(value)[source]#

Check that the input value for map_layout is valid

Parameters:

value (str) – Input value for ‘map_layout’

Returns:

str – Returns the input value (as long as it is one of the valid options)

Raises:

reVReportsValueError – A reVReportsValueError will be raised if the input value is not a valid option.

classmethod from_json(json_path)[source]#

Load configuration from a JSON file.

Parameters:

json_path (path-like) – Path to JSON file containing input settings.

Returns:

Config – Configuration settings.

property scenario_palette[source]#

Get a dictionary mapping scenario names to colors.

Returns:

dict – Dictionary mapping scenario names to colors.