specless.factory.builder.Builder

class specless.factory.builder.Builder[source]

Bases: object

Implements an abstract generic builder class to use with ObjectFactory

implementation based on https://realpython.com/factory-method-python/

Methods

load_YAML_config_data

reads in the object configuration parameters from a YAML config file

abstract __call__(**kwargs)[source]

Abstract implementation of the constructor for the object to be built.

Parameters:

kwargs (dictionary) – The keywords arguments for the object to be built’s constructor

Returns:

a concrete instance of the object to be built

Return type:

built object’s type

static load_YAML_config_data(config_file_name: str) dict[source]

reads in the object configuration parameters from a YAML config file

Parameters:

config_file_name ((filepath) string) – The YAML configuration file name

Returns:

configuration data dictionary for the simulation

Return type:

dict