From a13f907747491c0b87e665d0c0a649efb1f66c6c Mon Sep 17 00:00:00 2001 From: Stijn de Boer Date: Wed, 16 Aug 2023 13:11:51 +0200 Subject: [PATCH] Zero-out all data --- pcntoolkit/model/hbr.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pcntoolkit/model/hbr.py b/pcntoolkit/model/hbr.py index 69bc80b0..ca4dfc36 100644 --- a/pcntoolkit/model/hbr.py +++ b/pcntoolkit/model/hbr.py @@ -392,8 +392,13 @@ def estimate(self, X, y, batch_effects, **kwargs): dummy_array = xarray.DataArray(data = np.zeros((len(chain), len(draw), 1)), coords = {'chain':chain, 'draw':draw,'empty':np.array([0])}, name=j) self.idata.posterior[j] = dummy_array self.vars_to_sample.append(j) - self.idata.observed_data = None - self.idata.constant_data = None + + # zero-out all data + for i in self.idata.constant_data.data_vars: + self.idata.constant_data[i] *= 0 + for i in self.idata.observed_data.data_vars: + self.idata.observed_data[i] *= 0 + return self.idata def predict(