Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
f1eeccb4
Commit
f1eeccb4
authored
Nov 06, 2017
by
Martin Reinecke
Browse files
add fill() method
parent
352cd0f7
Pipeline
#21111
passed with stage
in 4 minutes and 28 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty/field.py
View file @
f1eeccb4
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment