fixed cyclic import bug
@@ -7,7 +7,6 @@ import numpy as np
import yaml
from inspect import getmembers, isfunction, signature
-import pyccl
from . import ccllib as lib
from .errors import CCLError, CCLWarning
from ._types import error_types
@@ -198,13 +197,19 @@ class Cosmology(object):
# Go through all functions in the main package and the subpackages
# and make every function that takes `cosmo` as its first argument
# an attribute of this class.
- subs = [pyccl, pyccl.halos, pyccl.nl_pt]
+ from . import background, bcm, \
+ cls, correlations, covariances, \
+ pk2d, power, tracers, halos, nl_pt
+ subs = [background, bcm, cls, correlations, covariances,
+ pk2d, power, tracers, halos, nl_pt]
funcs = [getmembers(sub, isfunction) for sub in subs]
funcs = [func for sub in funcs for func in sub]
for name, func in funcs:
pars = signature(func).parameters
if list(pars)[0] == "cosmo":
vars()[name] = func
+ del background, bcm, cls, correlations, covariances, \
+ pk2d, power, tracers, halos, nl_pt
def __init__(
self, Omega_c=None, Omega_b=None, h=None, n_s=None,
