Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

organize and document config default values #521

Open
donald-e-boyce opened this issue May 9, 2023 · 1 comment
Open

organize and document config default values #521

donald-e-boyce opened this issue May 9, 2023 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@donald-e-boyce
Copy link
Collaborator

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.

@psavery
Copy link
Collaborator

psavery commented May 11, 2023

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.

@ZackAttack614 ZackAttack614 added the documentation Improvements or additions to documentation label Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants