Skip to content
Snippets Groups Projects

Fixed issue with mutable default argument

Merged Moritz Huebner requested to merge fix_grid_dict_default into master
1 file
+ 3
1
Compare changes
  • Side-by-side
  • Inline
+ 3
1
@@ -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)
Loading