diff options
author | Aaron LI <aaronly.me@outlook.com> | 2017-05-16 14:21:58 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2017-05-16 15:26:46 +0800 |
commit | 02d9b9bc2263d4eabee8a07bbf8c7606255fa761 (patch) | |
tree | c3f05984a124d16f8251b3b68131663b2aaf054a /fg21sim/configs/manager.py | |
parent | d19f16e0d5a2f753fbc323fa13c438327ff3e058 (diff) | |
download | fg21sim-02d9b9bc2263d4eabee8a07bbf8c7606255fa761.tar.bz2 |
configs: Use separate section "foregrounds" to config components
Also update copyright information.
Diffstat (limited to 'fg21sim/configs/manager.py')
-rw-r--r-- | fg21sim/configs/manager.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/fg21sim/configs/manager.py b/fg21sim/configs/manager.py index 7818d1c..1cddb75 100644 --- a/fg21sim/configs/manager.py +++ b/fg21sim/configs/manager.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Weitian LI <liweitianux@live.com> +# Copyright (c) 2016-2017 Weitian LI <weitian@aaronly.me> # MIT license # # References: @@ -455,6 +455,22 @@ class ConfigManager: return os.path.normpath(path) @property + def foregrounds(self): + """Get all available and enabled foreground components. + + Returns + ------- + enabled : list[str] + Enabled foreground components to be simulated + available : list[str] + All available foreground components + """ + fg = self.get("foregrounds") + avaliable = list(fg.keys()) + enabled = [key for key, value in fg.items() if value] + return (enabled, avaliable) + + @property def frequencies(self): """Get or calculate if ``frequency/type = custom`` the frequencies where to perform the simulations. |