Skip to content

Commit 29f0b95

Browse files
Merge pull request #77 from levolz/Development
bugfix inheritance in simulation.py
2 parents fba2eae + 7b2820f commit 29f0b95

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bayesflow/simulation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -736,15 +736,15 @@ def __init__(
736736
parameters or on single parameter vectors via tha `simulator_is_batched` argument.
737737
"""
738738

739-
if type(prior) is not Prior:
739+
if not isinstance(prior, Prior):
740740
prior_args = {"batch_prior_fun": prior} if prior_is_batched else {"prior_fun": prior}
741741
self.prior = Prior(**prior_args)
742742
self.prior_is_batched = prior_is_batched
743743
else:
744744
self.prior = prior
745-
self.prior_is_batched = prior_is_batched
745+
self.prior_is_batched = self.prior.is_batched
746746

747-
if type(simulator) is not Simulator:
747+
if not isinstance(simulator, Simulator):
748748
self.simulator = self._config_custom_simulator(simulator, simulator_is_batched)
749749
else:
750750
self.simulator = simulator

0 commit comments

Comments
 (0)