Skip to content
Snippets Groups Projects

MAINT: hack around numpy deprecated float/int/bool

Merged Colm Talbot requested to merge ptemcee-numpy-bug into master
All threads resolved!

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

Pipeline #487117 passed

Pipeline passed for 8e95a954 on ptemcee-numpy-bug

Test coverage 66.00% (0.00%) from 1 job
Approval is optional

Merged by Colm TalbotColm Talbot 2 years ago (Jan 18, 2023 3:33pm UTC)

Pipeline #490123 failed

Pipeline failed for b84af262 on master

Test coverage 66.00% (0.00%) from 1 job

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading