equinor / webviz-config

Make Dash applications from a user-friendly config file :book: :snake:
https://github.com/orgs/equinor/projects/24
MIT License
54 stars 39 forks source link

General container settings #160

Closed anders-kiaer closed 4 years ago

anders-kiaer commented 4 years ago

webviz-config has, in the configuration file, a dictionary called container_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 of container_settings:

anders-kiaer commented 4 years ago

This is related to, and inspired by, https://github.com/equinor/webviz-subsurface/issues/128.

anders-kiaer commented 4 years ago

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?

HansKallekleiv commented 4 years ago

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 👍