Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

calliope-project/typedconfig

Repository files navigation

NOTE: This code is archived and no longer being worked on

TypedConfig

unittests coverage

TypedConfig provides a set of factory methods and parsers to automatically generate a type system based on a set of rules, which can then be used to validate config files.

Typically config files are relatively simple in terms of the data structures they need to represent. However configuration for scientific software can often require some degree of complexity; sometimes even deeply intertwined with the data!

TypedConfig has been specifically written to meet the needs of the energy modelling framework Calliope, as it often needs to express complex relationships and constraints to configure a run. Since it also relies on external solver libraries, it also needs to pass on various configuration options to these underlying libraries.

The default parser organises information in a hierarchically as a tree. You can specify a ruleset defining the type and validation rules for each key in the tree. A master config type is generated from the ruleset, which can then be used to validate a config file.