From 33320b95597c6f6587c85c68e6cb658c1f8a66c3 Mon Sep 17 00:00:00 2001 From: Philipp Arras <parras@mpa-garching.mpg.de> Date: Mon, 30 Jul 2018 17:31:41 +0200 Subject: [PATCH] Add make method to inverse gamma model --- nifty5/library/inverse_gamma_model.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nifty5/library/inverse_gamma_model.py b/nifty5/library/inverse_gamma_model.py index a76804e8c..68e895196 100644 --- a/nifty5/library/inverse_gamma_model.py +++ b/nifty5/library/inverse_gamma_model.py @@ -37,6 +37,12 @@ class InverseGammaModel(Model): self._q = q self._key = key + @classmethod + def make(cls, actual_position, alpha, q, key): + pos = cls.inverseIG(actual_position, alpha, q) + mf = MultiField.from_dict({key: pos}) + return cls(mf, alpha, q, key) + def at(self, position): return self.__class__(position, self._alpha, self._q, self._key) -- GitLab