Skip to content

MAINT: hack around numpy deprecated float/int/bool

Colm Talbot requested to merge ptemcee-numpy-bug into master

Updated: 1/3/23

Numpy 1.24 finally pulled the trigger on removing the np.float deprecation. We have three options at this stage:

  • remove support for ptemcee/nestle. I would strongly rather not do this as I actively use both samplers and I know at least some others do also.
  • get an updated release of the samplers. I know that people have discussed this and attempting to reach out to the original author to allow this.
  • hack around the problem and hope nothing else breaks later. This is what is done here.

As an extremely ugly workaround for this, I propose that we manually set the now missing ptemcee.sampler.np.float and nestle. This is equivalent to just setting np.float, but makes it more clear why we are doing it. If there is ever a new release of either we should just remove this clause.

I also had to make a few changes to the HealPixPrior. Specifically, the self.distance_dist was returning a one-element array rather than a float. I simplified the code in that section a little and removed the distance_dist attribute.

Edited by Colm Talbot

Merge request reports