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

Revise ORBIT.library.extract_library_data to be recursive #14

Open
JakeNunemaker opened this issue Mar 31, 2020 · 0 comments
Open

Revise ORBIT.library.extract_library_data to be recursive #14

JakeNunemaker opened this issue Mar 31, 2020 · 0 comments
Assignees
Labels
enhancement Enhancement to an existing feature low-priority Features and requests that are on the backburner timescale: hours Estimated development time

Comments

@JakeNunemaker
Copy link
Contributor

ORBIT/ORBIT/library.py

Lines 97 to 129 in 50e7481

def extract_library_data(config, additional_keys=[]):
"""
Extracts the configuration data from the specified library.
Parameters
----------
config : dict
Configuration dictionary.
additional_keys : list
Additional keys that contain data that needs to be extracted from
within `config`, by default [].
Returns
-------
config : dict
Configuration dictionary.
"""
if os.environ.get("DATA_LIBRARY", None) is None:
return config
for key, val in config.items():
if isinstance(val, dict) and any(el in key for el in additional_keys):
config[key] = extract_library_data(val)
elif not isinstance(val, str):
continue
try:
config[key] = extract_library_specs(key, val)
except KeyError:
continue
return config

@JakeNunemaker JakeNunemaker self-assigned this Mar 31, 2020
@JakeNunemaker JakeNunemaker added enhancement Enhancement to an existing feature low-priority Features and requests that are on the backburner timescale: hours Estimated development time labels Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to an existing feature low-priority Features and requests that are on the backburner timescale: hours Estimated development time
Projects
None yet
Development

No branches or pull requests

1 participant