Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
22d3e25c
Commit
22d3e25c
authored
May 18, 2017
by
Martin Reinecke
Browse files
various small proposed changes
parent
9bed8f72
Pipeline
#12613
passed with stage
in 4 minutes and 43 seconds
Changes
6
Pipelines
1
Show whitespace changes
Inline
Side-by-side
nifty/field_types/field_array.py
View file @
22d3e25c
...
...
@@ -22,12 +22,11 @@ from field_type import FieldType
class
FieldArray
(
FieldType
):
def
__init__
(
self
,
shape
):
super
(
FieldArray
,
self
).
__init__
()
try
:
new
_shape
=
tuple
([
int
(
i
)
for
i
in
shape
])
self
.
_shape
=
tuple
([
int
(
i
)
for
i
in
shape
])
except
TypeError
:
new_shape
=
(
int
(
shape
),
)
self
.
_shape
=
new_shape
super
(
FieldArray
,
self
).
__init__
()
self
.
_shape
=
(
int
(
shape
),
)
@
property
def
shape
(
self
):
...
...
nifty/operators/invertible_operator_mixin/invertible_operator_mixin.py
View file @
22d3e25c
...
...
@@ -104,6 +104,7 @@ class InvertibleOperatorMixin(object):
x0
=
x0
)
return
result
#MR FIXME: why? shouldn't this be equivalent to the adjoint inverse?
def
_inverse_adjoint_times
(
self
,
x
,
spaces
):
raise
NotImplementedError
(
"no generic instance method 'inverse_adjoint_times'."
)
nifty/operators/propagator_operator/harmonic_propagator_operator.py
View file @
22d3e25c
...
...
@@ -83,7 +83,7 @@ class HarmonicPropagatorOperator(InvertibleOperatorMixin, EndomorphicOperator):
# ---Overwritten properties and methods---
def
__init__
(
self
,
S
=
None
,
M
=
None
,
R
=
None
,
N
=
None
,
inverter
=
None
,
def
__init__
(
self
,
S
,
M
=
None
,
R
=
None
,
N
=
None
,
inverter
=
None
,
preconditioner
=
None
):
"""
Sets the standard operator properties and `codomain`, `_A1`, `_A2`,
...
...
@@ -102,7 +102,6 @@ class HarmonicPropagatorOperator(InvertibleOperatorMixin, EndomorphicOperator):
"""
# infer domain, and target
# infer domain, and target
if
M
is
not
None
:
self
.
_codomain
=
M
.
domain
self
.
_likelihood
=
M
.
times
...
...
nifty/spaces/power_space/power_space.py
View file @
22d3e25c
...
...
@@ -261,6 +261,7 @@ class PowerSpace(Space):
hdf5_group
.
attrs
[
'nbin'
]
=
str
(
self
.
config
[
"nbin"
])
hdf5_group
.
attrs
[
'binbounds'
]
=
str
(
self
.
config
[
"binbounds"
])
#MR FIXME: why not "return None" as happens everywhere else?
return
{
'harmonic_partner'
:
self
.
harmonic_partner
,
'pindex'
:
self
.
pindex
,
...
...
nifty/spaces/space/space.py
View file @
22d3e25c
...
...
@@ -202,6 +202,4 @@ class Space(DomainObject):
raise
NotImplementedError
def
__repr__
(
self
):
string
=
""
string
+=
str
(
type
(
self
))
+
"
\n
"
return
string
return
str
(
type
(
self
))
+
"
\n
"
nifty/sugar.py
View file @
22d3e25c
...
...
@@ -18,27 +18,18 @@
from
nifty
import
PowerSpace
,
\
Field
,
\
DiagonalOperator
,
\
FFTOperator
DiagonalOperator
__all__
=
[
'create_power_operator'
]
def
create_power_operator
(
domain
,
power_spectrum
,
dtype
=
None
,
distribution_strategy
=
'not'
):
if
not
domain
.
harmonic
:
fft
=
FFTOperator
(
domain
)
domain
=
fft
.
target
[
0
]
power_domain
=
PowerSpace
(
domain
,
distribution_strategy
=
distribution_strategy
)
fp
=
Field
(
power_domain
,
val
=
power_spectrum
,
dtype
=
dtype
,
fp
=
Field
(
power_domain
,
val
=
power_spectrum
,
dtype
=
dtype
,
distribution_strategy
=
distribution_strategy
)
f
=
fp
.
power_synthesize
(
mean
=
1
,
std
=
0
,
real_signal
=
False
)
power_operator
=
DiagonalOperator
(
domain
,
diagonal
=
f
,
bare
=
True
)
return
power_operator
\ No newline at end of file
return
DiagonalOperator
(
domain
,
diagonal
=
f
,
bare
=
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