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
1f9e0de6
Commit
1f9e0de6
authored
Jul 09, 2018
by
Martin Reinecke
Browse files
Merge branch 'work_on_fields' into 'NIFTy_5'
Work on fields See merge request ift/nifty-dev!41
parents
0992e538
98b59a58
Changes
94
Hide whitespace changes
Inline
Side-by-side
demos/getting_started_3.py
View file @
1f9e0de6
...
...
@@ -22,9 +22,8 @@ if __name__ == '__main__':
ht
=
ift
.
HarmonicTransformOperator
(
harmonic_space
,
position_space
)
power_space
=
A
.
value
.
domain
[
0
]
power_distributor
=
ift
.
PowerDistributor
(
harmonic_space
,
power_space
)
position
=
{}
position
[
'xi'
]
=
ift
.
Field
.
from_random
(
'normal'
,
harmonic_space
)
position
=
ift
.
MultiField
(
position
)
position
=
ift
.
MultiField
.
from_dict
(
{
'xi'
:
ift
.
Field
.
from_random
(
'normal'
,
harmonic_space
)})
xi
=
ift
.
Variable
(
position
)[
'xi'
]
Amp
=
power_distributor
(
A
)
...
...
@@ -35,6 +34,7 @@ if __name__ == '__main__':
# apply some nonlinearity
signal
=
ift
.
PointwisePositiveTanh
(
correlated_field
)
# Building the Line of Sight response
LOS_starts
,
LOS_ends
=
get_random_LOS
(
100
)
R
=
ift
.
LOSResponse
(
position_space
,
starts
=
LOS_starts
,
...
...
nifty5/compat.py
0 → 100644
View file @
1f9e0de6
from
__future__
import
absolute_import
,
division
,
print_function
from
builtins
import
(
ascii
,
bytes
,
chr
,
dict
,
filter
,
hex
,
input
,
map
,
next
,
oct
,
open
,
pow
,
range
,
round
,
super
,
zip
)
from
functools
import
reduce
nifty5/data_objects/distributed_do.py
View file @
1f9e0de6
...
...
@@ -16,9 +16,8 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from
__future__
import
(
absolute_import
,
division
,
print_function
)
from
builtins
import
*
from
functools
import
reduce
from
__future__
import
absolute_import
,
division
,
print_function
from
..compat
import
*
import
numpy
as
np
from
.random
import
Random
from
mpi4py
import
MPI
...
...
nifty5/data_objects/random.py
View file @
1f9e0de6
...
...
@@ -16,7 +16,8 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from
builtins
import
object
from
__future__
import
absolute_import
,
division
,
print_function
from
..compat
import
*
import
numpy
as
np
...
...
nifty5/dobj.py
View file @
1f9e0de6
...
...
@@ -16,6 +16,10 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from
__future__
import
absolute_import
,
division
,
print_function
from
.compat
import
*
try
:
from
mpi4py
import
MPI
if
MPI
.
COMM_WORLD
.
Get_size
()
==
1
:
...
...
nifty5/domain_tuple.py
View file @
1f9e0de6
...
...
@@ -16,9 +16,8 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from
__future__
import
(
absolute_import
,
division
,
print_function
)
from
builtins
import
*
from
functools
import
reduce
from
__future__
import
absolute_import
,
division
,
print_function
from
.compat
import
*
from
.domains.domain
import
Domain
...
...
@@ -138,26 +137,11 @@ class DomainTuple(object):
def
__eq__
(
self
,
x
):
if
self
is
x
:
return
True
x
=
DomainTuple
.
make
(
x
)
return
self
is
x
return
self
is
DomainTuple
.
make
(
x
)
def
__ne__
(
self
,
x
):
return
not
self
.
__eq__
(
x
)
def
compatibleTo
(
self
,
x
):
return
self
.
__eq__
(
x
)
def
subsetOf
(
self
,
x
):
return
self
.
__eq__
(
x
)
def
unitedWith
(
self
,
x
):
if
self
is
x
:
return
self
x
=
DomainTuple
.
make
(
x
)
if
self
is
not
x
:
raise
ValueError
(
"domain mismatch"
)
return
self
def
__str__
(
self
):
res
=
"DomainTuple, len: "
+
str
(
len
(
self
))
for
i
in
self
:
...
...
nifty5/domains/dof_space.py
View file @
1f9e0de6
...
...
@@ -16,6 +16,8 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# 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
.structured_domain
import
StructuredDomain
...
...
nifty5/domains/domain.py
View file @
1f9e0de6
...
...
@@ -16,6 +16,8 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from
__future__
import
absolute_import
,
division
,
print_function
from
..compat
import
*
import
abc
from
..utilities
import
NiftyMetaBase
...
...
nifty5/domains/gl_space.py
View file @
1f9e0de6
...
...
@@ -16,7 +16,8 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from
__future__
import
division
from
__future__
import
absolute_import
,
division
,
print_function
from
..compat
import
*
import
numpy
as
np
from
.structured_domain
import
StructuredDomain
...
...
nifty5/domains/hp_space.py
View file @
1f9e0de6
...
...
@@ -16,7 +16,8 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from
__future__
import
division
from
__future__
import
absolute_import
,
division
,
print_function
from
..compat
import
*
import
numpy
as
np
from
.structured_domain
import
StructuredDomain
...
...
nifty5/domains/lm_space.py
View file @
1f9e0de6
...
...
@@ -16,7 +16,8 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from
__future__
import
division
from
__future__
import
absolute_import
,
division
,
print_function
from
..compat
import
*
import
numpy
as
np
from
.structured_domain
import
StructuredDomain
from
..field
import
Field
...
...
nifty5/domains/log_rg_space.py
View file @
1f9e0de6
from
functools
import
reduce
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-2018 Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from
__future__
import
absolute_import
,
division
,
print_function
from
..compat
import
*
from
..sugar
import
exp
import
numpy
as
np
from
..
import
dobj
from
..field
import
Field
from
.structured_domain
import
StructuredDomain
...
...
nifty5/domains/power_space.py
View file @
1f9e0de6
...
...
@@ -16,6 +16,8 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# 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
.structured_domain
import
StructuredDomain
from
..
import
dobj
...
...
nifty5/domains/rg_space.py
View file @
1f9e0de6
...
...
@@ -16,9 +16,8 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from
__future__
import
division
from
builtins
import
range
from
functools
import
reduce
from
__future__
import
absolute_import
,
division
,
print_function
from
..compat
import
*
import
numpy
as
np
from
.structured_domain
import
StructuredDomain
from
..field
import
Field
...
...
nifty5/domains/structured_domain.py
View file @
1f9e0de6
...
...
@@ -16,6 +16,8 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from
__future__
import
absolute_import
,
division
,
print_function
from
..compat
import
*
import
abc
from
.domain
import
Domain
import
numpy
as
np
...
...
nifty5/domains/unstructured_domain.py
View file @
1f9e0de6
...
...
@@ -16,8 +16,9 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from
__future__
import
absolute_import
,
division
,
print_function
from
..compat
import
*
from
.domain
import
Domain
from
functools
import
reduce
class
UnstructuredDomain
(
Domain
):
...
...
nifty5/energies/hamiltonian.py
View file @
1f9e0de6
...
...
@@ -16,6 +16,8 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from
__future__
import
absolute_import
,
division
,
print_function
from
..compat
import
*
from
..library.gaussian_energy
import
GaussianEnergy
from
..minimization.energy
import
Energy
from
..models.variable
import
Variable
...
...
nifty5/energies/kl.py
View file @
1f9e0de6
from
builtins
import
*
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-2018 Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from
__future__
import
absolute_import
,
division
,
print_function
from
..compat
import
*
from
..minimization.energy
import
Energy
from
..utilities
import
memo
,
my_sum
...
...
nifty5/extra/energy_and_model_tests.py
View file @
1f9e0de6
...
...
@@ -16,8 +16,8 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from
__future__
import
(
absolute_import
,
division
,
print_function
)
from
builtins
import
*
from
__future__
import
absolute_import
,
division
,
print_function
from
..compat
import
*
import
numpy
as
np
from
..sugar
import
from_random
from
..minimization.energy
import
Energy
...
...
nifty5/extra/operator_tests.py
View file @
1f9e0de6
...
...
@@ -16,6 +16,8 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# 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
..sugar
import
from_random
from
..field
import
Field
...
...
Prev
1
2
3
4
5
Next
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