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
c9c5cfe0
Commit
c9c5cfe0
authored
Oct 05, 2017
by
Martin Reinecke
Browse files
tweaks
parent
96be7ff9
Pipeline
#19277
passed with stage
in 4 minutes and 42 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty/minimization/iteration_controlling/iteration_controller.py
View file @
c9c5cfe0
...
...
@@ -37,7 +37,7 @@ class IterationController(with_metaclass(NiftyMeta, type('NewBase',
The concrete convergence criteria can be chosen by inheriting from this
class; the implementer has full flexibility to use whichever criteria are
appropriate for a particular problem - as ong as they can be computed from
appropriate for a particular problem - as
l
ong as they can be computed from
the information passed to the controller during the iteration process.
"""
...
...
nifty/sugar.py
View file @
c9c5cfe0
...
...
@@ -33,12 +33,19 @@ __all__ = ['create_power_field',
def
create_power_field
(
domain
,
power_spectrum
,
dtype
=
None
):
if
not
callable
(
power_spectrum
):
raise
TypeError
(
"power_spectrum must be callable"
)
power_domain
=
PowerSpace
(
domain
)
fp
=
Field
(
power_domain
,
val
=
power_spectrum
(
power_domain
.
k_lengths
),
dtype
=
dtype
)
if
not
callable
(
power_spectrum
):
# we have a Field living on a PowerSpace
if
not
isinstance
(
power_spectrum
,
Field
):
raise
TypeError
(
"Field object expected"
)
if
len
(
power_spectrum
.
domain
)
!=
1
:
raise
ValueError
(
"exactly one domain required"
)
if
not
isinstance
(
power_spectrum
.
domain
[
0
],
PowerSpace
):
raise
TypeError
(
"PowerSpace required"
)
power_domain
=
power_spectrum
.
domain
[
0
]
fp
=
Field
(
power_domain
,
val
=
power_spectrum
.
val
,
dtype
=
dtype
)
else
:
power_domain
=
PowerSpace
(
domain
)
fp
=
Field
(
power_domain
,
val
=
power_spectrum
(
power_domain
.
k_lengths
),
dtype
=
dtype
)
f
=
fp
.
power_synthesize_special
()
if
not
issubclass
(
fp
.
dtype
.
type
,
np
.
complexfloating
):
...
...
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