Skip to content
GitLab
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
d1db0536
Commit
d1db0536
authored
Jul 10, 2018
by
Philipp Arras
Browse files
Type checks in Slope Operator
parent
c561b6fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty5/operators/slope_operator.py
View file @
d1db0536
...
...
@@ -17,17 +17,24 @@
# and financially supported by the Studienstiftung des deutschen Volkes.
from
__future__
import
absolute_import
,
division
,
print_function
from
..compat
import
*
import
numpy
as
np
from
..compat
import
*
from
..domain_tuple
import
DomainTuple
from
..domains.log_rg_space
import
LogRGSpace
from
..domains.unstructured_domain
import
UnstructuredDomain
from
..field
import
Field
from
.linear_operator
import
LinearOperator
class
SlopeOperator
(
LinearOperator
):
def
__init__
(
self
,
domain
,
target
,
sigmas
):
# MR FIXME: check explicitly for the required domain types etc.
# Maybe compute domain from target automatically?
if
not
isinstance
(
target
,
LogRGSpace
):
raise
TypeError
if
not
(
isinstance
(
domain
,
UnstructuredDomain
)
and
domain
.
shape
==
(
2
,)):
raise
TypeError
self
.
_domain
=
DomainTuple
.
make
(
domain
)
self
.
_target
=
DomainTuple
.
make
(
target
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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