Skip to content

Commit d84d0ea

Browse files
committed
change to config_v1.yaml
1 parent 276b774 commit d84d0ea

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

docs/user_guide/config.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ The config module contains a mechanism to collect configuration parameters from
44
It will load an (optional) provided config file, or alternatively use a passed python dictionary as initial config dictionary, and subsequently look for the following additional config files to load:
55

66
* ``folder_config``: A config file of name :file:`sed_config.yaml` in the current working directory. This is mostly intended to pass calibration parameters of the workflow between different notebook instances.
7-
* ``user_config``: A config file provided by the user, stored as :file:`.config/sed/config.yaml` in the current user's home directly. This is intended to give a user the option for individual configuration modifications of system settings.
8-
* ``system_config``: A config file provided by the system administrator, stored as :file:`/etc/sed/config.yaml` on Linux-based systems, and :file:`%ALLUSERSPROFILE%/sed/config.yaml` on Windows. This should provide all necessary default parameters for using the sed processor with a given setup. For an example for an mpes setup, see :ref:`example_config`
7+
* ``user_config``: A config file provided by the user, stored as :file:`.config/sed/config_v1.yaml` in the current user's home directly. This is intended to give a user the option for individual configuration modifications of system settings.
8+
* ``system_config``: A config file provided by the system administrator, stored as :file:`/etc/sed/config_v1.yaml` on Linux-based systems, and :file:`%ALLUSERSPROFILE%/sed/config_v1.yaml` on Windows. This should provide all necessary default parameters for using the sed processor with a given setup. For an example for an mpes setup, see :ref:`example_config`
99
* ``default_config``: The default configuration shipped with the package. Typically, all parameters here should be overwritten by any of the other configuration files.
1010

1111
The config mechanism returns the combined dictionary, and reports the loaded configuration files. In order to disable or overwrite any of the configuration files, they can be also given as optional parameters (path to a file, or python dictionary).

src/sed/core/config.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ def parse_config(
5353
user_config (dict | str, optional): user-based config dictionary
5454
or file path. The loaded dictionary is completed with the user-based values,
5555
taking preference over system and default values.
56-
Defaults to the file ".config/sed/config.yaml" in the current user's home directory.
56+
Defaults to the file ".config/sed/config_v1.yaml" in the current user's home directory.
5757
system_config (dict | str, optional): system-wide config dictionary
5858
or file path. The loaded dictionary is completed with the system-wide values,
59-
taking preference over default values. Defaults to the file "/etc/sed/config.yaml"
60-
on linux, and "%ALLUSERSPROFILE%/sed/config.yaml" on windows.
59+
taking preference over default values. Defaults to the file "/etc/sed/config_v1.yaml"
60+
on linux, and "%ALLUSERSPROFILE%/sed/config_v1.yaml" on windows.
6161
default_config (dict | str, optional): default config dictionary
6262
or file path. The loaded dictionary is completed with the default values.
6363
Defaults to *package_dir*/config/default.yaml".
@@ -96,7 +96,7 @@ def parse_config(
9696
user_dict = copy.deepcopy(user_config)
9797
else:
9898
if user_config is None:
99-
user_config = str(USER_CONFIG_PATH.joinpath("config.yaml"))
99+
user_config = str(USER_CONFIG_PATH.joinpath("config_v1.yaml"))
100100
if Path(user_config).exists():
101101
user_dict = load_config(user_config)
102102
if verbose:
@@ -107,7 +107,7 @@ def parse_config(
107107
system_dict = copy.deepcopy(system_config)
108108
else:
109109
if system_config is None:
110-
system_config = str(SYSTEM_CONFIG_PATH.joinpath("config.yaml"))
110+
system_config = str(SYSTEM_CONFIG_PATH.joinpath("config_v1.yaml"))
111111
if Path(system_config).exists():
112112
system_dict = load_config(system_config)
113113
if verbose:

src/sed/loader/mpes/loader.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -902,10 +902,13 @@ def gather_metadata(
902902
metadata=metadata,
903903
)
904904

905-
metadata = metadata_retriever.fetch_elab_metadata(
906-
runs=self.runs,
907-
metadata=metadata,
908-
)
905+
if self.runs:
906+
metadata = metadata_retriever.fetch_elab_metadata(
907+
runs=self.runs,
908+
metadata=metadata,
909+
)
910+
else:
911+
logger.warning('Fetching elabFTW metadata only supported for loading from "runs"')
909912

910913
return metadata
911914

0 commit comments

Comments
 (0)