aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-07-31 20:00:12 +0800
committerAaron LI <aly@aaronly.me>2017-07-31 20:00:12 +0800
commitec02a0d052dfe3d045994bed7849e513501997e4 (patch)
tree1397fcb9b7015e008de30366b2d263e90ed8398d
parentfe6857171f11217fdb3e15fd8f50479c11f521fb (diff)
downloadfg21sim-ec02a0d052dfe3d045994bed7849e513501997e4.tar.bz2
cosmology: Avoid the circular importing issue
Signed-off-by: Aaron LI <aly@aaronly.me>
-rw-r--r--fg21sim/share.py2
-rw-r--r--fg21sim/utils/__init__.py1
-rw-r--r--fg21sim/utils/cosmology.py7
3 files changed, 2 insertions, 8 deletions
diff --git a/fg21sim/share.py b/fg21sim/share.py
index a3b516b..bbe52b4 100644
--- a/fg21sim/share.py
+++ b/fg21sim/share.py
@@ -29,4 +29,4 @@ CONFIGS = ConfigManager()
# NOTE: Once the above shared ``CONFIGS`` setup or loaded with new
# configurations, this ``COSMO`` object needs also been updated:
# ``COSMO.setup(**CONFIGS.cosmology)``
-COSMO = Cosmology()
+COSMO = Cosmology(**CONFIGS.cosmology)
diff --git a/fg21sim/utils/__init__.py b/fg21sim/utils/__init__.py
index 2f9f57f..1a8b2d3 100644
--- a/fg21sim/utils/__init__.py
+++ b/fg21sim/utils/__init__.py
@@ -2,4 +2,3 @@
# MIT license
from .logging import setup_logging
-from .cosmology import Cosmology
diff --git a/fg21sim/utils/cosmology.py b/fg21sim/utils/cosmology.py
index dc5f126..a3c8574 100644
--- a/fg21sim/utils/cosmology.py
+++ b/fg21sim/utils/cosmology.py
@@ -40,7 +40,6 @@ import numpy as np
from scipy import integrate
from astropy.cosmology import FlatLambdaCDM
-from ..share import CONFIGS
from .units import (UnitConversions as AUC, Constants as AC)
@@ -75,11 +74,7 @@ class Cosmology:
# Present day (z=0) growth factor
_growth_factor0 = None
- def __init__(self,
- H0=CONFIGS.cosmology["H0"],
- Om0=CONFIGS.cosmology["Om0"],
- Ob0=CONFIGS.cosmology["Ob0"],
- sigma8=CONFIGS.cosmology["sigma8"]):
+ def __init__(self, H0=71.0, Om0=0.27, Ob0=0.046, sigma8=0.81):
self.setup(H0=H0, Om0=Om0, Ob0=Ob0, sigma8=sigma8)
def setup(self, **kwargs):