55
66
77def clean_dict (obj ):
8- """
9- Remove keys from the dictionary where the corresponding value is None.
8+ """Remove keys from the dictionary where the corresponding value is None.
109
1110 Parameters
1211 ----------
@@ -17,7 +16,6 @@ def clean_dict(obj):
1716 -------
1817 dict:
1918 The cleaned dictionary with keys removed where the value is None.
20-
2119 """
2220 obj = obj if obj is not None else {}
2321 for key , value in copy (obj ).items ():
@@ -27,8 +25,7 @@ def clean_dict(obj):
2725
2826
2927def stringify (obj ):
30- """
31- Convert None to an empty string.
28+ """Convert None to an empty string.
3229
3330 Parameters
3431 ----------
@@ -44,8 +41,7 @@ def stringify(obj):
4441
4542
4643def load_config (file_path ):
47- """
48- Load configuration from a .json file.
44+ """Load configuration from a .json file.
4945
5046 Parameters
5147 ----------
@@ -56,7 +52,6 @@ def load_config(file_path):
5652 -------
5753 dict:
5854 The configuration dictionary or {} if the config file does not exist.
59-
6055 """
6156 config_file = Path (file_path ).resolve ()
6257 if config_file .is_file ():
@@ -91,8 +86,8 @@ def _create_global_config(args):
9186
9287
9388def get_user_info (owner_name = None , owner_email = None , owner_orcid = None ):
94- """
95- Get name, email and orcid of the owner/user from various sources and return it as a metadata dictionary
89+ """Get name, email and orcid of the owner/user from various sources and
90+ return it as a metadata dictionary.
9691
9792 The function looks for the information in json format configuration files with the name 'diffpyconfig.json'.
9893 These can be in the user's home directory and in the current working directory. The information in the
@@ -124,7 +119,6 @@ def get_user_info(owner_name=None, owner_email=None, owner_orcid=None):
124119 dict:
125120 The dictionary containing username, email and orcid of the user/owner, and any other information
126121 stored in the global or local config files.
127-
128122 """
129123 runtime_info = {"owner_name" : owner_name , "owner_email" : owner_email , "owner_orcid" : owner_orcid }
130124 for key , value in copy (runtime_info ).items ():
@@ -149,8 +143,7 @@ def get_user_info(owner_name=None, owner_email=None, owner_orcid=None):
149143
150144
151145def get_package_info (package_names , metadata = None ):
152- """
153- Fetches package version and updates it into (given) metadata.
146+ """Fetches package version and updates it into (given) metadata.
154147
155148 Package info stored in metadata as {'package_info': {'package_name': 'version_number'}}.
156149
@@ -164,7 +157,6 @@ def get_package_info(package_names, metadata=None):
164157 -------
165158 dict:
166159 The updated metadata dict with package info inserted.
167-
168160 """
169161 if metadata is None :
170162 metadata = {}
0 commit comments