From 54126cf1a8747b19c4a424014d486ca66bbf7c2e Mon Sep 17 00:00:00 2001 From: Collin Capano Date: Mon, 13 Jul 2020 17:14:09 +0000 Subject: [PATCH] make sure sampling parameters keep the same order --- pycbc/inference/models/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pycbc/inference/models/base.py b/pycbc/inference/models/base.py index ee2bf8a0b9d..1b4926af993 100644 --- a/pycbc/inference/models/base.py +++ b/pycbc/inference/models/base.py @@ -120,6 +120,8 @@ def __init__(self, variable_params, sampling_params, if arg not in replace_parameters] # add the sampling parameters self.sampling_params += sampling_params + # sort to make sure we have a consistent order + self.sampling_params.sort() self.sampling_transforms = sampling_transforms def logjacobian(self, **params): @@ -272,7 +274,7 @@ def read_sampling_params_from_config(cp, section_group=None, map_args = cp.get(section, args) sampling_params.update(set(map(str.strip, map_args.split(',')))) replaced_params.update(set(map(str.strip, args.split(',')))) - return list(sampling_params), list(replaced_params) + return sorted(sampling_params), sorted(replaced_params) #