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
83043583
Commit
83043583
authored
May 09, 2017
by
Theo Steininger
Browse files
Merge branch 'byebye_implemented' into 'master'
remove 'implemented' keyword See merge request
!85
parents
8daf1615
64304eb3
Pipeline
#12167
passed with stages
in 10 minutes and 39 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty/operators/composed_operator/composed_operator.py
View file @
83043583
...
...
@@ -54,10 +54,6 @@ class ComposedOperator(LinearOperator):
self
.
_target
+=
op
.
target
return
self
.
_target
@
property
def
implemented
(
self
):
return
True
@
property
def
unitary
(
self
):
return
False
...
...
nifty/operators/diagonal_operator/diagonal_operator.py
View file @
83043583
...
...
@@ -30,13 +30,11 @@ class DiagonalOperator(EndomorphicOperator):
# ---Overwritten properties and methods---
def
__init__
(
self
,
domain
=
(),
implemented
=
True
,
def
__init__
(
self
,
domain
=
(),
diagonal
=
None
,
bare
=
False
,
copy
=
True
,
distribution_strategy
=
None
):
self
.
_domain
=
self
.
_parse_domain
(
domain
)
self
.
_implemented
=
bool
(
implemented
)
if
distribution_strategy
is
None
:
if
isinstance
(
diagonal
,
distributed_data_object
):
distribution_strategy
=
diagonal
.
distribution_strategy
...
...
@@ -100,10 +98,6 @@ class DiagonalOperator(EndomorphicOperator):
def
domain
(
self
):
return
self
.
_domain
@
property
def
implemented
(
self
):
return
self
.
_implemented
@
property
def
self_adjoint
(
self
):
if
self
.
_self_adjoint
is
None
:
...
...
@@ -144,16 +138,12 @@ class DiagonalOperator(EndomorphicOperator):
distribution_strategy
=
self
.
distribution_strategy
,
copy
=
copy
)
# weight if the given values were `bare`
and `implemented`
is True
# weight if the given values were `bare` is True
# do inverse weightening if the other way around
if
bare
and
self
.
implemented
:
if
bare
:
# If `copy` is True, we won't change external data by weightening
# Otherwise, inplace weightening would change the external field
f
.
weight
(
inplace
=
copy
)
elif
not
bare
and
not
self
.
implemented
:
# If `copy` is True, we won't change external data by weightening
# Otherwise, inplace weightening would change the external field
f
.
weight
(
inplace
=
copy
,
power
=-
1
)
# Reset the self_adjoint property:
self
.
_self_adjoint
=
None
...
...
nifty/operators/fft_operator/fft_operator.py
View file @
83043583
...
...
@@ -152,10 +152,6 @@ class FFTOperator(LinearOperator):
def
target
(
self
):
return
self
.
_target
@
property
def
implemented
(
self
):
return
True
@
property
def
unitary
(
self
):
return
True
...
...
nifty/operators/linear_operator/linear_operator.py
View file @
83043583
...
...
@@ -40,10 +40,6 @@ class LinearOperator(Loggable, object):
def
target
(
self
):
raise
NotImplementedError
@
abc
.
abstractproperty
def
implemented
(
self
):
raise
NotImplementedError
@
abc
.
abstractproperty
def
unitary
(
self
):
raise
NotImplementedError
...
...
@@ -54,9 +50,6 @@ class LinearOperator(Loggable, object):
def
times
(
self
,
x
,
spaces
=
None
,
**
kwargs
):
spaces
=
self
.
_check_input_compatibility
(
x
,
spaces
)
if
not
self
.
implemented
:
x
=
x
.
weight
(
spaces
=
spaces
)
y
=
self
.
_times
(
x
,
spaces
,
**
kwargs
)
return
y
...
...
@@ -64,8 +57,6 @@ class LinearOperator(Loggable, object):
spaces
=
self
.
_check_input_compatibility
(
x
,
spaces
,
inverse
=
True
)
y
=
self
.
_inverse_times
(
x
,
spaces
,
**
kwargs
)
if
not
self
.
implemented
:
y
=
y
.
weight
(
power
=-
1
,
spaces
=
spaces
)
return
y
def
adjoint_times
(
self
,
x
,
spaces
=
None
,
**
kwargs
):
...
...
@@ -74,8 +65,6 @@ class LinearOperator(Loggable, object):
spaces
=
self
.
_check_input_compatibility
(
x
,
spaces
,
inverse
=
True
)
if
not
self
.
implemented
:
x
=
x
.
weight
(
spaces
=
spaces
)
y
=
self
.
_adjoint_times
(
x
,
spaces
,
**
kwargs
)
return
y
...
...
@@ -86,8 +75,6 @@ class LinearOperator(Loggable, object):
spaces
=
self
.
_check_input_compatibility
(
x
,
spaces
)
y
=
self
.
_adjoint_inverse_times
(
x
,
spaces
,
**
kwargs
)
if
not
self
.
implemented
:
y
=
y
.
weight
(
power
=-
1
,
spaces
=
spaces
)
return
y
def
inverse_adjoint_times
(
self
,
x
,
spaces
=
None
,
**
kwargs
):
...
...
@@ -97,8 +84,6 @@ class LinearOperator(Loggable, object):
spaces
=
self
.
_check_input_compatibility
(
x
,
spaces
)
y
=
self
.
_inverse_adjoint_times
(
x
,
spaces
)
if
not
self
.
implemented
:
y
=
y
.
weight
(
power
=-
1
,
spaces
=
spaces
)
return
y
def
_times
(
self
,
x
,
spaces
):
...
...
nifty/operators/projection_operator/projection_operator.py
View file @
83043583
...
...
@@ -101,10 +101,6 @@ class ProjectionOperator(EndomorphicOperator):
def
domain
(
self
):
return
self
.
_projection_field
.
domain
@
property
def
implemented
(
self
):
return
True
@
property
def
unitary
(
self
):
if
self
.
_unitary
is
None
:
...
...
nifty/operators/propagator_operator/propagator_operator.py
View file @
83043583
...
...
@@ -74,10 +74,6 @@ class PropagatorOperator(InvertibleOperatorMixin, EndomorphicOperator):
def
domain
(
self
):
return
self
.
_domain
@
property
def
implemented
(
self
):
return
True
@
property
def
self_adjoint
(
self
):
return
True
...
...
nifty/operators/smoothing_operator/smoothing_operator.py
View file @
83043583
...
...
@@ -53,10 +53,6 @@ class SmoothingOperator(EndomorphicOperator):
def
domain
(
self
):
return
self
.
_domain
@
property
def
implemented
(
self
):
return
True
@
property
def
self_adjoint
(
self
):
return
True
...
...
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