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
Neel Shah
NIFTy
Commits
55be306e
Commit
55be306e
authored
Sep 07, 2017
by
Martin Reinecke
Browse files
reshape(-1) -> ravel()
parent
b6e09b5f
Changes
5
Hide whitespace changes
Inline
Side-by-side
nifty2go/field.py
View file @
55be306e
...
...
@@ -706,7 +706,7 @@ class Field(object):
fct
=
tmp
if
spaces
is
None
:
return
fct
*
np
.
vdot
(
y
.
val
.
r
eshape
(
-
1
),
x
.
val
.
r
eshape
(
-
1
))
return
fct
*
np
.
vdot
(
y
.
val
.
r
avel
(
),
x
.
val
.
r
avel
(
))
else
:
# create a diagonal operator which is capable of taking care of the
# axes-matching
...
...
nifty2go/minimization/line_searching/line_search_strong_wolfe.py
View file @
55be306e
...
...
@@ -299,7 +299,7 @@ class LineSearchStrongWolfe(LineSearch):
d1
[
1
,
0
]
=
-
(
dc
*
dc
*
dc
)
d1
[
1
,
1
]
=
db
*
db
*
db
[
A
,
B
]
=
np
.
dot
(
d1
,
np
.
asarray
([
fb
-
fa
-
C
*
db
,
fc
-
fa
-
C
*
dc
]).
r
eshape
(
-
1
))
fc
-
fa
-
C
*
dc
]).
r
avel
(
))
A
/=
denom
B
/=
denom
radical
=
B
*
B
-
3
*
A
*
C
...
...
nifty2go/spaces/gl_space/gl_space.py
View file @
55be306e
...
...
@@ -117,7 +117,7 @@ class GLSpace(Space):
def
weight
(
self
):
from
pyHealpix
import
GL_weights
vol
=
GL_weights
(
self
.
nlat
,
self
.
nlon
)
return
np
.
outer
(
vol
,
np
.
ones
(
self
.
nlon
,
dtype
=
np
.
float64
)).
r
eshape
(
-
1
)
return
np
.
outer
(
vol
,
np
.
ones
(
self
.
nlon
,
dtype
=
np
.
float64
)).
r
avel
(
)
# ---Added properties and methods---
...
...
nifty2go/spaces/power_space/power_space.py
View file @
55be306e
...
...
@@ -162,10 +162,10 @@ class PowerSpace(Space):
harmonic_partner
=
self
.
harmonic_partner
,
distance_array
=
distance_array
,
binbounds
=
binbounds
)
temp_rho
=
np
.
bincount
(
temp_pindex
.
r
eshape
(
-
1
))
temp_rho
=
np
.
bincount
(
temp_pindex
.
r
avel
(
))
assert
not
np
.
any
(
temp_rho
==
0
),
"empty bins detected"
temp_kindex
=
np
.
bincount
(
temp_pindex
.
r
eshape
(
-
1
),
weights
=
distance_array
.
r
eshape
(
-
1
))
\
temp_kindex
=
np
.
bincount
(
temp_pindex
.
r
avel
(
),
weights
=
distance_array
.
r
avel
(
))
\
/
temp_rho
self
.
_powerIndexCache
[
key
]
=
(
binbounds
,
temp_pindex
,
...
...
test/test_spaces/test_power_space.py
View file @
55be306e
...
...
@@ -101,7 +101,7 @@ class PowerSpaceConsistencyCheck(unittest.TestCase):
bb
=
PowerSpace
.
useful_binbounds
(
harmonic_partner
,
logarithmic
,
nbin
)
p
=
PowerSpace
(
harmonic_partner
=
harmonic_partner
,
binbounds
=
bb
)
assert_equal
(
np
.
bincount
(
p
.
pindex
.
r
eshape
(
-
1
)),
p
.
rho
,
assert_equal
(
np
.
bincount
(
p
.
pindex
.
r
avel
(
)),
p
.
rho
,
err_msg
=
'rho is not equal to pindex degeneracy'
)
...
...
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