Skip to content
Snippets Groups Projects
Commit f1eeccb4 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

add fill() method

parent 352cd0f7
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -158,8 +158,6 @@ class Field(object): ...@@ -158,8 +158,6 @@ class Field(object):
return val.dtype return val.dtype
return np.result_type(val, np.float64) return np.result_type(val, np.float64)
# ---Factory methods---
@staticmethod @staticmethod
def from_random(random_type, domain, dtype=np.float64, **kwargs): def from_random(random_type, domain, dtype=np.float64, **kwargs):
""" Draws a random field with the given parameters. """ Draws a random field with the given parameters.
...@@ -187,6 +185,9 @@ class Field(object): ...@@ -187,6 +185,9 @@ class Field(object):
val=dobj.from_random(random_type, dtype=dtype, val=dobj.from_random(random_type, dtype=dtype,
shape=domain.shape, **kwargs)) shape=domain.shape, **kwargs))
def fill(self, fill_value):
self._val.fill(fill_value)
# ---Properties--- # ---Properties---
@property @property
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment