dwind.config#

Custom configuration data class to allow for dictionary style and dot notation calling of attributes and Enums for validating configuration data.

Classes

ValuesMixin()

Mixin class providing .values() for Enum classes.

CRBModel(value[, names, module, qualname, ...])

Convert between integers and "crb_model" data for efficient storage and retrieval.

Optimization(value[, names, module, ...])

Enum validator for breakeven cost optimization strategies.

Scenario(value[, names, module, qualname, ...])

Enum validator for the scenario to run.

Sector(value[, names, module, qualname, ...])

Enum validator for sector inputs.

Technology(value[, names, module, qualname, ...])

Enum validator for technology inputs.

Year(value[, names, module, qualname, type, ...])

Enum validator for analysis year.

Mapping

Dict-like class that allows for the use of dictionary style attribute calls on class attributes.

Configuration(config, *[, initial])

Configuration class for reading and converting nested dictionaries to allow for both namespace style and dot notation when collecting attributes.

class dwind.config.CRBModel(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Convert between integers and “crb_model” data for efficient storage and retrieval.

static int_map()[source]#

Create a dictionary of int: name for each crb model.

Return type:

dict[str, int]

static model_map()[source]#

Create a dictionary of name: int values for each crb model.

Return type:

dict[str, int]

static str_model_map()[source]#

Create a dictionary of name: str(int) values for each crb model.

Return type:

dict[str, str]

class dwind.config.Configuration(config, *, initial=True)[source]#

Configuration class for reading and converting nested dictionaries to allow for both namespace style and dot notation when collecting attributes.

Customizations of the input data:
  • All fields containing “DIR” will be converted to a pathlib.Path object.

  • All nested data will be able to be called with dot notation and dictionary-style calls.

  • The rev.turbine_class_dict is converted to float data automatically.

  • All data in the [sql] section will get converted to proper constructor strings with the associated username and password data autopopulated with the match {USER} and PASSWORD fields in the same configuration section.

class dwind.config.Mapping[source]#

Dict-like class that allows for the use of dictionary style attribute calls on class attributes.

clear()[source]#

Deletes all entries in __dict__.

copy()[source]#

Returns an unlinked copy of __dict__.

Return type:

dict

items()[source]#

Returns the keys and values of __dict__.

keys()[source]#

Returns the keys of __dict__.

pop(*args)[source]#

Removes and returns the desired argments from __dict__ if they exist.

Parameters:

*args – Variable length argument list.

Returns:

values of __dict__ from keys *args.

Return type:

Any

update(*args, **kwargs)[source]#

Updates the provided args and keyword arguments of __dict__.

Parameters:
  • *args – Variable length argument list.

  • **kwargs – Arbitrary keyword arguments.

values()[source]#

Returns the __dict__ values.

class dwind.config.Optimization(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Enum validator for breakeven cost optimization strategies.

class dwind.config.Scenario(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Enum validator for the scenario to run.

class dwind.config.Sector(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Enum validator for sector inputs.

class dwind.config.Technology(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Enum validator for technology inputs.

class dwind.config.ValuesMixin[source]#

Mixin class providing .values() for Enum classes.

static values()[source]#

Generate a list of the valid input strings.

Return type:

list[str]

class dwind.config.Year(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Enum validator for analysis year.