Skip to content

Make clear where config.yaml is being read from #218

Description

@nstelter-slac

was bit tricky to find which settings config file my Badger was reading from by default (/home/nolan/.config/config.yaml for me)

could we mention this in the docs, and display the curr config file in gui somewhere with option to set new path?

also if i pass an empty config file to Badger by running badger -g -cf empty.yaml, i get the following error:

Traceback (most recent call last):
  File "/home/nolan/miniforge3/envs/badger-env/bin/badger", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/nolan/repos/Badger/src/badger/__main__.py", line 136, in main
    args.func(args)
  File "/home/nolan/repos/Badger/src/badger/actions/__init__.py", line 16, in show_info
    if check_n_config_paths(args.config_filepath):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nolan/repos/Badger/src/badger/actions/doctor.py", line 36, in check_n_config_paths
    config = init_settings(config_filepath)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nolan/repos/Badger/src/badger/settings.py", line 406, in init_settings
    config_singleton = ConfigSingleton(file_path, user_flag)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nolan/repos/Badger/src/badger/settings.py", line 114, in __new__
    cls._instance._config = cls.load_or_create_config(config_path)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nolan/repos/Badger/src/badger/settings.py", line 140, in load_or_create_config
    for key, value in config_data.items():
                      ^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'items

in this situation, could we write the default config values into the empty file?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions