From cbbc26191f4454c71b0abe2458d721e2aaa1ab14 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Fri, 21 Jul 2017 10:04:40 +0800 Subject: configs/manager.py: Add property "cosmology" Signed-off-by: Aaron LI --- fg21sim/configs/manager.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/fg21sim/configs/manager.py b/fg21sim/configs/manager.py index 44df01c..ce376aa 100644 --- a/fg21sim/configs/manager.py +++ b/fg21sim/configs/manager.py @@ -544,6 +544,21 @@ class ConfigManager: } return logconf + @property + def cosmology(self): + """ + Get the cosmological parameters and organize them as an dictionary + for ``Cosmology`` initialization. + """ + conf = self.get("cosmology") + cosmoconf = { + "H0": conf["H0"], + "OmegaM0": conf["OmegaM0"], + "Omegab0": conf["Omegab0"], + "sigma8": conf["sigma8"], + } + return cosmoconf + def dump(self, from_default=False, flatten=False): """ Dump the configurations as plain Python dictionary. -- cgit v1.2.2