Commit e035cede authored by Colm Talbot's avatar Colm Talbot

Merge branch 'waveform_generator_conversion_change' into 'master'

Made default parameter conversion a static method rather than a lamda expression

See merge request lscsoft/bilby!529
parents 3c896cda d74b901a
Pipeline #67269 passed with stages
in 14 minutes and 54 seconds
......@@ -57,7 +57,7 @@ class WaveformGenerator(object):
self.time_domain_source_model = time_domain_source_model
self.source_parameter_keys = self.__parameters_from_source_model()
if parameter_conversion is None:
self.parameter_conversion = lambda params: (params, [])
self.parameter_conversion = self._default_parameter_conversion
self.parameter_conversion = parameter_conversion
if waveform_arguments is not None:
......@@ -77,7 +77,7 @@ class WaveformGenerator(object):
tdsm_name = self.time_domain_source_model.__name__
tdsm_name = None
if self.parameter_conversion.__name__ == '<lambda>':
if self.parameter_conversion.__name__ == '_default_parameter_conversion':
param_conv_name = None
param_conv_name = self.parameter_conversion.__name__
......@@ -235,3 +235,7 @@ class WaveformGenerator(object):
raise AttributeError('Either time or frequency domain source '
'model must be provided.')
return set(utils.infer_parameters_from_function(model))
def _default_parameter_conversion(params):
return params, []
Markdown is supported
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