Commit 62e87d98 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

Merge branch 'NIFTy_5' into parallizing_mirrored_samples

parents 3b331b89 4f68d243
Pipeline #53887 canceled with stages
in 3 minutes and 29 seconds
......@@ -66,8 +66,7 @@ def get_k_length_array_configs():
@pmp('attribute', ['lmax', 'mmax', 'size'])
def test_property_ret_type(attribute):
l = ift.LMSpace(7, 5)
assert_(isinstance(getattr(l, attribute), int))
assert_(isinstance(getattr(ift.LMSpace(7, 5), attribute), int))
@pmp('lmax, mmax, expected', CONSTRUCTOR_CONFIGS)
......@@ -76,9 +75,8 @@ def test_constructor(lmax, mmax, expected):
with assert_raises(expected['error']):
ift.LMSpace(lmax, mmax)
else:
l = ift.LMSpace(lmax, mmax)
for key, value in expected.items():
assert_equal(getattr(l, key), value)
assert_equal(getattr(ift.LMSpace(lmax, mmax), key), value)
def test_dvol():
......@@ -87,5 +85,5 @@ def test_dvol():
@pmp('lmax, expected', get_k_length_array_configs())
def test_k_length_array(lmax, expected):
l = ift.LMSpace(lmax)
assert_allclose(l.get_k_length_array().to_global_data(), expected)
assert_allclose(ift.LMSpace(lmax).get_k_length_array().to_global_data(),
expected)
......@@ -17,11 +17,12 @@
from itertools import chain, product
import pytest
import nifty5 as ift
import numpy as np
import pytest
from numpy.testing import assert_, assert_allclose, assert_equal, assert_raises
import nifty5 as ift
pmp = pytest.mark.parametrize
HARMONIC_SPACES = [
......
......@@ -16,8 +16,7 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik.
import numpy as np
import pytest
from numpy.testing import assert_allclose, assert_equal, assert_raises
from numpy.testing import assert_equal
import nifty5 as ift
......@@ -25,8 +24,8 @@ import nifty5 as ift
def test_get_signal_variance():
space = ift.RGSpace(3)
hspace = space.get_default_codomain()
spec1 = lambda x: np.ones_like(x)
assert_equal(ift.get_signal_variance(spec1, hspace), 3.)
sv = ift.get_signal_variance(lambda x: np.ones_like(x), hspace)
assert_equal(sv, 3.)
space = ift.RGSpace(3, distances=1.)
hspace = space.get_default_codomain()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment