From f1eeccb4b1cadd26e33c1e24a2192025bbc60c4c Mon Sep 17 00:00:00 2001 From: Martin Reinecke <martin@mpa-garching.mpg.de> Date: Mon, 6 Nov 2017 15:27:43 +0100 Subject: [PATCH] add fill() method --- nifty/field.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nifty/field.py b/nifty/field.py index 87a2e5b9b..0edb52d07 100644 --- a/nifty/field.py +++ b/nifty/field.py @@ -158,8 +158,6 @@ class Field(object): return val.dtype return np.result_type(val, np.float64) - # ---Factory methods--- - @staticmethod def from_random(random_type, domain, dtype=np.float64, **kwargs): """ Draws a random field with the given parameters. @@ -187,6 +185,9 @@ class Field(object): val=dobj.from_random(random_type, dtype=dtype, shape=domain.shape, **kwargs)) + def fill(self, fill_value): + self._val.fill(fill_value) + # ---Properties--- @property -- GitLab