diff --git a/camb/model.py b/camb/model.py index 67b9730c..ebb02ab6 100644 --- a/camb/model.py +++ b/camb/model.py @@ -795,10 +795,7 @@ def tensor_power(self, k): return self.primordial_power(k, 2) def primordial_power(self, k, ix): - if np.isscalar(k): - karr = np.array([k], dtype=np.float64) - else: - karr = np.array(k, dtype=np.float64) + karr = np.ascontiguousarray([k] if np.isscalar(k) else k, dtype=np.float64) n = karr.shape[0] powers = np.empty(n) self.f_PrimordialPower(karr, powers, byref(c_int(n)), byref(c_int(ix)))