From e72048af6c51fedb4615fd2c19e94921861c25fa Mon Sep 17 00:00:00 2001 From: Adam Ormondroyd <52655393+AdamOrmondroyd@users.noreply.github.com> Date: Wed, 28 Feb 2024 12:59:55 +0000 Subject: [PATCH] create the parameter names file earlier (#118) * create paramnames file before running * need the base dir and file root first! * version bump --- README.rst | 2 +- pypolychord/__init__.py | 2 +- pypolychord/polychord.py | 12 ++++++------ src/polychord/feedback.f90 | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.rst b/README.rst index 407e4b4c..4c852fdb 100644 --- a/README.rst +++ b/README.rst @@ -5,7 +5,7 @@ :target: https://arxiv.org/abs/1506.00171 :alt: Open-access paper -PolyChord v 1.22.0 +PolyChord v 1.22.1 Will Handley, Mike Hobson & Anthony Lasenby diff --git a/pypolychord/__init__.py b/pypolychord/__init__.py index d786aab1..738345c0 100644 --- a/pypolychord/__init__.py +++ b/pypolychord/__init__.py @@ -1,3 +1,3 @@ -__version__ = "1.22.0" +__version__ = "1.22.1" from pypolychord.settings import PolyChordSettings from pypolychord.polychord import run_polychord, run diff --git a/pypolychord/polychord.py b/pypolychord/polychord.py index 6e6ca398..947fe4b7 100644 --- a/pypolychord/polychord.py +++ b/pypolychord/polychord.py @@ -566,6 +566,12 @@ def run(loglikelihood, nDims, **kwargs): if rank == 0: (Path(kwargs['base_dir']) / kwargs['cluster_dir']).mkdir( parents=True, exist_ok=True) + if paramnames is not None: + PolyChordOutput.make_paramnames_file( + paramnames, + Path(kwargs['base_dir']) / + (kwargs['file_root'] + ".paramnames")) + if 'cube_samples' in kwargs: _make_resume_file(loglikelihood, kwargs['prior'], **kwargs) @@ -630,12 +636,6 @@ def wrap_prior(cube, theta): if 'cube_samples' in kwargs: kwargs['read_resume'] = read_resume - if paramnames is not None: - PolyChordOutput.make_paramnames_file( - paramnames, - Path(kwargs['base_dir']) / - (kwargs['file_root'] + ".paramnames")) - try: import anesthetic except ImportError: diff --git a/src/polychord/feedback.f90 b/src/polychord/feedback.f90 index 370c1c38..571c1289 100644 --- a/src/polychord/feedback.f90 +++ b/src/polychord/feedback.f90 @@ -28,7 +28,7 @@ subroutine write_opening_statement(settings) write(stdout_unit,'("")') write(stdout_unit,'("PolyChord: Next Generation Nested Sampling")') write(stdout_unit,'("copyright: Will Handley, Mike Hobson & Anthony Lasenby")') - write(stdout_unit,'(" version: 1.22.0")') + write(stdout_unit,'(" version: 1.22.1")') write(stdout_unit,'(" release: 10th Jan 2024")') write(stdout_unit,'(" email: wh260@mrao.cam.ac.uk")') write(stdout_unit,'("")')