diff --git a/src/gstools/field/cond_srf.py b/src/gstools/field/cond_srf.py index 9a27ec67..406c3e01 100644 --- a/src/gstools/field/cond_srf.py +++ b/src/gstools/field/cond_srf.py @@ -83,7 +83,7 @@ def __call__( seed : :class:`int` or :any:`None` or :any:`Ellipsis`, optional the seed of the random number generator. If :any:`None`, a random seed is used. If :any:`Ellipsis`, - the actual seed will be kept. Default: :any:`Ellipsis` + the current seed will be kept. Default: :any:`Ellipsis` mesh_type : :class:`str` 'structured' / 'unstructured' post_process : :class:`bool`, optional diff --git a/src/gstools/field/generator.py b/src/gstools/field/generator.py index e48cfdef..b25b8d8a 100644 --- a/src/gstools/field/generator.py +++ b/src/gstools/field/generator.py @@ -64,7 +64,7 @@ def update(self, model=None, seed=...): seed : :class:`int` or :any:`None` or :any:`Ellipsis`, optional the seed of the random number generator. If :any:`None`, a random seed is used. If :any:`Ellipsis`, - the actual seed will be kept. Default: :any:`Ellipsis` + the current seed will be kept. Default: :any:`Ellipsis` """ @abstractmethod @@ -247,21 +247,18 @@ def update(self, model=None, seed=...): seed : :class:`int` or :any:`None` or :any:`Ellipsis`, optional the seed of the random number generator. If :any:`None`, a random seed is used. If :any:`Ellipsis`, - the actual seed will be kept. Default: :any:`Ellipsis` + the current seed will be kept. Default: :any:`Ellipsis` """ # check if a new model is given if isinstance(model, CovModel): if self.model != model: self._model = dcp(model) - if seed is None or seed is not Ellipsis: - self.reset_seed(seed) - else: - self.reset_seed(self._seed) + self.reset_seed(self._seed if seed is Ellipsis else seed) # just update the seed, if its a new one - elif seed is None or seed is not Ellipsis: + elif seed is not Ellipsis: self.seed = seed # or just update the seed, when no model is given - elif model is None and (seed is None or seed is not Ellipsis): + elif model is None and seed is not Ellipsis: if isinstance(self._model, CovModel): self.seed = seed else: @@ -296,13 +293,13 @@ def reset_seed(self, seed=...): seed : :class:`int` or :any:`None` or :any:`Ellipsis`, optional the seed of the random number generator. If :any:`None`, a random seed is used. If :any:`Ellipsis`, - the actual seed will be kept. Default: :any:`Ellipsis` + the current seed will be kept. Default: :any:`Ellipsis` Notes ----- Even if the given seed is the present one, modes will be recalculated. """ - if seed is None or seed is not Ellipsis: + if seed is not Ellipsis: self._seed = seed self._rng = RNG(self._seed) # normal distributed samples for randmeth @@ -351,7 +348,7 @@ def seed(self): @seed.setter def seed(self, new_seed): - if new_seed is not self._seed: + if new_seed != self._seed: self.reset_seed(new_seed) @property diff --git a/src/gstools/field/srf.py b/src/gstools/field/srf.py index 39a056d0..15d95f26 100644 --- a/src/gstools/field/srf.py +++ b/src/gstools/field/srf.py @@ -121,7 +121,7 @@ def __call__( seed : :class:`int` or :any:`None` or :any:`Ellipsis`, optional the seed of the random number generator. If :any:`None`, a random seed is used. If :any:`Ellipsis`, - the actual seed will be kept. Default: :any:`Ellipsis` + the current seed will be kept. Default: :any:`Ellipsis` point_volumes : :class:`float` or :class:`numpy.ndarray` If your evaluation points for the field are coming from a mesh, they are probably representing a certain element volume.