Skip to content

Commit

Permalink
testing latest emcee and new multiprocessing
Browse files Browse the repository at this point in the history
  • Loading branch information
IainHammond committed Jan 22, 2025
1 parent 555931c commit 17a1cb9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ astropy
photutils
scikit-learn
scikit-image
emcee==2.2.1
emcee
nestle
corner
pandas
Expand Down
23 changes: 12 additions & 11 deletions vip_hci/fm/negfc_mcmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
import numpy as np
import os
import emcee
from multiprocessing import cpu_count
from multiprocessing import cpu_count, Pool
import inspect
import datetime
import corner
Expand Down Expand Up @@ -914,16 +914,17 @@ def mcmc_negfc_sampling(cube, angs, psfn, initial_state, algo=pca_annulus,
os.environ["NUMEXPR_NUM_THREADS"] = "1"
os.environ["OMP_NUM_THREADS"] = "1"

sampler = emcee.EnsembleSampler(nwalkers, dim, lnprob, a=a,
args=([bounds, cube, angs, psfn,
fwhm, annulus_width, ncomp,
aperture_radius, initial_state,
cube_ref, svd_mode, scaling, algo,
delta_rot, fmerit, imlib,
interpolation, collapse,
algo_options, weights, transmission,
mu_sigma, sigma, force_rPA]),
threads=nproc)
with Pool() as pool:
sampler = emcee.EnsembleSampler(nwalkers, dim, lnprob, a=a,
args=([bounds, cube, angs, psfn,
fwhm, annulus_width, ncomp,
aperture_radius, initial_state,
cube_ref, svd_mode, scaling, algo,
delta_rot, fmerit, imlib,
interpolation, collapse,
algo_options, weights, transmission,
mu_sigma, sigma, force_rPA]),
pool=pool)

if verbosity > 0:
print('emcee Ensemble sampler successful')
Expand Down

0 comments on commit 17a1cb9

Please sign in to comment.