Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NIFTy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
10
Issues
10
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ift
NIFTy
Commits
55be306e
Commit
55be306e
authored
Sep 07, 2017
by
Martin Reinecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reshape(-1) -> ravel()
parent
b6e09b5f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
nifty2go/field.py
nifty2go/field.py
+1
-1
nifty2go/minimization/line_searching/line_search_strong_wolfe.py
...o/minimization/line_searching/line_search_strong_wolfe.py
+1
-1
nifty2go/spaces/gl_space/gl_space.py
nifty2go/spaces/gl_space/gl_space.py
+1
-1
nifty2go/spaces/power_space/power_space.py
nifty2go/spaces/power_space/power_space.py
+3
-3
test/test_spaces/test_power_space.py
test/test_spaces/test_power_space.py
+1
-1
No files found.
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
.
reshape
(
-
1
))
return
fct
*
np
.
vdot
(
y
.
val
.
r
avel
(),
x
.
val
.
ravel
(
))
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
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