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
c7e32d13
Commit
c7e32d13
authored
Sep 29, 2017
by
Martin Reinecke
Browse files
no copy() for spaces
parent
91299591
Pipeline
#18993
passed with stage
in 4 minutes and 22 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty/spaces/gl_space/gl_space.py
View file @
c7e32d13
...
@@ -109,9 +109,6 @@ class GLSpace(Space):
...
@@ -109,9 +109,6 @@ class GLSpace(Space):
def
total_volume
(
self
):
def
total_volume
(
self
):
return
4
*
np
.
pi
return
4
*
np
.
pi
def
copy
(
self
):
return
self
.
__class__
(
nlat
=
self
.
nlat
,
nlon
=
self
.
nlon
)
def
scalar_weight
(
self
):
def
scalar_weight
(
self
):
return
None
return
None
...
...
nifty/spaces/hp_space/hp_space.py
View file @
c7e32d13
...
@@ -104,9 +104,6 @@ class HPSpace(Space):
...
@@ -104,9 +104,6 @@ class HPSpace(Space):
def
total_volume
(
self
):
def
total_volume
(
self
):
return
4
*
np
.
pi
return
4
*
np
.
pi
def
copy
(
self
):
return
self
.
__class__
(
nside
=
self
.
nside
)
def
scalar_weight
(
self
):
def
scalar_weight
(
self
):
return
np
.
pi
/
(
3
*
self
.
_nside
*
self
.
_nside
)
return
np
.
pi
/
(
3
*
self
.
_nside
*
self
.
_nside
)
...
...
nifty/spaces/lm_space/lm_space.py
View file @
c7e32d13
...
@@ -114,9 +114,6 @@ class LMSpace(Space):
...
@@ -114,9 +114,6 @@ class LMSpace(Space):
# the individual pixels have a fixed volume of 1.
# the individual pixels have a fixed volume of 1.
return
np
.
float64
(
self
.
dim
)
return
np
.
float64
(
self
.
dim
)
def
copy
(
self
):
return
self
.
__class__
(
lmax
=
self
.
lmax
)
def
scalar_weight
(
self
):
def
scalar_weight
(
self
):
return
1.
return
1.
...
...
nifty/spaces/power_space/power_space.py
View file @
c7e32d13
...
@@ -204,10 +204,6 @@ class PowerSpace(Space):
...
@@ -204,10 +204,6 @@ class PowerSpace(Space):
# every power-pixel has a volume of 1
# every power-pixel has a volume of 1
return
float
(
reduce
(
lambda
x
,
y
:
x
*
y
,
self
.
pindex
.
shape
))
return
float
(
reduce
(
lambda
x
,
y
:
x
*
y
,
self
.
pindex
.
shape
))
def
copy
(
self
):
return
self
.
__class__
(
harmonic_partner
=
self
.
harmonic_partner
,
binbounds
=
self
.
_binbounds
)
def
scalar_weight
(
self
):
def
scalar_weight
(
self
):
return
None
return
None
...
...
nifty/spaces/rg_space/rg_space.py
View file @
c7e32d13
...
@@ -110,11 +110,6 @@ class RGSpace(Space):
...
@@ -110,11 +110,6 @@ class RGSpace(Space):
def
total_volume
(
self
):
def
total_volume
(
self
):
return
self
.
dim
*
self
.
_wgt
return
self
.
dim
*
self
.
_wgt
def
copy
(
self
):
return
self
.
__class__
(
shape
=
self
.
shape
,
distances
=
self
.
distances
,
harmonic
=
self
.
harmonic
)
def
scalar_weight
(
self
):
def
scalar_weight
(
self
):
return
self
.
_wgt
return
self
.
_wgt
...
...
nifty/spaces/space/space.py
View file @
c7e32d13
...
@@ -77,17 +77,6 @@ class Space(DomainObject):
...
@@ -77,17 +77,6 @@ class Space(DomainObject):
raise
NotImplementedError
(
raise
NotImplementedError
(
"There is no generic volume for the Space base class."
)
"There is no generic volume for the Space base class."
)
@
abc
.
abstractmethod
def
copy
(
self
):
""" Returns a copy of this Space instance.
Returns
-------
Space
A copy of this instance.
"""
return
self
.
__class__
()
def
get_k_length_array
(
self
):
def
get_k_length_array
(
self
):
""" The length of the k vector for every pixel.
""" The length of the k vector for every pixel.
This method is only implemented for harmonic spaces.
This method is only implemented for harmonic spaces.
...
...
test/test_spaces/test_interface.py
View file @
c7e32d13
...
@@ -46,13 +46,6 @@ class SpaceInterfaceTests(unittest.TestCase):
...
@@ -46,13 +46,6 @@ class SpaceInterfaceTests(unittest.TestCase):
*
method_expected_type
[
1
:
-
1
]))
is
*
method_expected_type
[
1
:
-
1
]))
is
method_expected_type
[
-
1
])
method_expected_type
[
-
1
])
@
expand
([[
space
]
for
space
in
generate_spaces
()])
def
test_copy
(
self
,
space
):
# make sure it's a deep copy
assert_
(
space
is
not
space
.
copy
())
# make sure contents are the same
assert_equal
(
space
,
space
.
copy
())
@
expand
([[
space
]
for
space
in
generate_spaces
()])
@
expand
([[
space
]
for
space
in
generate_spaces
()])
def
test_repr
(
self
,
space
):
def
test_repr
(
self
,
space
):
assert_
(
space
==
eval
(
space
.
__repr__
()))
assert_
(
space
==
eval
(
space
.
__repr__
()))
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