Improve user experience in config lodaing #338
Replies: 5 comments
-
I thought this is what we discussed. It anyways reports what it loads, so is transparent in this regard. You can always disable any single config type by passing an empty dictionary (see examples in the processor tests). Config files that are not present are also not loaded, and these names are specific enough to not be there by chance, so a user should be aware if he placed a corresponding file at the respective place, no? |
Beta Was this translation helpful? Give feedback.
-
This mechanism (folder_config) was introduced to allow easy passing of calibration parameters between notebooks. I think it is a good approach, used by the save_... functions in the processor. |
Beta Was this translation helpful? Give feedback.
-
I just felt this was quite convoluted and not intuitive, even though I know we agreed on this previously. However, the "save_" functions did something I did not expect them to, which was to overwrite anything in the target file with default settings unrelated to those currently loaded, which broke the settings file for that run. I would expect that the "save_" function overwrites only the relevant section (e.g. energy) and leaves the rest as is. Saving of all settings, including calibrations could be done by a separate function in SedProcessor. This could then make a copy of the config dict completely overwriting the file. |
Beta Was this translation helpful? Give feedback.
-
It should not do so, can you provide an example of this? It should update the keys given by the respective "to_save" branch, and save the config again. |
Beta Was this translation helpful? Give feedback.
-
I could not reproduce this fully. It does re-write the .yaml file but the info seems to remain the same, just shuffled around. |
Beta Was this translation helpful? Give feedback.
-
Currently the loading of a configuration when creating the SedProcessor is extremely greedy. It loads a bunch of settings files (which should be the defaults I guess) in a convoluted way, and I have not yet figured out how to overrule this.
I would have expected a single argument
config
in SedProcessor.init which you have to interact with.It makes sense that when you pass it an incomplete config file (probably the one in your working folder, but can be also somewhere else) it tries to complete it with the defaults.
Is it necessary to always pick what you have in the working folder? this one is often not what you expect, and can lead to funny behaviours (i.e. on maxwell through ssh, it happens to be your home dir, not where the notebook is...)
Maybe we can discuss a more user-friendly approach?
Beta Was this translation helpful? Give feedback.
All reactions