From 698cf06759e7a24e0c0768048d1faa52b67cea41 Mon Sep 17 00:00:00 2001 From: Martin Reinecke <martin@mpa-garching.mpg.de> Date: Sat, 7 Oct 2017 10:29:37 +0200 Subject: [PATCH] rearrange --- nifty/operators/__init__.py | 5 +++-- .../composed_operator.py | 4 ++-- nifty/operators/composed_operator/__init__.py | 19 ------------------ .../diagonal_operator.py | 9 ++++----- nifty/operators/diagonal_operator/__init__.py | 19 ------------------ .../direct_smoothing_operator.py | 6 +++--- .../endomorphic_operator.py | 3 +-- .../endomorphic_operator/__init__.py | 19 ------------------ .../{fft_operator => }/fft_operator.py | 6 +++--- nifty/operators/fft_operator/__init__.py | 19 ------------------ .../fft_operator_support.py | 4 ++-- .../fft_smoothing_operator.py | 6 +++--- .../invertible_operator_mixin.py | 4 ++-- .../invertible_operator_mixin/__init__.py | 19 ------------------ .../laplace_operator.py | 10 +++++----- nifty/operators/laplace_operator/__init__.py | 3 --- .../{linear_operator => }/linear_operator.py | 7 +++---- nifty/operators/linear_operator/__init__.py | 19 ------------------ .../response_operator.py | 14 ++++++------- nifty/operators/response_operator/__init__.py | 1 - .../operators/smoothing_operator/__init__.py | 20 ------------------- .../smoothness_operator.py | 8 ++++---- .../operators/smoothness_operator/__init__.py | 3 --- 23 files changed, 42 insertions(+), 185 deletions(-) rename nifty/operators/{composed_operator => }/composed_operator.py (98%) delete mode 100644 nifty/operators/composed_operator/__init__.py rename nifty/operators/{diagonal_operator => }/diagonal_operator.py (96%) delete mode 100644 nifty/operators/diagonal_operator/__init__.py rename nifty/operators/{smoothing_operator => }/direct_smoothing_operator.py (96%) rename nifty/operators/{endomorphic_operator => }/endomorphic_operator.py (98%) delete mode 100644 nifty/operators/endomorphic_operator/__init__.py rename nifty/operators/{fft_operator => }/fft_operator.py (97%) delete mode 100644 nifty/operators/fft_operator/__init__.py rename nifty/operators/{fft_operator => }/fft_operator_support.py (98%) rename nifty/operators/{smoothing_operator => }/fft_smoothing_operator.py (94%) rename nifty/operators/{invertible_operator_mixin => }/invertible_operator_mixin.py (98%) delete mode 100644 nifty/operators/invertible_operator_mixin/__init__.py rename nifty/operators/{laplace_operator => }/laplace_operator.py (95%) delete mode 100644 nifty/operators/laplace_operator/__init__.py rename nifty/operators/{linear_operator => }/linear_operator.py (98%) delete mode 100644 nifty/operators/linear_operator/__init__.py rename nifty/operators/{response_operator => }/response_operator.py (92%) delete mode 100644 nifty/operators/response_operator/__init__.py delete mode 100644 nifty/operators/smoothing_operator/__init__.py rename nifty/operators/{smoothness_operator => }/smoothness_operator.py (92%) delete mode 100644 nifty/operators/smoothness_operator/__init__.py diff --git a/nifty/operators/__init__.py b/nifty/operators/__init__.py index 03b17ab55..0b01dcff4 100644 --- a/nifty/operators/__init__.py +++ b/nifty/operators/__init__.py @@ -24,9 +24,10 @@ from .diagonal_operator import DiagonalOperator from .endomorphic_operator import EndomorphicOperator -from .smoothing_operator import * +from .fft_smoothing_operator import FFTSmoothingOperator +from .direct_smoothing_operator import DirectSmoothingOperator -from .fft_operator import * +from .fft_operator import FFTOperator from .invertible_operator_mixin import InvertibleOperatorMixin diff --git a/nifty/operators/composed_operator/composed_operator.py b/nifty/operators/composed_operator.py similarity index 98% rename from nifty/operators/composed_operator/composed_operator.py rename to nifty/operators/composed_operator.py index f4a38a02f..aacc9172d 100644 --- a/nifty/operators/composed_operator/composed_operator.py +++ b/nifty/operators/composed_operator.py @@ -17,8 +17,8 @@ # and financially supported by the Studienstiftung des deutschen Volkes. from builtins import range -from ..linear_operator import LinearOperator -from ... import DomainTuple +from .linear_operator import LinearOperator +from .. import DomainTuple class ComposedOperator(LinearOperator): """ NIFTY class for composed operators. diff --git a/nifty/operators/composed_operator/__init__.py b/nifty/operators/composed_operator/__init__.py deleted file mode 100644 index 4f1dd1888..000000000 --- a/nifty/operators/composed_operator/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# 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-2017 Max-Planck-Society -# -# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik -# and financially supported by the Studienstiftung des deutschen Volkes. - -from .composed_operator import ComposedOperator diff --git a/nifty/operators/diagonal_operator/diagonal_operator.py b/nifty/operators/diagonal_operator.py similarity index 96% rename from nifty/operators/diagonal_operator/diagonal_operator.py rename to nifty/operators/diagonal_operator.py index a187c7014..c830da847 100644 --- a/nifty/operators/diagonal_operator/diagonal_operator.py +++ b/nifty/operators/diagonal_operator.py @@ -19,11 +19,10 @@ from __future__ import division from builtins import range import numpy as np - -from ...field import Field -from ...domain_tuple import DomainTuple -from ..endomorphic_operator import EndomorphicOperator -from ...nifty_utilities import cast_iseq_to_tuple +from ..field import Field +from ..domain_tuple import DomainTuple +from .endomorphic_operator import EndomorphicOperator +from ..nifty_utilities import cast_iseq_to_tuple class DiagonalOperator(EndomorphicOperator): """ NIFTY class for diagonal operators. diff --git a/nifty/operators/diagonal_operator/__init__.py b/nifty/operators/diagonal_operator/__init__.py deleted file mode 100644 index e8aa4e5a4..000000000 --- a/nifty/operators/diagonal_operator/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# 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-2017 Max-Planck-Society -# -# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik -# and financially supported by the Studienstiftung des deutschen Volkes. - -from .diagonal_operator import DiagonalOperator diff --git a/nifty/operators/smoothing_operator/direct_smoothing_operator.py b/nifty/operators/direct_smoothing_operator.py similarity index 96% rename from nifty/operators/smoothing_operator/direct_smoothing_operator.py rename to nifty/operators/direct_smoothing_operator.py index 8a99b2368..67ae674e9 100644 --- a/nifty/operators/smoothing_operator/direct_smoothing_operator.py +++ b/nifty/operators/direct_smoothing_operator.py @@ -4,9 +4,9 @@ from __future__ import division from builtins import range import numpy as np -from ..endomorphic_operator import EndomorphicOperator -from ... import nifty_utilities as utilities -from ... import Field, DomainTuple +from .endomorphic_operator import EndomorphicOperator +from .. import nifty_utilities as utilities +from .. import Field, DomainTuple class DirectSmoothingOperator(EndomorphicOperator): diff --git a/nifty/operators/endomorphic_operator/endomorphic_operator.py b/nifty/operators/endomorphic_operator.py similarity index 98% rename from nifty/operators/endomorphic_operator/endomorphic_operator.py rename to nifty/operators/endomorphic_operator.py index 9e75ef271..dafb5add7 100644 --- a/nifty/operators/endomorphic_operator/endomorphic_operator.py +++ b/nifty/operators/endomorphic_operator.py @@ -17,8 +17,7 @@ # and financially supported by the Studienstiftung des deutschen Volkes. import abc - -from ..linear_operator import LinearOperator +from .linear_operator import LinearOperator class EndomorphicOperator(LinearOperator): diff --git a/nifty/operators/endomorphic_operator/__init__.py b/nifty/operators/endomorphic_operator/__init__.py deleted file mode 100644 index 87aaca610..000000000 --- a/nifty/operators/endomorphic_operator/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# 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-2017 Max-Planck-Society -# -# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik -# and financially supported by the Studienstiftung des deutschen Volkes. - -from .endomorphic_operator import EndomorphicOperator diff --git a/nifty/operators/fft_operator/fft_operator.py b/nifty/operators/fft_operator.py similarity index 97% rename from nifty/operators/fft_operator/fft_operator.py rename to nifty/operators/fft_operator.py index b3bc0bd40..f4c82338f 100644 --- a/nifty/operators/fft_operator/fft_operator.py +++ b/nifty/operators/fft_operator.py @@ -16,10 +16,10 @@ # NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik # and financially supported by the Studienstiftung des deutschen Volkes. -from ... import Field, DomainTuple, nifty_utilities as utilities -from ...spaces import RGSpace, GLSpace, HPSpace, LMSpace +from .. import Field, DomainTuple, nifty_utilities as utilities +from ..spaces import RGSpace, GLSpace, HPSpace, LMSpace -from ..linear_operator import LinearOperator +from .linear_operator import LinearOperator from .fft_operator_support import RGRGTransformation,\ LMGLTransformation,\ LMHPTransformation,\ diff --git a/nifty/operators/fft_operator/__init__.py b/nifty/operators/fft_operator/__init__.py deleted file mode 100644 index cea86f72d..000000000 --- a/nifty/operators/fft_operator/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# 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-2017 Max-Planck-Society -# -# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik -# and financially supported by the Studienstiftung des deutschen Volkes. - -from .fft_operator import FFTOperator diff --git a/nifty/operators/fft_operator/fft_operator_support.py b/nifty/operators/fft_operator_support.py similarity index 98% rename from nifty/operators/fft_operator/fft_operator_support.py rename to nifty/operators/fft_operator_support.py index bb14e993c..8113ac19c 100644 --- a/nifty/operators/fft_operator/fft_operator_support.py +++ b/nifty/operators/fft_operator_support.py @@ -18,8 +18,8 @@ from __future__ import division import numpy as np -from ... import nifty_utilities as utilities -from ...low_level_library import hartley +from .. import nifty_utilities as utilities +from ..low_level_library import hartley class Transformation(object): def __init__(self, domain, codomain): diff --git a/nifty/operators/smoothing_operator/fft_smoothing_operator.py b/nifty/operators/fft_smoothing_operator.py similarity index 94% rename from nifty/operators/smoothing_operator/fft_smoothing_operator.py rename to nifty/operators/fft_smoothing_operator.py index 3384c26a7..4e8edd2fb 100644 --- a/nifty/operators/smoothing_operator/fft_smoothing_operator.py +++ b/nifty/operators/fft_smoothing_operator.py @@ -3,9 +3,9 @@ from builtins import range import numpy as np -from ..endomorphic_operator import EndomorphicOperator -from ..fft_operator import FFTOperator -from ... import DomainTuple +from .endomorphic_operator import EndomorphicOperator +from .fft_operator import FFTOperator +from .. import DomainTuple class FFTSmoothingOperator(EndomorphicOperator): def __init__(self, domain, sigma, space=None): diff --git a/nifty/operators/invertible_operator_mixin/invertible_operator_mixin.py b/nifty/operators/invertible_operator_mixin.py similarity index 98% rename from nifty/operators/invertible_operator_mixin/invertible_operator_mixin.py rename to nifty/operators/invertible_operator_mixin.py index 3b0454ca1..329ca07dc 100644 --- a/nifty/operators/invertible_operator_mixin/invertible_operator_mixin.py +++ b/nifty/operators/invertible_operator_mixin.py @@ -17,8 +17,8 @@ # and financially supported by the Studienstiftung des deutschen Volkes. from builtins import object -from ...energies import QuadraticEnergy -from ...field import Field +from ..energies import QuadraticEnergy +from ..field import Field class InvertibleOperatorMixin(object): diff --git a/nifty/operators/invertible_operator_mixin/__init__.py b/nifty/operators/invertible_operator_mixin/__init__.py deleted file mode 100644 index 1785cdbf1..000000000 --- a/nifty/operators/invertible_operator_mixin/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# 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-2017 Max-Planck-Society -# -# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik -# and financially supported by the Studienstiftung des deutschen Volkes. - -from .invertible_operator_mixin import InvertibleOperatorMixin diff --git a/nifty/operators/laplace_operator/laplace_operator.py b/nifty/operators/laplace_operator.py similarity index 95% rename from nifty/operators/laplace_operator/laplace_operator.py rename to nifty/operators/laplace_operator.py index eb0062bbc..ac5cc9006 100644 --- a/nifty/operators/laplace_operator/laplace_operator.py +++ b/nifty/operators/laplace_operator.py @@ -17,11 +17,11 @@ # and financially supported by the Studienstiftung des deutschen Volkes. import numpy as np -from ...field import Field -from ...spaces.power_space import PowerSpace -from ..endomorphic_operator import EndomorphicOperator -from ... import DomainTuple -from ... import nifty_utilities as utilities +from ..field import Field +from ..spaces.power_space import PowerSpace +from .endomorphic_operator import EndomorphicOperator +from .. import DomainTuple +from .. import nifty_utilities as utilities class LaplaceOperator(EndomorphicOperator): diff --git a/nifty/operators/laplace_operator/__init__.py b/nifty/operators/laplace_operator/__init__.py deleted file mode 100644 index 61427ae4f..000000000 --- a/nifty/operators/laplace_operator/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- - -from .laplace_operator import LaplaceOperator diff --git a/nifty/operators/linear_operator/linear_operator.py b/nifty/operators/linear_operator.py similarity index 98% rename from nifty/operators/linear_operator/linear_operator.py rename to nifty/operators/linear_operator.py index cc0b225ff..e1af3e810 100644 --- a/nifty/operators/linear_operator/linear_operator.py +++ b/nifty/operators/linear_operator.py @@ -18,10 +18,9 @@ from builtins import str import abc -from ...nifty_meta import NiftyMeta - -from ...field import Field -from ... import nifty_utilities as utilities +from ..nifty_meta import NiftyMeta +from ..field import Field +from .. import nifty_utilities as utilities from future.utils import with_metaclass diff --git a/nifty/operators/linear_operator/__init__.py b/nifty/operators/linear_operator/__init__.py deleted file mode 100644 index b1a31fde7..000000000 --- a/nifty/operators/linear_operator/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# 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-2017 Max-Planck-Society -# -# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik -# and financially supported by the Studienstiftung des deutschen Volkes. - -from .linear_operator import LinearOperator diff --git a/nifty/operators/response_operator/response_operator.py b/nifty/operators/response_operator.py similarity index 92% rename from nifty/operators/response_operator/response_operator.py rename to nifty/operators/response_operator.py index 863b19ca9..976d9e3d3 100644 --- a/nifty/operators/response_operator/response_operator.py +++ b/nifty/operators/response_operator.py @@ -1,11 +1,11 @@ from builtins import range -from ... import Field,\ - FieldArray,\ - DomainTuple -from ..linear_operator import LinearOperator -from ..smoothing_operator import FFTSmoothingOperator -from ..composed_operator import ComposedOperator -from ..diagonal_operator import DiagonalOperator +from .. import Field,\ + FieldArray,\ + DomainTuple +from .linear_operator import LinearOperator +from .fft_smoothing_operator import FFTSmoothingOperator +from .composed_operator import ComposedOperator +from .diagonal_operator import DiagonalOperator class ResponseOperator(LinearOperator): diff --git a/nifty/operators/response_operator/__init__.py b/nifty/operators/response_operator/__init__.py deleted file mode 100644 index f69488116..000000000 --- a/nifty/operators/response_operator/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .response_operator import ResponseOperator diff --git a/nifty/operators/smoothing_operator/__init__.py b/nifty/operators/smoothing_operator/__init__.py deleted file mode 100644 index 05acc9449..000000000 --- a/nifty/operators/smoothing_operator/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -# 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-2017 Max-Planck-Society -# -# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik -# and financially supported by the Studienstiftung des deutschen Volkes. - -from .fft_smoothing_operator import FFTSmoothingOperator -from .direct_smoothing_operator import DirectSmoothingOperator diff --git a/nifty/operators/smoothness_operator/smoothness_operator.py b/nifty/operators/smoothness_operator.py similarity index 92% rename from nifty/operators/smoothness_operator/smoothness_operator.py rename to nifty/operators/smoothness_operator.py index 9aa01c99a..613d5b5d6 100644 --- a/nifty/operators/smoothness_operator/smoothness_operator.py +++ b/nifty/operators/smoothness_operator.py @@ -1,7 +1,7 @@ -from ...spaces.power_space import PowerSpace -from ..endomorphic_operator import EndomorphicOperator -from ..laplace_operator import LaplaceOperator -from ... import Field, DomainTuple +from ..spaces.power_space import PowerSpace +from .endomorphic_operator import EndomorphicOperator +from .laplace_operator import LaplaceOperator +from .. import Field, DomainTuple class SmoothnessOperator(EndomorphicOperator): diff --git a/nifty/operators/smoothness_operator/__init__.py b/nifty/operators/smoothness_operator/__init__.py deleted file mode 100644 index 24e0f1fde..000000000 --- a/nifty/operators/smoothness_operator/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- - -from .smoothness_operator import SmoothnessOperator -- GitLab