Edit: Moving the settings file out of the model directory is now a separate issue: #513
Currently the program settings are read from a settings.toml file in the model directory, if one exists (otherwise defaults are used). Right now, there's only the one (for setting the log level), but in future there will be more (e.g. setting the default output directory etc.).
The settings config file really shouldn't live in the model directory, which should be solely for model-related parameters, not settings for the whole program.1 In particular, if users set things like file paths in this config file, then whoever tries to load the model on a different machine will run into issues: there will be an error if the path doesn't exist, but if it does, it may mean that the output files are stored somewhere unexpected, which is also not ideal.
It would be better to store this file in the program's config directory (e.g. ~/.config/muse2 on Linux -- you can use something like the dirs crate to choose an OS-appropriate one). The problem with doing this is that it may not be obvious to users where this file is -- especially less technically minded ones. So I suggest that we add a few simple commands to muse2 to help users with this, e.g.:
muse2 settings edit - Open the settings file in the user's default editor, creating it from a default one if it doesn't exist
muse2 settings path - Print the path to the settings file
muse2 settings delete - Delete the file and in order to reset the program to factory settings
There are probably a bunch of these commands that we can imagine, but some of them may prove controversial and we don't want to overcomplicate things, so maybe we could just start off by adding the one to edit the settings file and seeing how we go from there.
Edit: Moving the settings file out of the model directory is now a separate issue: #513
Currently the program settings are read from a
settings.tomlfile in the model directory, if one exists (otherwise defaults are used). Right now, there's only the one (for setting the log level), but in future there will be more (e.g. setting the default output directory etc.).The settings config file really shouldn't live in the model directory, which should be solely for model-related parameters, not settings for the whole program.1 In particular, if users set things like file paths in this config file, then whoever tries to load the model on a different machine will run into issues: there will be an error if the path doesn't exist, but if it does, it may mean that the output files are stored somewhere unexpected, which is also not ideal.
It would be better to store this file in the program's config directory (e.g.
~/.config/muse2on Linux -- you can use something like thedirscrate to choose an OS-appropriate one). The problem with doing this is that it may not be obvious to users where this file is -- especially less technically minded ones. So I suggest that we add a few simple commands tomuse2to help users with this, e.g.:muse2 settings edit- Open the settings file in the user's default editor, creating it from a default one if it doesn't existmuse2 settings path- Print the path to the settings filemuse2 settings delete- Delete the file and in order to reset the program to factory settingsThere are probably a bunch of these commands that we can imagine, but some of them may prove controversial and we don't want to overcomplicate things, so maybe we could just start off by adding the one to edit the settings file and seeing how we go from there.
Footnotes
This comes up in other projects (e.g. HealthGPS mixes program settings and model parameters in the same config file) and I hate it 🙃. If you open a Word document that someone's sent you, you don't expect it to start rearranging your toolbars or whatever, because your program settings shouldn't be something Word documents mess with. This is the same deal. /rant ↩