From e1bbab2776feabaf16d587c72a1473ed456017c9 Mon Sep 17 00:00:00 2001 From: Moritz Huebner <moritz.huebner@ligo.org> Date: Wed, 11 Sep 2019 22:28:10 -0500 Subject: [PATCH] Fixed issue with mutable default argument --- bilby/core/grid.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bilby/core/grid.py b/bilby/core/grid.py index d53bfa1af..ee09e2fec 100644 --- a/bilby/core/grid.py +++ b/bilby/core/grid.py @@ -36,7 +36,7 @@ def grid_file_name(outdir, label, gzip=False): class Grid(object): - def __init__(self, likelihood=None, priors=dict(), grid_size=101, + def __init__(self, likelihood=None, priors=None, grid_size=101, save=False, label='no_label', outdir='.', gzip=False): """ @@ -60,6 +60,8 @@ class Grid(object): Set whether to gzip the output grid file """ + if priors is None: + priors = dict() self.likelihood = likelihood self.priors = PriorDict(priors) self.n_dims = len(priors) -- GitLab