Skip to content

Commit

Permalink
Moved cosmopower default parameters to yaml files. (#106)
Browse files Browse the repository at this point in the history
* Moved cosmopower default settings to yaml.

* Removed tmp test files.

* Removed tmp test files.

* Added comments.
  • Loading branch information
HTJense authored and Martina Gerbino committed Oct 4, 2023
1 parent db5b1cd commit b733338
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 18 deletions.
22 changes: 22 additions & 0 deletions soliket/CosmoPower.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
stop_at_error: False

# A path to the directory where cosmopower networks are stored (can be either relative or absolute).
network_path: soliket/data/CosmoPower/CP_paper/CMB

# A dictionary of all networks and their settings.
network_settings:

# Optional extra arguments for the theory code.
extra_args:
# An lmax cut for all networks.
lmax: null

# A dictionary to rename parameters.
# (e.g. if you are sampling on "ombh2" but your network takes "omega_b" as an input,
# the line "ombh2: omega_b" will translate that parameter for you.)
renames:
ombh2: omega_b
omch2: omega_cdm
logA: ln10^{10}A_s
ns: n_s
tau: tau_reio
26 changes: 26 additions & 0 deletions soliket/CosmoPowerDerived.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
stop_at_error: False

# A path to the directory where cosmopower networks are stored (can be either relative or absolute).
network_path: soliket/data/CosmoPower/CP_paper/CMB

# A dictionary of settings for this network.
network_settings:
type: NN # Either NN or PCAplusNN, depending on the network type
log: false # Set this to true if this network calculates log(X) for all parameters X.

# Optional extra arguments for the theory code.
extra_args:
# (Currently, no extra arguments exist yet for the derived network).

# A list of all names for the derived parameters of this network.
derived_parameters: []

# A dictionary to rename parameters.
# (e.g. if you are sampling on "ombh2" but your network takes "omega_b" as an input,
# the line "ombh2: omega_b" will translate that parameter for you.)
renames:
ombh2: omega_b
omch2: omega_cdm
logA: ln10^{10}A_s
ns: n_s
tau: tau_reio
18 changes: 0 additions & 18 deletions soliket/cosmopower.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@
class CosmoPower(BoltzmannBase):
"""A CosmoPower Network wrapper for Cobaya."""

stop_at_error: bool = False

network_path: str = "soliket/data/CosmoPower/CP_paper/CMB"
network_settings: InfoDict = None

extra_args: InfoDict = None

def initialize(self) -> None:
super().initialize()

Expand Down Expand Up @@ -238,17 +231,6 @@ def get_requirements(self) -> Iterable[Tuple[str, str]]:

class CosmoPowerDerived(Theory):
"""A theory class that can calculate derived parameters from CosmoPower networks."""
stop_at_error: bool = False

network_path: str = "soliket/data/CosmoPower/CP_paper/CMB"
network_settings: InfoDict = None

derived_parameters: Iterable[str]
derived_values: Dict

extra_args: InfoDict = None

renames: Dict = {}

def initialize(self) -> None:
super().initialize()
Expand Down

0 comments on commit b733338

Please sign in to comment.