Commit df4665b2 authored by Goran Jelic-Cizmek's avatar Goran Jelic-Cizmek
Browse files

`set_parameters` takes kwargs instead of a dict

parent 0bf3502d
......@@ -100,7 +100,7 @@ cdef class Coffe:
self._power_spectrum_flag = 0
if kwargs:
self.set_parameters(kwargs)
self.set_parameters(**kwargs)
def _free_background(self):
......@@ -197,14 +197,10 @@ cdef class Coffe:
return writable
def set_parameters(self, value : dict):
def set_parameters(self, **value):
"""
Bulk setter of parameters.
The passed object _must_ be a dictionary with strings as keys.
"""
if not isinstance(value, dict):
raise TypeError
for key in value:
if not hasattr(self, key):
raise AttributeError(
......
......@@ -123,7 +123,8 @@ class TestCoffe:
def test_covariance_multipoles(self):
cosmo = coffe.Coffe(
cosmo = coffe.Coffe()
cosmo.set_parameters(
has_density=True,
has_rsd=True,
number_density=[1e-3],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment