Skip to content
GitLab
Menu
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
27b869ee
Commit
27b869ee
authored
Jan 24, 2017
by
Theo Steininger
Browse files
Modified the dtype defaults for spaces.
parent
4d7e7b46
Changes
5
Hide whitespace changes
Inline
Side-by-side
nifty/spaces/gl_space/gl_space.py
View file @
27b869ee
...
...
@@ -71,7 +71,7 @@ class GLSpace(Space):
# ---Overwritten properties and methods---
def
__init__
(
self
,
nlat
=
2
,
nlon
=
None
,
dtype
=
np
.
dtype
(
'float'
)
):
def
__init__
(
self
,
nlat
=
2
,
nlon
=
None
,
dtype
=
None
):
"""
Sets the attributes for a gl_space class instance.
...
...
nifty/spaces/hp_space/hp_space.py
View file @
27b869ee
...
...
@@ -96,7 +96,7 @@ class HPSpace(Space):
# ---Overwritten properties and methods---
def
__init__
(
self
,
nside
=
2
,
dtype
=
np
.
dtype
(
'float'
)
):
def
__init__
(
self
,
nside
=
2
,
dtype
=
None
):
"""
Sets the attributes for a hp_space class instance.
...
...
nifty/spaces/lm_space/lm_space.py
View file @
27b869ee
...
...
@@ -74,7 +74,7 @@ class LMSpace(Space):
Pixel volume of the :py:class:`lm_space`, which is always 1.
"""
def
__init__
(
self
,
lmax
,
dtype
=
np
.
dtype
(
'complex128'
)
):
def
__init__
(
self
,
lmax
,
dtype
=
None
):
"""
Sets the attributes for an lm_space class instance.
...
...
@@ -131,11 +131,12 @@ class LMSpace(Space):
@
property
def
dim
(
self
):
l
=
self
.
lmax
m
=
self
.
mmax
# the LMSpace consist of the full triangle (including -m's!),
# minus two little triangles if mmax < lmax
# dim = (((2*(l+1)-1)+1)**2/4 - 2 * (l-m)(l-m+1)/2
return
np
.
int
((
l
+
1
)
**
2
-
(
l
-
m
)
*
(
l
-
m
+
1.
))
# dim = np.int((l+1)**2 - (l-m)*(l-m+1.))
# We fix l == m
return
np
.
int
((
l
+
1
)
**
2
)
@
property
def
total_volume
(
self
):
...
...
nifty/spaces/power_space/power_space.py
View file @
27b869ee
...
...
@@ -18,7 +18,7 @@ class PowerSpace(Space):
def
__init__
(
self
,
harmonic_domain
=
RGSpace
((
1
,)),
distribution_strategy
=
'not'
,
log
=
False
,
nbin
=
None
,
binbounds
=
None
,
dtype
=
np
.
dtype
(
'float'
)
):
dtype
=
None
):
super
(
PowerSpace
,
self
).
__init__
(
dtype
)
self
.
_ignore_for_hash
+=
[
'_pindex'
,
'_kindex'
,
'_rho'
,
'_pundex'
,
...
...
nifty/spaces/space/space.py
View file @
27b869ee
...
...
@@ -150,7 +150,8 @@ from keepers import Loggable,\
Versionable
class
Space
(
Versionable
,
Loggable
,
object
):
class
Space
(
Versionable
,
Loggable
,
Plottable
,
object
):
"""
.. __ __
.. /__/ / /_
...
...
@@ -204,7 +205,10 @@ class Space(Versionable, Loggable, object):
"""
# parse dtype
self
.
dtype
=
np
.
dtype
(
dtype
)
casted_dtype
=
np
.
result_type
(
dtype
,
np
.
float64
)
if
casted_dtype
!=
dtype
:
self
.
Logger
.
warning
(
"Input dtype reset to: %s"
%
str
(
casted_dtype
))
self
.
dtype
=
casted_dtype
self
.
_ignore_for_hash
=
[
'_global_id'
]
...
...
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