diff --git a/src/emcee/moves/de_snooker.py b/src/emcee/moves/de_snooker.py index 0b53efa4..00d5c50a 100644 --- a/src/emcee/moves/de_snooker.py +++ b/src/emcee/moves/de_snooker.py @@ -32,7 +32,7 @@ def get_proposal(self, s, c, random): Ns = len(s) Nc = list(map(len, c)) ndim = s.shape[1] - q = np.empty((Ns, ndim), dtype=np.float64) + q = np.empty_like(s) metropolis = np.empty(Ns, dtype=np.float64) for i in range(Ns): w = np.array([c[j][random.randint(Nc[j])] for j in range(3)]) diff --git a/src/emcee/moves/walk.py b/src/emcee/moves/walk.py index e2a96729..b83e066e 100644 --- a/src/emcee/moves/walk.py +++ b/src/emcee/moves/walk.py @@ -28,7 +28,7 @@ def get_proposal(self, s, c, random): c = np.concatenate(c, axis=0) Ns, Nc = len(s), len(c) ndim = s.shape[1] - q = np.empty((Ns, ndim), dtype=np.float64) + q = np.empty_like(s) s0 = Nc if self.s is None else self.s for i in range(Ns): inds = random.choice(Nc, s0, replace=False)