Closed anders-kiaer closed 4 years ago
This is related to, and inspired by, https://github.com/equinor/webviz-subsurface/issues/128.
Since the nature of container_settings
is common settings shared between containers, I don't think it makes sense to create a "subscribe to container settings" method in the containers (as that would require duplication of code).
Maybe instead on package level (e.g. webviz-subsurface
) there could be a decorated function which registers which settings that package might want to use, together with corresponding types, and potentially also functions that should be called for simple error checks (like "does this path exist"?)
Thoughts @HansKallekleiv?
Sounds good! If it is possible as you say to have a function at package level that provides the settings and types that would be very flexible and useful 👍
webviz-config
has, in the configuration file, a dictionary calledcontainer_settings
which are there for the user to set general configurations, shared between multiple containers.The individual containers can ask for this dictionary, and take out the values they need (for a given predefined key). However - it would be useful if
webviz-config
had somewhat more knowledge about the structure ofcontainer_settings
:webviz-config
knows the types of the different elements going in, it can do transformations (e.g. go from a string being a path relative to the configuration file, to an absolutePath
instance).containers_settings
, they can do that early in the app startup process.webviz-config
can potentially detect conflicts between different third-party containers requesting and (re)defining the same key incontainer_settings
.