vbonvin / POUET

Programming Observations Usefully at Euler Telescope
GNU General Public License v3.0
1 stars 1 forks source link

Global configuration #24

Closed kuntzer closed 6 years ago

kuntzer commented 6 years ago

We currently have some global variables (like the colour choices) and some hard-codded settings (like the validity of weather reports and so). I'd like them better in some settings file in the config directory. However, I don't know what's best:

  1. a settings.py that you can include in every module you want to recover easily the variables, but which introduces a new type of config file;
  2. a settings.cfg file that you'd have to load every time you try to access a setting (or consistently pass the settings as an input variable of the functions/methods). This option could be better as we could dynamically change the preferences (and have only one configuration file format).

I leave this issue open until a good solution is found and implemented - it's not critical though.

vbonvin commented 6 years ago

Global configuration should be loaded only once at startup, otherwise it's not really global anymore. I'd opt for a .cfg file.

as we could dynamically change the preferences

Real "global" parameters - as I see them - are not to be dynamically changed during runtime

2018-02-16 8:12 GMT+01:00 kuntzer notifications@github.com:

We currently have some global variables (like the colour choices) and some hard-codded settings (like the validity of weather reports and so). I'd like them better in some settings file in the config directory. However, I don't know what's best:

  1. a settings.py that you can include in every module you want to recover easily the variables, but which introduces a new type of config file;
  2. a settings.cfg file that you'd have to load every time you try to access a setting (or consistently pass the settings as an input variable of the functions/methods). This option could be better as we could dynamically change the preferences (and have only one configuration file format).

I leave this issue open until a good solution is found and implemented - it's not critical though.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vbonvin/POUET/issues/24, or mute the thread https://github.com/notifications/unsubscribe-auth/ALsZrfNX4Wttoxe20xE3wBiGuYxvFekeks5tVSpbgaJpZM4SH9Gi . {"api_version":"1.0","publisher":{"api_key":" 05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity": {"external_key":"github/vbonvin/POUET","title":" vbonvin/POUET","subtitle":"GitHub repository","main_image_url":" https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88- 11e6-95fc-7290892c7bb5.png","avatar_image_url":"https:// cloud.githubusercontent.com/assets/143418/15842166/ 7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/vbonvin/POUET"}},"updates" :{"snippets":[{"icon":"DESCRIPTION","message":"Global configuration (#24)"}],"action":{"name":"View Issue","url":"https://github. com/vbonvin/POUET/issues/24"}}}

--

Vivien Bonvin Ph.D. in Observational Cosmology Ecole Polytechnique Fédérale de Lausanne (EPFL) - Laboratoire d'Astrophysique http://lastro.epfl.ch/ Observatoire de Sauverny - CH-1290 Versoix - Switzerland

kuntzer commented 6 years ago

Okay, done with settings.cfg in config/, see 7463ded0e09e02f2739c15448ef77e2fe0eb9c91