Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Contributors (Alphabetical Order)

- Pierre Burger
- Ian Harrison [ORCID: 0000-0002-4437-0770](https://orcid.org/0000-0002-4437-0770)
- Hidde T Jense [0000-0002-9429-0015](https://orcid.org/0000-0002-9429-0015)
- Alessio Spurio Mancini [0000-0001-5698-0990](https://orcid.org/0000-0001-5698-0990)
- Davide Piras [ORCID: 0000-0002-9836-2661](https://orcid.org/0000-0002-9836-2661)
2 changes: 1 addition & 1 deletion cosmopower/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


__version__ = "0.2.0"
__author__ = "Alessio Spurio Mancini, Hidde Jense, and Ian Harrison"
__author__ = "Alessio Spurio Mancini"


def get_cobaya_class():
Expand Down
13 changes: 8 additions & 5 deletions cosmopower/examples/4_cobaya.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,24 +74,27 @@
min: 0.01
max: 0.12
ref: 0.05
H0:
derived: true
sigma8:
derived: true
h:
prior:
min: 0.6
max: 0.8
ref: 0.67

"""

yaml = yaml_load(model)

install(yaml)

# Create the cobaya model.
model = get_model(model)
model = get_model(yaml)

# The best-fit values from the Planck paper.
plik_best_fit = {
"ombh2": 22.383e-3,
"omch2": 12.011e-2,
"cosmomc_theta": 104.0909e-4,
"h": 0.67,
"logA": 3.0448,
"ns": 0.96605,
"tau": 0.0543,
Expand Down
2 changes: 1 addition & 1 deletion cosmopower/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def ell_factor(ls: np.ndarray, spectra: str) -> np.ndarray:
elif spectra in ["pt", "pe", "pb", "tp", "ep", "bp"]:
ellfac = ls * (ls + 1.0) / (2.0 * np.pi)
elif spectra in ["pp"]:
ellfac = ls * (ls + 1.0) / (2.0 * np.pi)
ellfac = (ls * (ls + 1.0))**2. / (2.0 * np.pi)

return ellfac

Expand Down
8 changes: 6 additions & 2 deletions cosmopower/wrappers/cosmosis/cosmopower_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ def get_cosmopower_outputs(block, netname, data, config):
if config['ell_factor']:
prefac *= cp.util.ell_factor(block[cmb_cl, 'ell'], cl_type)

#ToDo: ambiguity of 'Cl' vs 'cmb_cl' here
block[cmb_cl, cl_type] = data * prefac * cp.util.cmb_unit_factor(cl_type, config['units'], 2.7255)
if cl_type == 'pp':
ell = block[cmb_cl, 'ell']
block[cmb_cl, cl_type] = 2.* np.pi * data * cp.util.cmb_unit_factor(cl_type, config['units'], 2.7255) / (ell*(ell + 1))
else:
#ToDo: ambiguity of 'Cl' vs 'cmb_cl' here
block[cmb_cl, cl_type] = data * prefac * cp.util.cmb_unit_factor(cl_type, config['units'], 2.7255)

if config['lmax'] > 0:
ell_select = block[cmb_cl, 'ell'] <= config['lmax']
Expand Down
10 changes: 6 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ def read_file(file):
long_description = read_file("README.md")

# Determine whether the system is M1/M2 Mac
if 'arm' in os.uname().machine:
tensorflow = 'tensorflow-metal'
else:
tensorflow = 'tensorflow<2.14'
# if 'arm' in os.uname().machine:
# tensorflow = 'tensorflow-metal'
# else:
# tensorflow = 'tensorflow<2.14'

tensorflow = 'tensorflow'

setup(classifiers=['Operating System :: OS Independent',
'Intended Audience :: Developers',
Expand Down