organize and document config default values
The default values for the config file variables need to be documented. There are some modules with default values defined explicitly in the module, e.g. in material.py
from .config import Config
DMIN_DFLT = 0.5 # angstrom
TTHW_DFLT = 0.25 # degrees
But most default values are hardcoded using the config get() method, as in fitgrains.py:
@property
def do_fit(self):
return self._cfg.get('fit_grains:do_fit', True)
It would be useful to have a standard location where the default config values are located. That would make it easier to be consistent with the GUI as well.
I am thinking of adding a separate defaults module to the config package.
This sounds good to me, Don. And actually, a lot of config in HEXRDGUI is stored in dicts. We put the default values for our config in a yaml file like this one.
After loading saved settings, we recursively set default values if any keys are missing.
You might be able to do a yaml file for the defaults here as well.