Skip to content

Commit

Permalink
Remove duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
zaxtax committed Jan 20, 2025
1 parent d813da1 commit 81eef66
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pymc/sampling/forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,10 +821,12 @@ def sample_posterior_predictive(
if var_names is not None:
vars_ = [model[x] for x in var_names]
else:
vars_ = model.observed_RVs + observed_dependent_deterministics(model)
observed_vars = model.observed_RVs
if observed_data is not None:
vars_ += [model[x] for x in observed_data if x in model and x not in vars_]
vars_ += observed_dependent_deterministics(model, vars_)
observed_vars += [
model[x] for x in observed_data if x in model and x not in observed_vars
]
vars_ = observed_vars + observed_dependent_deterministics(model, observed_vars)

vars_to_sample = list(get_default_varnames(vars_, include_transformed=False))

Expand Down

0 comments on commit 81eef66

Please sign in to comment.