Skip to content

Commit 9130d81

Browse files
committed
fix mypy in sampling.py?
1 parent 507de2f commit 9130d81

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pymc/sampling.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1841,7 +1841,7 @@ def sample_posterior_predictive(
18411841
trace_coords: Dict[str, np.ndarray] = {}
18421842
if "coords" not in idata_kwargs:
18431843
idata_kwargs["coords"] = {}
1844-
idata = None
1844+
idata: Optional[InferenceData] = None
18451845
stacked_dims = None
18461846
if isinstance(trace, InferenceData):
18471847
_constant_data = getattr(trace, "constant_data", None)
@@ -1986,7 +1986,7 @@ def sample_posterior_predictive(
19861986
return pm.predictions_to_inference_data(ppc_trace, **ikwargs)
19871987
idata_pp = pm.to_inference_data(posterior_predictive=ppc_trace, **ikwargs)
19881988

1989-
if extend_inferencedata:
1989+
if extend_inferencedata and idata is not None:
19901990
idata.extend(idata_pp)
19911991
return idata
19921992
return idata_pp

0 commit comments

Comments
 (0)