From a2e38e732c976e42c942a155ec00addab213aa6f Mon Sep 17 00:00:00 2001 From: MoritzThomasHuebner <email@moritz-huebner.de> Date: Thu, 23 Aug 2018 15:41:31 +1000 Subject: [PATCH] Replaced Analytical1DLikelihood._infer_parameters_from_function with utils function that is also used in the waveform generator --- tupak/core/likelihood.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/tupak/core/likelihood.py b/tupak/core/likelihood.py index b4bfaace9..531a8142c 100644 --- a/tupak/core/likelihood.py +++ b/tupak/core/likelihood.py @@ -3,6 +3,7 @@ from __future__ import division, print_function import inspect import numpy as np from scipy.special import gammaln +from tupak.core.utils import infer_parameters_from_function class Likelihood(object): @@ -61,7 +62,7 @@ class Analytical1DLikelihood(Likelihood): """ def __init__(self, x, y, func): - parameters = self._infer_parameters_from_function(func) + parameters = infer_parameters_from_function(func) Likelihood.__init__(self, dict.fromkeys(parameters)) self.x = x self.y = y @@ -83,15 +84,6 @@ class Analytical1DLikelihood(Likelihood): """ Makes function_keys read_only """ return self.__function_keys - @staticmethod - def _infer_parameters_from_function(func): - """ Infers the arguments of function (except the first arg which is - assumed to be the dep. variable) - """ - parameters = inspect.getargspec(func).args - parameters.pop(0) - return parameters - @property def n(self): """ The number of data points """ -- GitLab