Commit c9444176 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

propertification

parent 30f574e0
Pipeline #25048 passed with stages
in 6 minutes and 49 seconds
......@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-2017 Max-Planck-Society
# Copyright(C) 2013-2018 Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
......@@ -69,4 +69,4 @@ class HPSpaceFunctionalityTests(unittest.TestCase):
assert_equal(getattr(h, key), value)
def test_dvol(self):
assert_almost_equal(HPSpace(2).dvol(), np.pi/12)
assert_almost_equal(HPSpace(2).dvol, np.pi/12)
......@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-2017 Max-Planck-Society
# Copyright(C) 2013-2018 Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
......@@ -87,7 +87,7 @@ class LMSpaceFunctionalityTests(unittest.TestCase):
assert_equal(getattr(l, key), value)
def test_dvol(self):
assert_allclose(ift.LMSpace(5).dvol(), 1.)
assert_allclose(ift.LMSpace(5).dvol, 1.)
@expand(get_k_length_array_configs())
def test_k_length_array(self, lmax, expected):
......
......@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-2017 Max-Planck-Society
# Copyright(C) 2013-2018 Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
......@@ -98,7 +98,7 @@ class PowerSpaceConsistencyCheck(unittest.TestCase):
p = ift.PowerSpace(harmonic_partner=harmonic_partner, binbounds=bb)
assert_equal(np.bincount(ift.dobj.to_global_data(p.pindex).ravel()),
p.dvol(), err_msg='rho is not equal to pindex degeneracy')
p.dvol, err_msg='rho is not equal to pindex degeneracy')
class PowerSpaceFunctionalityTest(unittest.TestCase):
......@@ -128,8 +128,8 @@ class PowerSpaceFunctionalityTest(unittest.TestCase):
def test_dvol(self):
hp = ift.RGSpace(10, harmonic=True)
p = ift.PowerSpace(harmonic_partner=hp)
v1 = hp.dvol()
v1 = hp.dvol
v1 = hp.size*v1 if np.isscalar(v1) else np.sum(v1)
v2 = p.dvol()
v2 = p.dvol
v2 = p.size*v2 if np.isscalar(v2) else np.sum(v2)
assert_allclose(v1, v2)
......@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-2017 Max-Planck-Society
# Copyright(C) 2013-2018 Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
......@@ -116,4 +116,4 @@ class RGSpaceFunctionalityTests(unittest.TestCase):
@expand(get_dvol_configs())
def test_dvol(self, shape, distances, harmonic, power):
r = ift.RGSpace(shape=shape, distances=distances, harmonic=harmonic)
assert_allclose(r.dvol(), np.prod(r.distances)**power)
assert_allclose(r.dvol, np.prod(r.distances)**power)
Markdown is supported
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