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
ecd57ab2
Commit
ecd57ab2
authored
Sep 30, 2016
by
theos
Browse files
changed naming of distance_array to get_distance_array
parent
10201132
Changes
6
Hide whitespace changes
Inline
Side-by-side
nifty/spaces/gl_space/gl_space.py
View file @
ecd57ab2
...
@@ -153,16 +153,13 @@ class GLSpace(Space):
...
@@ -153,16 +153,13 @@ class GLSpace(Space):
return
result_x
return
result_x
def
distance_array
(
self
,
distribution_strategy
):
def
get_distance_array
(
self
,
distribution_strategy
):
dists
=
arange
(
dists
=
arange
(
start
=
0
,
stop
=
self
.
shape
[
0
],
start
=
0
,
stop
=
self
.
shape
[
0
],
distribution_strategy
=
distribution_strategy
)
distribution_strategy
=
distribution_strategy
)
dists
=
dists
.
apply_scalar_function
(
dists
=
dists
.
apply_scalar_function
(
lambda
x
:
self
.
_distance_array_helper
(
divmod
(
x
,
self
.
nlon
)),
lambda
x
:
self
.
_distance_array_helper
(
divmod
(
x
,
self
.
nlon
)),
dtype
=
np
.
float
dtype
=
np
.
float
)
)
return
dists
return
dists
...
...
nifty/spaces/hp_space/hp_space.py
View file @
ecd57ab2
...
@@ -159,7 +159,7 @@ class HPSpace(Space):
...
@@ -159,7 +159,7 @@ class HPSpace(Space):
return
result_x
return
result_x
def
distance_array
(
self
,
distribution_strategy
):
def
get_
distance_array
(
self
,
distribution_strategy
):
"""
"""
Calculates distance from center to all the points on the sphere
Calculates distance from center to all the points on the sphere
...
...
nifty/spaces/power_space/power_indices.py
View file @
ecd57ab2
...
@@ -45,7 +45,7 @@ class PowerIndices(object):
...
@@ -45,7 +45,7 @@ class PowerIndices(object):
self
.
distribution_strategy
=
distribution_strategy
self
.
distribution_strategy
=
distribution_strategy
# Compute the global k_array
# Compute the global k_array
self
.
k_array
=
self
.
domain
.
distance_array
(
distribution_strategy
)
self
.
k_array
=
self
.
domain
.
get_
distance_array
(
distribution_strategy
)
# Initialize the dictonary which stores all individual index-dicts
# Initialize the dictonary which stores all individual index-dicts
self
.
global_dict
=
{}
self
.
global_dict
=
{}
# Set self.default_parameters
# Set self.default_parameters
...
...
nifty/spaces/power_space/power_space.py
View file @
ecd57ab2
...
@@ -105,10 +105,10 @@ class PowerSpace(Space):
...
@@ -105,10 +105,10 @@ class PowerSpace(Space):
return
result_x
return
result_x
def
distance_array
(
self
,
distribution_strategy
):
def
get_
distance_array
(
self
,
distribution_strategy
):
raise
NotImplementedError
(
about
.
_errors
.
cstring
(
raise
NotImplementedError
(
about
.
_errors
.
cstring
(
"ERROR: There is no distance_array implementation for
PowerSpace."
)
"ERROR: There is no
get_
distance_array implementation for
"
)
"PowerSpace."
)
)
def
get_smoothing_kernel_function
(
self
,
sigma
):
def
get_smoothing_kernel_function
(
self
,
sigma
):
raise
NotImplementedError
(
about
.
_errors
.
cstring
(
raise
NotImplementedError
(
about
.
_errors
.
cstring
(
...
...
nifty/spaces/rg_space/rg_space.py
View file @
ecd57ab2
...
@@ -226,7 +226,7 @@ class RGSpace(Space):
...
@@ -226,7 +226,7 @@ class RGSpace(Space):
result_x
=
x
*
weight
result_x
=
x
*
weight
return
result_x
return
result_x
def
distance_array
(
self
,
distribution_strategy
):
def
get_
distance_array
(
self
,
distribution_strategy
):
"""
"""
Calculates an n-dimensional array with its entries being the
Calculates an n-dimensional array with its entries being the
lengths of the k-vectors from the zero point of the grid.
lengths of the k-vectors from the zero point of the grid.
...
...
nifty/spaces/space/space.py
View file @
ecd57ab2
...
@@ -272,9 +272,10 @@ class Space(object):
...
@@ -272,9 +272,10 @@ class Space(object):
"""
"""
raise
NotImplementedError
raise
NotImplementedError
def
distance_array
(
self
,
distribution_strategy
):
def
get_
distance_array
(
self
,
distribution_strategy
):
raise
NotImplementedError
(
about
.
_errors
.
cstring
(
raise
NotImplementedError
(
about
.
_errors
.
cstring
(
"ERROR: There is no generic distance_array for Space base class."
))
"ERROR: There is no generic get_distance_array for "
"Space base class."
))
def
get_smoothing_kernel_function
(
self
,
sigma
):
def
get_smoothing_kernel_function
(
self
,
sigma
):
raise
NotImplementedError
(
about
.
_errors
.
cstring
(
raise
NotImplementedError
(
about
.
_errors
.
cstring
(
...
...
Write
Preview
Supports
Markdown
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