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
71b0bb1c
Commit
71b0bb1c
authored
Jul 13, 2017
by
Theo Steininger
Browse files
Made _compute_binbounds and _compute_pindex static.
parent
57c5fd43
Pipeline
#14858
passed with stage
in 6 minutes and 15 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty/spaces/power_space/power_space.py
View file @
71b0bb1c
...
...
@@ -116,6 +116,7 @@ class PowerSpace(Space):
nbin
=
nbin
,
binbounds
=
binbounds
)
temp_pindex
=
self
.
_compute_pindex
(
harmonic_partner
=
self
.
harmonic_partner
,
distance_array
=
distance_array
,
binbounds
=
temp_binbounds
,
distribution_strategy
=
distribution_strategy
)
...
...
@@ -131,7 +132,8 @@ class PowerSpace(Space):
(
self
.
_binbounds
,
self
.
_pindex
,
self
.
_kindex
,
self
.
_rho
)
=
\
self
.
_powerIndexCache
[
key
]
def
_compute_binbounds
(
self
,
harmonic_partner
,
distribution_strategy
,
@
staticmethod
def
_compute_binbounds
(
harmonic_partner
,
distribution_strategy
,
logarithmic
,
nbin
,
binbounds
):
if
logarithmic
is
None
and
nbin
is
None
and
binbounds
is
None
:
...
...
@@ -147,7 +149,7 @@ class PowerSpace(Space):
# equidistant binning (linear or log)
# MR FIXME: this needs to improve
kindex
=
self
.
_
harmonic_partner
.
get_unique_distances
()
kindex
=
harmonic_partner
.
get_unique_distances
()
if
(
logarithmic
):
k
=
np
.
r_
[
0
,
np
.
log
(
kindex
[
1
:])]
else
:
...
...
@@ -167,7 +169,8 @@ class PowerSpace(Space):
result
=
tuple
(
bb
)
return
result
def
_compute_pindex
(
self
,
distance_array
,
binbounds
,
@
staticmethod
def
_compute_pindex
(
harmonic_partner
,
distance_array
,
binbounds
,
distribution_strategy
):
# Compute pindex, kindex and rho according to bb
...
...
@@ -176,7 +179,7 @@ class PowerSpace(Space):
dtype
=
np
.
int
,
distribution_strategy
=
distribution_strategy
)
if
binbounds
is
None
:
binbounds
=
self
.
harmonic_partner
.
get_natural_binbounds
()
binbounds
=
harmonic_partner
.
get_natural_binbounds
()
pindex
.
set_local_data
(
np
.
searchsorted
(
binbounds
,
distance_array
.
get_local_data
()))
return
pindex
...
...
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