pyroll-project / pyroll-core

PyRoll rolling simulation framework - core library.
https://pyroll.readthedocs.io
BSD 3-Clause "New" or "Revised" License
12 stars 7 forks source link

Change Configuration #56

Closed axtimhaus closed 1 year ago

axtimhaus commented 1 year ago

During development of the CLI the need for parsing configuration values for the core and plugins from config.toml and perhaps envvars arose. Module level constants could be altered depending on a heuristic to use all package level constants and such in pyroll.<package>.config modules. But module level constants are error prone regarding imported references, for example one shall always import the config module and not the value itself (from . import config instead of from .config import SOME_VAR).

A static configuration class would be the better approach, since one could not accidentally import the var itself. To facilitate creation of such classes, the following helper classes and decorators are proposed.