Skip to content
Snippets Groups Projects
Commit ff522248 authored by Colm Talbot's avatar Colm Talbot Committed by Colm Talbot
Browse files

DEPRECATE: remove polychord from testing

parent 4f7ab466
No related branches found
No related tags found
No related merge requests found
......@@ -13,17 +13,6 @@ RUN /bin/bash -c "source activate ${{conda_env}}"
RUN mamba info
RUN python --version
# Install Polychord
RUN apt-get update --allow-releaseinfo-change
RUN apt-get install -y build-essential
RUN apt-get install -y libblas3 libblas-dev
RUN apt-get install -y liblapack3 liblapack-dev
RUN apt-get install -y libatlas3-base libatlas-base-dev
RUN apt-get install -y gfortran
RUN git clone https://github.com/PolyChord/PolyChordLite.git \
&& (cd PolyChordLite && python setup.py --no-mpi install)
# Add the ROQ data to the image
RUN mkdir roq_basis \
&& cd roq_basis \
......
......@@ -15,17 +15,6 @@ RUN /bin/bash -c "source activate ${conda_env}"
RUN mamba info
RUN python --version
# Install Polychord
RUN apt-get update --allow-releaseinfo-change
RUN apt-get install -y build-essential
RUN apt-get install -y libblas3 libblas-dev
RUN apt-get install -y liblapack3 liblapack-dev
RUN apt-get install -y libatlas3-base libatlas-base-dev
RUN apt-get install -y gfortran
RUN git clone https://github.com/PolyChord/PolyChordLite.git \
&& (cd PolyChordLite && python setup.py --no-mpi install)
# Add the ROQ data to the image
RUN mkdir roq_basis \
&& cd roq_basis \
......
......@@ -15,17 +15,6 @@ RUN /bin/bash -c "source activate ${conda_env}"
RUN mamba info
RUN python --version
# Install Polychord
RUN apt-get update --allow-releaseinfo-change
RUN apt-get install -y build-essential
RUN apt-get install -y libblas3 libblas-dev
RUN apt-get install -y liblapack3 liblapack-dev
RUN apt-get install -y libatlas3-base libatlas-base-dev
RUN apt-get install -y gfortran
RUN git clone https://github.com/PolyChord/PolyChordLite.git \
&& (cd PolyChordLite && python setup.py --no-mpi install)
# Add the ROQ data to the image
RUN mkdir roq_basis \
&& cd roq_basis \
......
import unittest
from unittest.mock import MagicMock
import numpy as np
import bilby
class TestPolyChord(unittest.TestCase):
def setUp(self):
self.likelihood = MagicMock()
self.priors = bilby.core.prior.PriorDict(
dict(a=bilby.core.prior.Uniform(0, 1), b=bilby.core.prior.Uniform(0, 1))
)
self.sampler = bilby.core.sampler.PyPolyChord(
self.likelihood,
self.priors,
outdir="outdir",
label="polychord",
use_ratio=False,
plot=False,
skip_import_verification=True,
)
def tearDown(self):
del self.likelihood
del self.priors
del self.sampler
def test_default_kwargs(self):
expected = dict(
use_polychord_defaults=False,
nlive=self.sampler.ndim * 25,
num_repeats=self.sampler.ndim * 5,
nprior=-1,
do_clustering=True,
feedback=1,
precision_criterion=0.001,
logzero=-1e30,
max_ndead=-1,
boost_posterior=0.0,
posteriors=True,
equals=True,
cluster_posteriors=True,
write_resume=True,
write_paramnames=False,
read_resume=True,
write_stats=True,
write_live=True,
write_dead=True,
write_prior=True,
compression_factor=np.exp(-1),
base_dir="outdir",
file_root="polychord",
seed=-1,
grade_dims=list([self.sampler.ndim]),
grade_frac=list([1.0] * len([self.sampler.ndim])),
nlives={},
)
self.sampler._setup_dynamic_defaults()
self.assertDictEqual(expected, self.sampler.kwargs)
def test_translate_kwargs(self):
expected = dict(
use_polychord_defaults=False,
nlive=123,
num_repeats=self.sampler.ndim * 5,
nprior=-1,
do_clustering=True,
feedback=1,
precision_criterion=0.001,
logzero=-1e30,
max_ndead=-1,
boost_posterior=0.0,
posteriors=True,
equals=True,
cluster_posteriors=True,
write_resume=True,
write_paramnames=False,
read_resume=True,
write_stats=True,
write_live=True,
write_dead=True,
write_prior=True,
compression_factor=np.exp(-1),
base_dir="outdir",
file_root="polychord",
seed=-1,
grade_dims=list([self.sampler.ndim]),
grade_frac=list([1.0] * len([self.sampler.ndim])),
nlives={},
)
self.sampler._setup_dynamic_defaults()
for equiv in bilby.core.sampler.base_sampler.NestedSampler.npoints_equiv_kwargs:
new_kwargs = self.sampler.kwargs.copy()
del new_kwargs["nlive"]
new_kwargs[equiv] = 123
self.sampler.kwargs = new_kwargs
self.assertDictEqual(expected, self.sampler.kwargs)
if __name__ == "__main__":
unittest.main()
......@@ -55,7 +55,6 @@ _sampler_kwargs = dict(
PTMCMCSampler=dict(Niter=101, burn=100, covUpdate=100, isave=100),
pymc=dict(draws=50, tune=50, n_init=250),
pymultinest=dict(nlive=100),
pypolychord=dict(nlive=100),
ultranest=dict(nlive=100, temporary_directory=False),
zeus=dict(nwalkers=10, iterations=100)
)
......@@ -65,7 +64,7 @@ sampler_imports = dict(
dynamic_dynesty="dynesty"
)
no_pool_test = ["dnest4", "pymultinest", "nestle", "ptmcmcsampler", "pypolychord", "ultranest", "pymc"]
no_pool_test = ["dnest4", "pymultinest", "nestle", "ptmcmcsampler", "ultranest", "pymc"]
def slow_func(x, m, c):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment