Skip to content

Commit

Permalink
Updated runManager.py
Browse files Browse the repository at this point in the history
  • Loading branch information
xuyuon committed Jul 24, 2024
1 parent 204f681 commit 4f3be70
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/jimgw/single_event/runManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ class SingleEventRun:
str, dict[str, Union[str, float, int, bool]]
] # Transform cannot be included in this way, add it to preset if used often.
jim_parameters: dict[str, Union[str, float, int, bool, dict]]
injection_parameters: dict[str, float]
injection_parameters: dict[str, float] = field(
default_factory=lambda: {}
)
injection: bool = False
likelihood_parameters: dict[str, Union[str, float, int, bool, PyTree]] = field(
default_factory=lambda: {"name": "TransientLikelihoodFD"}
Expand Down Expand Up @@ -123,6 +125,9 @@ def __init__(self, **kwargs):
print("Neither run instance nor path provided.")
raise ValueError

if self.run.injection and not self.run.injection_parameters:
raise ValueError("Injection mode requires injection parameters.")

local_prior = self.initialize_prior()
local_likelihood = self.initialize_likelihood(local_prior)
self.jim = Jim(local_likelihood, local_prior, **self.run.jim_parameters)
Expand Down

0 comments on commit 4f3be70

Please sign in to comment.