Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Neel Shah
NIFTy
Commits
9b47dc10
Commit
9b47dc10
authored
Jun 11, 2021
by
Philipp Arras
Browse files
nifty7 -> nifty8
parent
3a83451d
Changes
95
Hide whitespace changes
Inline
Side-by-side
src/sugar.py
View file @
9b47dc10
...
...
@@ -109,7 +109,7 @@ def power_analyze(field, spaces=None, binbounds=None,
Creates a PowerSpace for the space addressed by `spaces` with the
given binning and computes the power spectrum as a
:class:`~nifty
7
.field.Field` over this PowerSpace. This can only
:class:`~nifty
8
.field.Field` over this PowerSpace. This can only
be done if the subspace to be analyzed is a harmonic space. The
resulting field has the same units as the square of the initial
field.
...
...
@@ -603,8 +603,8 @@ def is_operator(obj):
Note
----
A simple `isinstance(obj, ift.Operator)` does not give the expected result
because, e.g., :class:`~nifty
7
.field.Field` inherits from
:class:`~nifty
7
.operators.operator.Operator`.
because, e.g., :class:`~nifty
8
.field.Field` inherits from
:class:`~nifty
8
.operators.operator.Operator`.
"""
return
isinstance
(
obj
,
Operator
)
and
obj
.
val
is
None
...
...
@@ -621,8 +621,8 @@ def is_fieldlike(obj):
----
A simple `isinstance(obj, ift.Field)` does not give the expected result
because users might have implemented another class which behaves field-like
but is not an instance of :class:`~nifty
7
.field.Field`. Also note that
instances of :class:`~nifty
7
.linearization.Linearization` behave
but is not an instance of :class:`~nifty
8
.field.Field`. Also note that
instances of :class:`~nifty
8
.linearization.Linearization` behave
field-like.
"""
return
isinstance
(
obj
,
Operator
)
and
obj
.
val
is
not
None
src/utilities.py
View file @
9b47dc10
...
...
@@ -395,7 +395,7 @@ def lognormal_moments(mean, sigma, N=0):
"""Calculates the parameters for a normal distribution `n(x)`
such that `exp(n)(x)` has the mean and standard deviation given.
Used in :func:`~nifty
7
.normal_operators.LognormalTransform`."""
Used in :func:`~nifty
8
.normal_operators.LognormalTransform`."""
mean
,
sigma
=
(
value_reshaper
(
param
,
N
)
for
param
in
(
mean
,
sigma
))
if
not
np
.
all
(
mean
>
0
):
raise
ValueError
(
"mean must be greater 0; got {!r}"
.
format
(
mean
))
...
...
test/common.py
View file @
9b47dc10
...
...
@@ -27,10 +27,10 @@ def list2fixture(lst):
def
setup_function
():
import
nifty
7
as
ift
import
nifty
8
as
ift
ift
.
random
.
push_sseq_from_seed
(
42
)
def
teardown_function
():
import
nifty
7
as
ift
import
nifty
8
as
ift
ift
.
random
.
pop_sseq
()
test/test_energy_gradients.py
View file @
9b47dc10
...
...
@@ -18,7 +18,7 @@
import
numpy
as
np
import
pytest
import
nifty
7
as
ift
import
nifty
8
as
ift
from
.common
import
list2fixture
,
setup_function
,
teardown_function
...
...
test/test_extra.py
View file @
9b47dc10
...
...
@@ -19,7 +19,7 @@ from time import time
import
numpy
as
np
import
pytest
import
nifty
7
as
ift
import
nifty
8
as
ift
from
.common
import
list2fixture
,
setup_function
,
teardown_function
...
...
test/test_field.py
View file @
9b47dc10
...
...
@@ -19,7 +19,7 @@ import numpy as np
import
pytest
from
numpy.testing
import
assert_allclose
,
assert_equal
,
assert_raises
import
nifty
7
as
ift
import
nifty
8
as
ift
from
.common
import
setup_function
,
teardown_function
...
...
test/test_gaussian_energy.py
View file @
9b47dc10
...
...
@@ -18,7 +18,7 @@
import
numpy
as
np
import
pytest
import
nifty
7
as
ift
import
nifty
8
as
ift
from
.common
import
setup_function
,
teardown_function
...
...
test/test_kl.py
View file @
9b47dc10
...
...
@@ -19,8 +19,8 @@ import numpy as np
import
pytest
from
numpy.testing
import
assert_allclose
,
assert_raises
import
nifty
7
as
ift
from
nifty
7
import
myassert
import
nifty
8
as
ift
from
nifty
8
import
myassert
from
.common
import
setup_function
,
teardown_function
...
...
test/test_linearization.py
View file @
9b47dc10
...
...
@@ -19,7 +19,7 @@ import numpy as np
import
pytest
from
numpy.testing
import
assert_allclose
import
nifty
7
as
ift
import
nifty
8
as
ift
from
.common
import
setup_function
,
teardown_function
...
...
test/test_minimizers.py
View file @
9b47dc10
...
...
@@ -19,7 +19,7 @@ import numpy as np
import
pytest
from
numpy.testing
import
assert_allclose
,
assert_equal
import
nifty
7
as
ift
import
nifty
8
as
ift
from
.common
import
setup_function
,
teardown_function
...
...
test/test_mpi/test_kl.py
View file @
9b47dc10
...
...
@@ -20,7 +20,7 @@ import pytest
from
mpi4py
import
MPI
from
numpy.testing
import
assert_equal
,
assert_raises
import
nifty
7
as
ift
import
nifty
8
as
ift
from
..common
import
setup_function
,
teardown_function
...
...
test/test_multi_field.py
View file @
9b47dc10
...
...
@@ -18,7 +18,7 @@
import
numpy
as
np
from
numpy.testing
import
assert_allclose
,
assert_equal
import
nifty
7
as
ift
import
nifty
8
as
ift
from
.common
import
setup_function
,
teardown_function
...
...
test/test_operator_tree_optimiser.py
View file @
9b47dc10
...
...
@@ -21,7 +21,7 @@ from copy import deepcopy
import
numpy
as
np
from
numpy.testing
import
assert_allclose
import
nifty
7
as
ift
import
nifty
8
as
ift
class
CountingOp
(
ift
.
Operator
):
...
...
test/test_operators/test_adjoint.py
View file @
9b47dc10
...
...
@@ -18,7 +18,7 @@
import
numpy
as
np
import
pytest
import
nifty
7
as
ift
import
nifty
8
as
ift
from
..common
import
list2fixture
,
setup_function
,
teardown_function
...
...
test/test_operators/test_complex_consistency.py
View file @
9b47dc10
...
...
@@ -17,7 +17,7 @@
import
numpy
as
np
import
nifty
7
as
ift
import
nifty
8
as
ift
Nsamp
=
20000
np
.
random
.
seed
(
42
)
...
...
test/test_operators/test_composed_operator.py
View file @
9b47dc10
...
...
@@ -17,7 +17,7 @@
from
numpy.testing
import
assert_allclose
,
assert_equal
import
nifty
7
as
ift
import
nifty
8
as
ift
from
..common
import
list2fixture
,
setup_function
,
teardown_function
...
...
test/test_operators/test_conjugation_operator.py
View file @
9b47dc10
...
...
@@ -18,7 +18,7 @@
import
numpy
as
np
from
numpy.testing
import
assert_allclose
import
nifty
7
as
ift
import
nifty
8
as
ift
from
..common
import
setup_function
,
teardown_function
...
...
test/test_operators/test_contraction_operator.py
View file @
9b47dc10
...
...
@@ -18,7 +18,7 @@
import
numpy
as
np
from
numpy.testing
import
assert_allclose
import
nifty
7
as
ift
import
nifty
8
as
ift
from
..common
import
setup_function
,
teardown_function
...
...
test/test_operators/test_convolution_operators.py
View file @
9b47dc10
...
...
@@ -18,7 +18,7 @@
import
numpy
as
np
from
numpy.testing
import
assert_allclose
import
nifty
7
as
ift
import
nifty
8
as
ift
from
..common
import
list2fixture
,
setup_function
,
teardown_function
...
...
test/test_operators/test_correlated_fields.py
View file @
9b47dc10
...
...
@@ -19,7 +19,7 @@ import numpy as np
import
pytest
from
numpy.testing
import
assert_allclose
import
nifty
7
as
ift
import
nifty
8
as
ift
from
..common
import
setup_function
,
teardown_function
...
...
Prev
1
2
3
4
5
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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