Skip to content

Commit

Permalink
renames/tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
cmbant committed Aug 14, 2024
1 parent 3d5e8d6 commit 6aefe73
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 26 deletions.
2 changes: 1 addition & 1 deletion mflike/EE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ defaults:
scales:
EE: [ 30, 9000 ]

params: !defaults [ calib_common, calib_E ]
params: !defaults [ mflike_common, calib_E ]
2 changes: 1 addition & 1 deletion mflike/TE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ defaults:
# instead of TE and ET separately.
symmetrize: false

params: !defaults [ calib_common, calib_T, calib_E ]
params: !defaults [ mflike_common, calib_T, calib_E ]
4 changes: 2 additions & 2 deletions mflike/TT.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Specify default set of spectra and scale cuts
# to be used
requested_cls: [ "tt", "te", "ee" ]
requested_cls: [ "tt" ]
defaults:
# Which spectra?
polarizations: [ TT ]
# Scale cuts (in ell) for each spectrum
scales:
TT: [ 30, 9000 ]

params: !defaults [ calib_common, calib_T ]
params: !defaults [ mflike_common, calib_T ]

2 changes: 1 addition & 1 deletion mflike/TTTEEE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ defaults:
# instead of TE and ET separately.
symmetrize: false

params: !defaults [ calib_common, calib_T, calib_E ]
params: !defaults [ mflike_common, calib_T, calib_E ]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions mflike/foreground.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@
"""

import os

import numpy as np
from cobaya.log import LoggedError
from cobaya.theory import Provider, Theory
from cobaya.theory import Theory
from cobaya.yaml import yaml_load
from scipy import constants

Expand Down Expand Up @@ -81,13 +80,14 @@ class ForegroundParamsTheory(Theory):

@classmethod
def get_class_options(cls, input_options={}):

options = super().get_class_options().copy()
if cls is ForegroundParamsTheory and (
param_requested_cls := input_options.get('requested_cls', ['tt', 'te', 'ee'])) \
or ('requested_cls' not in input_options and (param_requested_cls := options.get('requested_cls'))):
params = yaml_load(cls.get_text_file_content('params_common.yaml'))
params = yaml_load(cls.get_text_file_content('fg_common.yaml'))
for spec in param_requested_cls:
params |= yaml_load(cls.get_text_file_content('params_%s.yaml' % spec.upper()))
params |= yaml_load(cls.get_text_file_content('fg_%s.yaml' % spec.upper()))
options["params"] = params
return options

Expand Down
17 changes: 0 additions & 17 deletions mflike/mflike.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,6 @@ def initialize(self):
# Read data
self._prepare_data()

# Setting mode given likelihood name
likelihood_name = self.__class__.__name__
self.mode = likelihood_name.replace("MFLike_", "").lower()
if self.mode not in ["tt", "te", "ee", "ttteee"]:
raise LoggedError(
self.log,
f"This likelihood mode ({self.mode}) is not supported."
)

# State requisites to the theory code
requested_cls = {
"tt": ["tt"],
"te": ["te"],
"ee": ["ee"],
"ttteee": ["tt", "te", "ee"],
}
self.requested_cls = requested_cls[self.mode]
self.lmax_theory = self.lmax_theory or 9000
self.log.debug(f"Maximum multipole value: {self.lmax_theory}")

Expand Down
File renamed without changes.

0 comments on commit 6aefe73

Please sign in to comment.