Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NIFTy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ift
NIFTy
Commits
45d4c21f
Commit
45d4c21f
authored
Oct 06, 2016
by
theos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switched from `about` to keepers logging.
Removed NIFTy 2 files that have not been ported so far.
parent
c53029ef
Changes
41
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
258 additions
and
7671 deletions
+258
-7671
nifty/__init__.py
nifty/__init__.py
+4
-7
nifty/config/__init__.py
nifty/config/__init__.py
+0
-2
nifty/config/nifty_about.py
nifty/config/nifty_about.py
+0
-505
nifty/demos/demo_excaliwir.py
nifty/demos/demo_excaliwir.py
+0
-1
nifty/demos/demo_faraday.py
nifty/demos/demo_faraday.py
+0
-3
nifty/demos/demo_tomography.py
nifty/demos/demo_tomography.py
+0
-3
nifty/demos/demo_wf1.py
nifty/demos/demo_wf1.py
+0
-1
nifty/field.py
nifty/field.py
+43
-44
nifty/logger.py
nifty/logger.py
+5
-0
nifty/minimization/conjugate_gradient.py
nifty/minimization/conjugate_gradient.py
+1
-315
nifty/nifty_cmaps.py
nifty/nifty_cmaps.py
+0
-279
nifty/nifty_random.py
nifty/nifty_random.py
+0
-331
nifty/nifty_simple_math.py
nifty/nifty_simple_math.py
+1
-3
nifty/nifty_utilities.py
nifty/nifty_utilities.py
+4
-9
nifty/operators/__init__.py
nifty/operators/__init__.py
+0
-21
nifty/operators/diagonal_operator/diagonal_operator.py
nifty/operators/diagonal_operator/diagonal_operator.py
+7
-5
nifty/operators/fft_operator/fft_operator.py
nifty/operators/fft_operator/fft_operator.py
+14
-14
nifty/operators/fft_operator/transformations/gllmtransformation.py
...rators/fft_operator/transformations/gllmtransformation.py
+22
-19
nifty/operators/fft_operator/transformations/hplmtransformation.py
...rators/fft_operator/transformations/hplmtransformation.py
+12
-12
nifty/operators/fft_operator/transformations/lmgltransformation.py
...rators/fft_operator/transformations/lmgltransformation.py
+20
-18
nifty/operators/fft_operator/transformations/lmhptransformation.py
...rators/fft_operator/transformations/lmhptransformation.py
+11
-12
nifty/operators/fft_operator/transformations/rg_transforms.py
...y/operators/fft_operator/transformations/rg_transforms.py
+8
-17
nifty/operators/fft_operator/transformations/rgrgtransformation.py
...rators/fft_operator/transformations/rgrgtransformation.py
+5
-3
nifty/operators/linear_operator/linear_operator.py
nifty/operators/linear_operator/linear_operator.py
+29
-30
nifty/operators/nifty_minimization.py
nifty/operators/nifty_minimization.py
+0
-1285
nifty/operators/nifty_operators.py
nifty/operators/nifty_operators.py
+0
-3713
nifty/operators/nifty_probing.py
nifty/operators/nifty_probing.py
+0
-496
nifty/operators/propagator_operator/propagator_operator.py
nifty/operators/propagator_operator/propagator_operator.py
+10
-8
nifty/operators/smoothing_operator/smoothing_operator.py
nifty/operators/smoothing_operator/smoothing_operator.py
+4
-5
nifty/power_conversion.py
nifty/power_conversion.py
+0
-311
nifty/probing/operator_prober.py
nifty/probing/operator_prober.py
+2
-4
nifty/probing/prober.py
nifty/probing/prober.py
+4
-6
nifty/random.py
nifty/random.py
+1
-0
nifty/spaces/gl_space/gl_space.py
nifty/spaces/gl_space/gl_space.py
+12
-10
nifty/spaces/hp_space/hp_space.py
nifty/spaces/hp_space/hp_space.py
+3
-5
nifty/spaces/lm_space/lm_space.py
nifty/spaces/lm_space/lm_space.py
+9
-8
nifty/spaces/power_space/power_indices.py
nifty/spaces/power_space/power_indices.py
+4
-136
nifty/spaces/power_space/power_space.py
nifty/spaces/power_space/power_space.py
+11
-12
nifty/spaces/rg_space/rg_space.py
nifty/spaces/rg_space/rg_space.py
+2
-5
nifty/spaces/space/space.py
nifty/spaces/space/space.py
+8
-11
setup.py
setup.py
+2
-2
No files found.
nifty/__init__.py
View file @
45d4c21f
...
...
@@ -26,25 +26,22 @@ mpl.use('Agg')
from
.version
import
__version__
from
logger
import
logger
import
dummys
# it is important to import config before d2o such that NIFTy is able to
# pre-create d2o's configuration object with the corrected path
from
config
import
about
,
\
dependency_injector
,
\
from
config
import
dependency_injector
,
\
nifty_configuration
,
\
d2o_configuration
from
d2o
import
distributed_data_object
,
d2o_librarian
from
nifty_cmaps
import
ncmap
from
field
import
Field
# this line exists for compatibility reasons
# TODO: Remove this once the transition to field types is done.
from
spaces.space
import
Space
as
point_space
from
random
import
Random
from
nifty_simple_math
import
*
from
nifty_utilities
import
*
...
...
nifty/config/__init__.py
View file @
45d4c21f
# -*- coding: utf-8 -*-
from
nifty_about
import
*
from
nifty_config
import
dependency_injector
,
\
nifty_configuration
...
...
nifty/config/nifty_about.py
deleted
100644 → 0
View file @
c53029ef
## NIFTY (Numerical Information Field Theory) has been developed at the
## Max-Planck-Institute for Astrophysics.
##
## Copyright (C) 2013 Max-Planck-Society
##
## Author: Marco Selig
## Project homepage: <http://www.mpa-garching.mpg.de/ift/nifty/>
##
## 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/>.
from
sys
import
stdout
as
so
import
os
import
inspect
import
d2o
import
keepers
from
nifty
import
__version__
MPI
=
d2o
.
config
.
dependency_injector
[
keepers
.
get_Configuration
(
'D2O'
)[
'mpi_module'
]]
comm
=
MPI
.
COMM_WORLD
size
=
comm
.
size
rank
=
comm
.
rank
class
switch
(
object
):
"""
.. __ __ __
.. /__/ / /_ / /
.. _______ __ __ __ / _/ _______ / /___
.. / _____/ | |/\/ / / / / / / ____/ / _ |
.. /_____ / | / / / / /_ / /____ / / / /
.. /_______/ |__/\__/ /__/ \___/ \______/ /__/ /__/ class
NIFTY support class for switches.
Parameters
----------
default : bool
Default status of the switch (default: False).
See Also
--------
notification : A derived class for displaying notifications.
Examples
--------
>>> option = switch()
>>> option.status
False
>>> option
OFF
>>> print(option)
OFF
>>> option.on()
>>> print(option)
ON
Attributes
----------
status : bool
Status of the switch.
"""
def
__init__
(
self
,
default
=
False
):
"""
Initilizes the switch and sets the `status`
Parameters
----------
default : bool
Default status of the switch (default: False).
"""
self
.
status
=
bool
(
default
)
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def
on
(
self
):
"""
Switches the `status` to True.
"""
self
.
status
=
True
def
off
(
self
):
"""
Switches the `status` to False.
"""
self
.
status
=
False
def
toggle
(
self
):
"""
Switches the `status`.
"""
self
.
status
=
not
self
.
status
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def
__repr__
(
self
):
if
(
self
.
status
):
return
"ON"
else
:
return
"OFF"
##-----------------------------------------------------------------------------
##-----------------------------------------------------------------------------
class
notification
(
switch
):
"""
.. __ __ ____ __ __ __
.. / /_ /__/ / _/ /__/ / /_ /__/
.. __ ___ ______ / _/ __ / /_ __ _______ ____ __ / _/ __ ______ __ ___
.. / _ | / _ | / / / / / _/ / / / ____/ / _ / / / / / / _ | / _ |
.. / / / / / /_/ / / /_ / / / / / / / /____ / /_/ / / /_ / / / /_/ / / / / /
.. /__/ /__/ \______/ \___/ /__/ /__/ /__/ \______/ \______| \___/ /__/ \______/ /__/ /__/ class
NIFTY support class for notifications.
Parameters
----------
default : bool
Default status of the switch (default: False).
ccode : string
Color code as string (default: "
\033
[0m"). The surrounding special
characters are added if missing.
Notes
-----
The color code is a special ANSI escape code, for a list of valid codes
see [#]_. Multiple codes can be combined by seperating them with a
semicolon ';'.
References
----------
.. [#] Wikipedia, `ANSI escape code <http://en.wikipedia.org/wiki/ANSI_escape_code#graphics>`_.
Examples
--------
>>> note = notification()
>>> note.status
True
>>> note.cprint("This is noteworthy.")
This is noteworthy.
>>> note.cflush("12"); note.cflush('3')
123
>>> note.off()
>>> note.cprint("This is noteworthy.")
>>>
Raises
------
TypeError
If `ccode` is no string.
Attributes
----------
status : bool
Status of the switch.
ccode : string
Color code as string.
"""
_code
=
"
\033
[0m"
## "\033[39;49m"
_ccode_red
=
"
\033
[31;1m"
_ccode_yellow
=
"
\033
[33;1m"
_ccode_green
=
"
\033
[32;1m"
def
__init__
(
self
,
default
=
True
,
ccode
=
"
\033
[0m"
):
"""
Initializes the notification and sets `status` and `ccode`
Parameters
----------
default : bool
Default status of the switch (default: False).
ccode : string
Color code as string (default: "
\033
[0m"). The surrounding
special characters are added if missing.
Raises
------
TypeError
If `ccode` is no string.
"""
self
.
status
=
bool
(
default
)
## check colour code
if
(
not
isinstance
(
ccode
,
str
)):
raise
TypeError
(
about
.
_errors
.
cstring
(
"ERROR: invalid input."
))
if
(
ccode
[
0
]
!=
"
\033
"
):
ccode
=
"
\033
"
+
ccode
if
(
ccode
[
1
]
!=
'['
):
ccode
=
ccode
[
0
]
+
'['
+
ccode
[
1
:]
if
(
ccode
[
-
1
]
!=
'm'
):
ccode
=
ccode
+
'm'
self
.
ccode
=
ccode
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def
set_ccode
(
self
,
newccode
=
None
):
"""
Resets the the `ccode` string.
Parameters
----------
newccode : string
Color code as string (default: "
\033
[0m"). The surrounding
characters "
\033
", '[', and 'm' are added if missing.
Returns
-------
None
Raises
------
TypeError
If `ccode` is no string.
Examples
--------
>>> note = notification()
>>> note.set_ccode("31;1") ## "31;1" corresponds to red and bright
"""
if
(
newccode
is
None
):
newccode
=
self
.
_code
else
:
## check colour code
if
(
not
isinstance
(
newccode
,
str
)):
raise
TypeError
(
about
.
_errors
.
cstring
(
"ERROR: invalid input."
))
if
(
newccode
[
0
]
!=
"
\033
"
):
newccode
=
"
\033
"
+
newccode
if
(
newccode
[
1
]
!=
'['
):
newccode
=
newccode
[
0
]
+
'['
+
newccode
[
1
:]
if
(
newccode
[
-
1
]
!=
'm'
):
newccode
=
newccode
+
'm'
self
.
ccode
=
newccode
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def
_get_caller
(
self
):
result
=
''
i
=
2
current
=
inspect
.
stack
()[
i
][
3
]
while
current
!=
'<module>'
:
result
=
'.'
+
current
+
result
i
+=
1
current
=
inspect
.
stack
()[
i
][
3
]
return
result
[
1
:]
def
cstring
(
self
,
subject
):
"""
Casts an object to a string and augments that with a colour code.
Parameters
----------
subject : {string, object}
String to be augmented with a color code. A given object is
cast to its string representation by :py:func:`str`.
Returns
-------
cstring : string
String augmented with a color code.
"""
if
rank
==
0
:
return
self
.
ccode
+
str
(
self
.
_get_caller
())
+
':
\n
'
+
\
str
(
subject
)
+
self
.
_code
+
'
\n
'
def
cflush
(
self
,
subject
):
"""
Flushes an object in its colour coded sting representation to the
standard output (*without* line break).
Parameters
----------
subject : {string, object}
String to be flushed. A given object is
cast to a string by :py:func:`str`.
Returns
-------
None
"""
if
self
.
status
and
rank
==
0
:
so
.
write
(
self
.
cstring
(
subject
))
so
.
flush
()
def
cprint
(
self
,
subject
):
"""
Flushes an object in its colour coded sting representation to the
standard output (*with* line break).
Parameters
----------
subject : {string, object}
String to be flushed. A given object is
cast to a string by :py:func:`str`.
Returns
-------
None
"""
if
self
.
status
and
rank
==
0
:
so
.
write
(
self
.
cstring
(
subject
)
+
"
\n
"
)
so
.
flush
()
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def
__repr__
(
self
):
if
(
self
.
status
):
return
self
.
cstring
(
"ON"
)
else
:
return
self
.
cstring
(
"OFF"
)
##-----------------------------------------------------------------------------
class
_about
(
object
):
## nifty support class for global settings
"""
NIFTY support class for global settings.
.. warning::
Turning off the `_error` notification will suppress all NIFTY error
strings (not recommended).
Examples
--------
>>> from nifty import *
>>> about
nifty version 0.2.0
>>> print(about)
nifty version 0.2.0
- errors = ON (immutable)
- warnings = ON
- infos = OFF
- multiprocessing = ON
- hermitianize = ON
- lm2gl = ON
>>> about.infos.on()
>>> about.about.save_config()
>>> from nifty import *
INFO: nifty version 0.2.0
>>> print(about)
nifty version 0.2.0
- errors = ON (immutable)
- warnings = ON
- infos = ON
- multiprocessing = ON
- hermitianize = ON
- lm2gl = ON
Attributes
----------
warnings : notification
Notification instance controlling whether warings shall be printed.
infos : notification
Notification instance controlling whether information shall be
printed.
multiprocessing : switch
Switch instance controlling whether multiprocessing might be
performed.
hermitianize : switch
Switch instance controlling whether hermitian symmetry for certain
:py:class:`rg_space` instances is inforced.
lm2gl : switch
Switch instance controlling whether default target of a
:py:class:`lm_space` instance is a :py:class:`gl_space` or a
:py:class:`hp_space` instance.
"""
def
__init__
(
self
):
"""
Initializes the _about and sets the attributes.
"""
## version
self
.
_version
=
str
(
__version__
)
## switches and notifications
self
.
_errors
=
notification
(
default
=
True
,
ccode
=
notification
.
_code
)
self
.
warnings
=
notification
(
default
=
True
,
ccode
=
notification
.
_code
)
self
.
infos
=
notification
(
default
=
False
,
ccode
=
notification
.
_code
)
self
.
multiprocessing
=
switch
(
default
=
True
)
self
.
hermitianize
=
switch
(
default
=
True
)
self
.
lm2gl
=
switch
(
default
=
True
)
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def
load_config
(
self
,
force
=
True
):
"""
Reads the configuration file "~/.nifty/nifty_config".
Parameters
----------
force : bool
Whether to cause an error if the file does not exsist or not.
Returns
-------
None
Raises
------
ValueError
If the configuration file is malformed.
OSError
If the configuration file does not exist.
"""
nconfig
=
os
.
path
.
expanduser
(
'~'
)
+
"/.nifty/nifty_config"
if
(
os
.
path
.
isfile
(
nconfig
)):
rawconfig
=
[]
with
open
(
nconfig
,
'r'
)
as
configfile
:
for
ll
in
configfile
:
if
(
not
ll
.
startswith
(
'#'
)):
rawconfig
+=
ll
.
split
()
try
:
self
.
_errors
=
notification
(
default
=
True
,
ccode
=
rawconfig
[
0
])
self
.
warnings
=
notification
(
default
=
int
(
rawconfig
[
1
]),
ccode
=
rawconfig
[
2
])
self
.
infos
=
notification
(
default
=
int
(
rawconfig
[
3
]),
ccode
=
rawconfig
[
4
])
self
.
multiprocessing
=
switch
(
default
=
int
(
rawconfig
[
5
]))
self
.
hermitianize
=
switch
(
default
=
int
(
rawconfig
[
6
]))
self
.
lm2gl
=
switch
(
default
=
int
(
rawconfig
[
7
]))
except
(
IndexError
):
raise
ValueError
(
about
.
_errors
.
cstring
(
"ERROR: '"
+
nconfig
+
"' damaged."
))
elif
(
force
):
raise
OSError
(
about
.
_errors
.
cstring
(
"ERROR: '"
+
nconfig
+
"' nonexisting."
))
def
save_config
(
self
):
"""
Writes to the configuration file "~/.nifty/nifty_config".
Returns
-------
None
"""
rawconfig
=
[
self
.
_errors
.
ccode
[
2
:
-
1
],
str
(
int
(
self
.
warnings
.
status
)),
self
.
warnings
.
ccode
[
2
:
-
1
],
str
(
int
(
self
.
infos
.
status
)),
self
.
infos
.
ccode
[
2
:
-
1
],
str
(
int
(
self
.
multiprocessing
.
status
)),
str
(
int
(
self
.
hermitianize
.
status
)),
str
(
int
(
self
.
lm2gl
.
status
))]
nconfig
=
os
.
path
.
expanduser
(
'~'
)
+
"/.nifty/nifty_config"
if
(
os
.
path
.
isfile
(
nconfig
)):
rawconfig
=
[
self
.
_errors
.
ccode
[
2
:
-
1
],
str
(
int
(
self
.
warnings
.
status
)),
self
.
warnings
.
ccode
[
2
:
-
1
],
str
(
int
(
self
.
infos
.
status
)),
self
.
infos
.
ccode
[
2
:
-
1
],
str
(
int
(
self
.
multiprocessing
.
status
)),
str
(
int
(
self
.
hermitianize
.
status
)),
str
(
int
(
self
.
lm2gl
.
status
))]
nconfig
=
os
.
path
.
expanduser
(
'~'
)
+
"/.nifty/nifty_config"
with
open
(
nconfig
,
'r'
)
as
sourcefile
:
with
open
(
nconfig
+
"_"
,
'w'
)
as
targetfile
:
for
ll
in
sourcefile
:
if
(
ll
.
startswith
(
'#'
)):
targetfile
.
write
(
ll
)
else
:
ll
=
ll
.
replace
(
ll
.
split
()[
0
],
rawconfig
[
0
])
## one(!) per line
rawconfig
=
rawconfig
[
1
:]
targetfile
.
write
(
ll
)
os
.
rename
(
nconfig
+
"_"
,
nconfig
)
## overwrite old congiguration
else
:
if
(
not
os
.
path
.
exists
(
os
.
path
.
expanduser
(
'~'
)
+
"/.nifty"
)):
os
.
makedirs
(
os
.
path
.
expanduser
(
'~'
)
+
"/.nifty"
)
with
open
(
nconfig
,
'w'
)
as
targetfile
:
for
rr
in
rawconfig
:
targetfile
.
write
(
rr
+
"
\n
"
)
## one(!) per line
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def
__repr__
(
self
):
return
"nifty version "
+
self
.
_version
def
__str__
(
self
):
return
"nifty version "
+
self
.
_version
+
"
\n
- errors = "
+
self
.
_errors
.
cstring
(
"ON"
)
+
" (immutable)
\n
- warnings = "
+
str
(
self
.
warnings
)
+
"
\n
- infos = "
+
str
(
self
.
infos
)
+
"
\n
- multiprocessing = "
+
str
(
self
.
multiprocessing
)
+
"
\n
- hermitianize = "
+
str
(
self
.
hermitianize
)
+
"
\n
- lm2gl = "
+
str
(
self
.
lm2gl
)
##-----------------------------------------------------------------------------
## set global instance
about
=
_about
()
#about.load_config(force=False)
#about.infos.cprint("INFO: "+about.__repr__())
nifty/demos/demo_excaliwir.py
View file @
45d4c21f
...
...
@@ -258,7 +258,6 @@ class problem(object):
if
(
__name__
==
"__main__"
):
x
=
RGSpace
((
1280
),
zerocenter
=
True
)
p
=
problem
(
x
,
log
=
False
)
about
.
warnings
.
off
()
## pl.close("all")
#
# ## define signal space
...
...
nifty/demos/demo_faraday.py
View file @
45d4c21f
...
...
@@ -41,9 +41,6 @@ from __future__ import division
from
nifty
import
*
about
.
warnings
.
off
()
about
.
infos
.
off
()
##-----------------------------------------------------------------------------
...
...
nifty/demos/demo_tomography.py
View file @
45d4c21f
...
...
@@ -4,9 +4,6 @@ from nifty import *
if
__name__
==
"__main__"
:
about
.
warnings
.
off
()
shape
=
(
256
,
256
)
x_space
=
RGSpace
(
shape
)
...
...
nifty/demos/demo_wf1.py
View file @
45d4c21f
...
...
@@ -43,7 +43,6 @@ import gc
from
nifty
import
*
# version 0.8.0
if
__name__
==
"__main__"
:
about
.
warnings
.
off
()
# some signal space; e.g., a two-dimensional regular grid
shape
=
[
1024
,
1024
]
...
...
nifty/field.py
View file @
45d4c21f
...
...
@@ -4,8 +4,7 @@ import numpy as np
from
d2o
import
distributed_data_object
,
\
STRATEGIES
as
DISTRIBUTION_STRATEGIES
from
nifty.config
import
about
,
\
nifty_configuration
as
gc
from
nifty.config
import
nifty_configuration
as
gc
from
nifty.field_types
import
FieldType
...
...
@@ -15,6 +14,9 @@ from nifty.spaces.power_space import PowerSpace
import
nifty.nifty_utilities
as
utilities
from
nifty.random
import
Random
import
logging
logger
=
logging
.
getLogger
(
'NIFTy.Field'
)
class
Field
(
object
):
# ---Initialization methods---
...
...
@@ -58,9 +60,9 @@ class Field(object):
for
d
in
domain
:
if
not
isinstance
(
d
,
Space
):
raise
TypeError
(
about
.
_errors
.
cstring
(
"
ERROR:
Given domain contains something that is not a "
"nifty.space."
)
)
raise
TypeError
(
"Given domain contains something that is not a "
"nifty.space."
)
return
domain
def
_parse_field_type
(
self
,
field_type
,
val
=
None
):
...
...
@@ -75,8 +77,8 @@ class Field(object):
field_type
=
tuple
(
field_type
)
for
ft
in
field_type
:
if
not
isinstance
(
ft
,
FieldType
):
raise
TypeError
(
about
.
_errors
.
cstring
(
"
ERROR: Given object is not a nifty.FieldType."
)
)
raise
TypeError
(
"
Given object is not a nifty.FieldType."
)
return
field_type
def
_get_axes_tuple
(
self
,
things_with_shape
,
start
=
0
):
...
...
@@ -114,12 +116,12 @@ class Field(object):
elif
isinstance
(
val
,
Field
):
distribution_strategy
=
val
.
distribution_strategy
else
:
about
.
warnings
.
cprint
(
"WARNING:
Datamodel set to default!"
)
logger
.
info
(
"
Datamodel set to default!"
)
distribution_strategy
=
gc
[
'default_distribution_strategy'
]
elif
distribution_strategy
not
in
DISTRIBUTION_STRATEGIES
[
'global'
]:
raise
ValueError
(
about
.
_errors
.
cstring
(
"
ERROR:
distribution_strategy must be a global-type "