From 30745c2b44a3889925ba2a4a60338cea0fe84f58 Mon Sep 17 00:00:00 2001 From: Antony Lewis Date: Mon, 19 Aug 2024 16:17:30 +0100 Subject: [PATCH] linux [testpypi] --- camb/results.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/camb/results.py b/camb/results.py index bd59d1d6..e6028d19 100644 --- a/camb/results.py +++ b/camb/results.py @@ -1473,7 +1473,7 @@ def luminosity_distance(self, z): """ if not np.isscalar(z): - z = np.asarray(z) + z = np.ascontiguousarray(z, dtype=np.float64) return self.angular_diameter_distance(z) * (1.0 + z) ** 2 def h_of_z(self, z): @@ -1489,7 +1489,7 @@ def h_of_z(self, z): :return: H(z) """ if not np.isscalar(z): - z = np.array(z, dtype=np.float64) + z = np.ascontiguousarray(z, dtype=np.float64) arr = np.empty(z.shape) self.f_HofzArr(arr, z, byref(c_int(z.shape[0]))) return arr @@ -1535,7 +1535,7 @@ def physical_time(self, z): :return: t(z)/Gigayear """ if not np.isscalar(z): - z = np.asarray(z, dtype=np.float64) + z = np.ascontiguousarray(z, dtype=np.float64) return self.physical_time_a1_a2(0, 1.0 / (1 + z)) def conformal_time_a1_a2(self, a1, a2): @@ -1567,7 +1567,7 @@ def conformal_time(self, z, presorted=None, tol=None): if np.isscalar(z): redshifts = np.array([z], dtype=np.float64) else: - redshifts = np.array(z, dtype=np.float64) + redshifts = np.asarray(z, dtype=np.float64) if presorted is True: redshifts = redshifts[::-1].copy() elif presorted is None: