Commit 1297585d authored by Theo Steininger's avatar Theo Steininger
Browse files

Merge branch 'python3' into 'master'

Add Python3 compatibility

See merge request !156
parents da29a8f4 a476b875
Pipeline #17025 passed with stages
in 24 minutes and 49 seconds
# -*- coding: utf-8 -*-
from cartesian_2D import Cartesian2D
from cartesian_3D import Cartesian3D
from geo import Geo
from .cartesian_2D import Cartesian2D
from .cartesian_3D import Cartesian3D
from .geo import Geo
# -*- coding: utf-8 -*-
from abc import abstractmethod
from scatter_plot import ScatterPlot
from .scatter_plot import ScatterPlot
class Cartesian(ScatterPlot):
......
# -*- coding: utf-8 -*-
from nifty.plotting.descriptors import Axis
from cartesian import Cartesian
from ...descriptors import Axis
from .cartesian import Cartesian
class Cartesian2D(Cartesian):
......
# -*- coding: utf-8 -*-
from nifty.plotting.descriptors import Axis
from cartesian import Cartesian
from ...descriptors import Axis
from .cartesian import Cartesian
class Cartesian3D(Cartesian):
......
from nifty.plotting.descriptors import Axis
from scatter_plot import ScatterPlot
from ...descriptors import Axis
from .scatter_plot import ScatterPlot
class Geo(ScatterPlot):
......
from healpix_plotter import HealpixPlotter
from gl_plotter import GLPlotter
from power_plotter import PowerPlotter
from rg1d_plotter import RG1DPlotter
from rg2d_plotter import RG2DPlotter
from .healpix_plotter import HealpixPlotter
from .gl_plotter import GLPlotter
from .power_plotter import PowerPlotter
from .rg1d_plotter import RG1DPlotter
from .rg2d_plotter import RG2DPlotter
# -*- coding: utf-8 -*-
from builtins import str
from builtins import zip
from builtins import range
import abc
import os
import sys
......@@ -17,6 +20,7 @@ from nifty.field import Field
import nifty.nifty_utilities as utilities
from nifty.plotting.figures import MultiFigure
from future.utils import with_metaclass
plotly = gdi.get('plotly')
......@@ -27,10 +31,8 @@ rank = d2o.config.dependency_injector[
d2o.configuration['mpi_module']].COMM_WORLD.rank
class PlotterBase(Loggable, object):
__metaclass__ = abc.ABCMeta
def __init__(self, interactive=False, path='plot.html'):
class PlotterBase(with_metaclass(abc.ABCMeta, type('NewBase', (Loggable, object), {}))):
def __init__(self, interactive=False, path='plot.html', title=""):
if plotly is None:
raise ImportError("The module plotly is needed but not available.")
self.interactive = interactive
......
# -*- coding: utf-8 -*-
from __future__ import division
import numpy as np
from nifty.spaces import RGSpace
......
......@@ -16,5 +16,5 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from prober import Prober
from mixin_classes import *
from .prober import Prober
from .mixin_classes import *
......@@ -16,5 +16,5 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from diagonal_prober_mixin import DiagonalProberMixin
from trace_prober_mixin import TraceProberMixin
from .diagonal_prober_mixin import DiagonalProberMixin
from .trace_prober_mixin import TraceProberMixin
......@@ -16,7 +16,9 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from nifty.sugar import create_composed_fft_operator
from __future__ import division
from builtins import object
from ...sugar import create_composed_fft_operator
class DiagonalProberMixin(object):
......
......@@ -16,7 +16,9 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from nifty.sugar import create_composed_fft_operator
from __future__ import division
from builtins import object
from ...sugar import create_composed_fft_operator
class TraceProberMixin(object):
......@@ -61,5 +63,5 @@ class TraceProberMixin(object):
mean = self.trace
sum_sq = self.__sum_of_squares
self.__trace_variance = ((sum_sq - sum_pr*mean) / (n-1))
self.__trace_variance = (sum_sq - sum_pr*mean) / (n-1)
return self.__trace_variance
......@@ -16,4 +16,4 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from prober import Prober
from .prober import Prober
......@@ -16,6 +16,9 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from builtins import str
from builtins import range
from builtins import object
import numpy as np
from nifty.field import Field
......@@ -91,7 +94,7 @@ class Prober(object):
def probing_run(self, callee):
""" controls the generation, evaluation and finalization of probes """
self.reset()
for index in xrange(self.probe_count):
for index in range(self.probe_count):
current_probe = self.get_probe(index)
pre_result = self.process_probe(callee, current_probe, index)
self.finish_probe(current_probe, pre_result)
......
......@@ -16,7 +16,9 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from builtins import object
import numpy as np
from functools import reduce
class Random(object):
......
......@@ -16,9 +16,9 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from gl_space import GLSpace
from hp_space import HPSpace
from lm_space import LMSpace
from power_space import PowerSpace
from rg_space import RGSpace
from space import Space
\ No newline at end of file
from .gl_space import GLSpace
from .hp_space import HPSpace
from .lm_space import LMSpace
from .power_space import PowerSpace
from .rg_space import RGSpace
from .space import Space
......@@ -16,4 +16,4 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from gl_space import GLSpace
from .gl_space import GLSpace
......@@ -21,8 +21,8 @@ from __future__ import division
import itertools
import numpy as np
from nifty.spaces.space import Space
from nifty.config import dependency_injector as gdi
from ..space import Space
from ...config import dependency_injector as gdi
pyHealpix = gdi.get('pyHealpix')
......
......@@ -16,4 +16,4 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from hp_space import HPSpace
from .hp_space import HPSpace
......@@ -16,9 +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 division
import numpy as np
from nifty.spaces.space import Space
from ..space import Space
class HPSpace(Space):
......
Markdown is supported
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