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
0360693e
Commit
0360693e
authored
Jan 15, 2019
by
Philipp Arras
Browse files
Fix value checks in LinearInterpolator
parent
5689ba2d
Changes
1
Show whitespace changes
Inline
Side-by-side
nifty5/operators/linear_interpolation.py
View file @
0360693e
...
...
@@ -16,7 +16,7 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik.
from
functools
import
reduce
from
operator
import
mul
from
operator
import
add
import
numpy
as
np
from
scipy.sparse
import
coo_matrix
...
...
@@ -53,7 +53,7 @@ class LinearInterpolator(LinearOperator):
dims
=
[
len
(
dom
.
shape
)
for
dom
in
self
.
domain
]
# FIXME This needs to be removed as soon as the bug below is fixed.
if
not
dims
.
count
(
dims
[
0
])
=
=
len
(
dims
):
if
dims
.
count
(
dims
[
0
])
!
=
len
(
dims
):
raise
TypeError
(
'This is a bug. Please extend LinearInterpolators functionality!'
)
...
...
@@ -62,7 +62,7 @@ class LinearInterpolator(LinearOperator):
if
not
(
isinstance
(
sampling_points
,
np
.
ndarray
)
and
len
(
shp
)
==
2
):
raise
TypeError
n_dim
,
n_points
=
shp
if
not
n_dim
=
=
reduce
(
mul
,
dims
):
if
n_dim
!
=
reduce
(
add
,
dims
):
raise
TypeError
self
.
_target
=
makeDomain
(
UnstructuredDomain
(
n_points
))
self
.
_capability
=
self
.
TIMES
|
self
.
ADJOINT_TIMES
...
...
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