From 70f1cf3c0d1679f8089c725c6c8659842d7ed450 Mon Sep 17 00:00:00 2001
From: Matthew Pitkin <matthew.pitkin@ligo.org>
Date: Wed, 23 Jun 2021 14:39:07 +0100
Subject: [PATCH] grid.py: use updated implementation of logtrapzexp

---
 bilby/core/grid.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bilby/core/grid.py b/bilby/core/grid.py
index 8562e6d67..8e264872d 100644
--- a/bilby/core/grid.py
+++ b/bilby/core/grid.py
@@ -191,8 +191,10 @@ class Grid(object):
         places = self.sample_points[name]
 
         if len(places) > 1:
+            dx = np.diff(places)
             out = np.apply_along_axis(
-                logtrapzexp, axis, log_array, places[1] - places[0])
+                logtrapzexp, axis, log_array, dx
+            )
         else:
             # no marginalisation required, just remove the singleton dimension
             z = log_array.shape
-- 
GitLab