Skip to content

Commit e56d6db

Browse files
Jammy2211claude
authored andcommitted
fix: numpy-2.x safety in SamplesMCMC.median_pdf
np.percentile with a list [50] returns a shape-(1,) ndarray; float() on that is a deprecated conversion that errors on numpy >= 2.4. Pass the percentile as a scalar so the result is a scalar and float() is safe. Unblocks searches/Emcee.py in autofit_workspace_test smoke tests on Python 3.13 + numpy 2.4. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
1 parent 360c5c8 commit e56d6db

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

autofit/non_linear/samples/mcmc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def median_pdf(self, as_instance: bool = True) -> [float]:
144144

145145
if self.pdf_converged:
146146
return [
147-
float(np.percentile(self.parameters_extract[i, :], [50]))
147+
float(np.percentile(self.parameters_extract[i, :], 50))
148148
for i in range(self.model.prior_count)
149149
]
150150

0 commit comments

Comments
 (0)