Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved cosmopower default parameters to yaml files. #106

Merged
merged 4 commits into from
Feb 28, 2023
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
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