Commit 114d5196 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

nor more keepers

parent 92049714
......@@ -83,15 +83,6 @@ class LMGLTransformation(SlicingTransformation):
lmax = domain.lmax
mmax = domain.mmax
if lmax != mmax:
cls.logger.warn("Unrecommended: codomain has lmax != mmax.")
if nlat != lmax + 1:
cls.logger.warn("Unrecommended: codomain has nlat != lmax + 1.")
if nlon != 2*lmax + 1:
cls.logger.warn("Unrecommended: domain has nlon != 2*lmax + 1.")
super(LMGLTransformation, cls).check_codomain(domain, codomain)
def _transformation_of_slice(self, inp, **kwargs):
......
......@@ -77,9 +77,6 @@ class LMHPTransformation(SlicingTransformation):
nside = codomain.nside
lmax = domain.lmax
if lmax != 2*nside:
cls.logger.warn("Unrecommended: lmax != 2*nside.")
super(LMHPTransformation, cls).check_codomain(domain, codomain)
def _transformation_of_slice(self, inp, **kwargs):
......
......@@ -23,13 +23,12 @@ import warnings
import numpy as np
from .... import nifty_utilities as utilities
from keepers import Loggable
from functools import reduce
import pyfftw
class Transform(Loggable, object):
class Transform(object):
"""
A generic fft object without any implementation.
"""
......
......@@ -18,11 +18,10 @@
import abc
from keepers import Loggable
from future.utils import with_metaclass
class Transformation(with_metaclass(abc.ABCMeta, type('NewBase', (Loggable, object), {}))):
class Transformation(with_metaclass(abc.ABCMeta, type('NewBase', (object,), {}))):
"""
A generic transformation which defines a static check_codomain
method for all transforms.
......
......@@ -20,14 +20,13 @@ from builtins import str
import abc
from ...nifty_meta import NiftyMeta
from keepers import Loggable
from ...field import Field
from ... import nifty_utilities as utilities
from future.utils import with_metaclass
class LinearOperator(with_metaclass(
NiftyMeta, type('NewBase', (Loggable, object), {}))):
NiftyMeta, type('NewBase', (object,), {}))):
"""NIFTY base class for linear operators.
The base NIFTY operator class is an abstract class from which
......
......@@ -55,20 +55,6 @@ class ProjectionOperator(EndomorphicOperator):
Raised if
* if projection_field is not a Field
Notes
-----
Examples
--------
>>> x_space = RGSpace(5)
>>> f1 = Field(x_space, val=3.)
>>> f2 = Field(x_space, val=5.)
>>> P = ProjectionOperator(f1)
>>> res = P.times(f2)
>>> res.val
<distributed_data_object>
array([ 225., 225., 225., 225., 225.])
See Also
--------
......@@ -104,24 +90,9 @@ class ProjectionOperator(EndomorphicOperator):
for space_index in spaces:
active_axes += x.domain_axes[space_index]
axes_local_distribution_strategy = \
x.val.get_axes_local_distribution_strategy(active_axes)
if axes_local_distribution_strategy == \
self._projection_field.distribution_strategy:
local_projection_vector = \
self._projection_field.val.get_local_data(copy=False)
else:
# create an array that is sub-slice compatible
self.logger.warn("The input field is not sub-slice compatible to "
"the distribution strategy of the operator. "
"Performing an probably expensive "
"redistribution.")
redistr_projection_val = self._projection_field.val.copy(
distribution_strategy=axes_local_distribution_strategy)
local_projection_vector = \
redistr_projection_val.get_local_data(copy=False)
local_x = x.val.get_local_data(copy=False)
local_projection_vector = self._projection_field.val
local_x = x.val
l = len(local_projection_vector.shape)
sublist_projector = list(range(l))
......@@ -141,7 +112,7 @@ class ProjectionOperator(EndomorphicOperator):
dotted, sublist_dotted,
sublist_x)
result_field = x.copy_empty(dtype=remultiplied.dtype)
result_field.val.set_local_data(remultiplied, copy=False)
result_field.val=remultiplied
return result_field
def _inverse_times(self, x, spaces):
......
......@@ -9,8 +9,6 @@ import sys
import numpy as np
from keepers import Loggable
from ...spaces.space import Space
from ...field import Field
from ... import nifty_utilities as utilities
......@@ -24,7 +22,7 @@ if plotly is not None and 'IPython' in sys.modules:
plotly.offline.init_notebook_mode()
class PlotterBase(with_metaclass(abc.ABCMeta, type('NewBase', (Loggable, object), {}))):
class PlotterBase(with_metaclass(abc.ABCMeta, type('NewBase', (object,), {}))):
def __init__(self, interactive=False, path='plot.html', title=""):
if plotly is None:
raise ImportError("The module plotly is needed but not available.")
......
......@@ -33,9 +33,8 @@ setup(name="ift_nifty",
package_dir={"nifty": "nifty"},
zip_safe=False,
include_dirs=[numpy.get_include()],
dependency_links=[
'git+https://gitlab.mpcdf.mpg.de/ift/keepers.git#egg=keepers-0.3.7'],
install_requires=['keepers>=0.3.7'],
dependency_links=[],
install_requires=[],
license="GPLv3",
classifiers=[
"Development Status :: 4 - Beta",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment