Commit 339398ad authored by Martin Reinecke's avatar Martin Reinecke

Merge branch 'master' into fftw_for_the_masses

parents ce771e6d 85b5d01c
Pipeline #13202 passed with stage
in 5 minutes and 5 seconds
#!/bin/bash #!/bin/bash
git clone https://gitlab.mpcdf.mpg.de/ift/pyHealpix.git git clone https://gitlab.mpcdf.mpg.de/ift/pyHealpix.git
(cd pyHealpix && autoreconf -i && ./configure --enable-openmp --enable-native-optimizations && make -j4 install) (cd pyHealpix && autoreconf -i && ./configure --enable-openmp && make -j4 install)
rm -rf pyHealpix rm -rf pyHealpix
...@@ -37,7 +37,7 @@ class GLLMTransformation(SlicingTransformation): ...@@ -37,7 +37,7 @@ class GLLMTransformation(SlicingTransformation):
if module != 'pyHealpix': if module != 'pyHealpix':
raise ValueError("Unsupported SHT module.") raise ValueError("Unsupported SHT module.")
if 'pyHealpix' not in gdi: if pyHealpix is None:
raise ImportError( raise ImportError(
"The module pyHealpix is needed but not available.") "The module pyHealpix is needed but not available.")
......
...@@ -38,7 +38,7 @@ class HPLMTransformation(SlicingTransformation): ...@@ -38,7 +38,7 @@ class HPLMTransformation(SlicingTransformation):
if module != 'pyHealpix': if module != 'pyHealpix':
raise ValueError("Unsupported SHT module.") raise ValueError("Unsupported SHT module.")
if 'pyHealpix' not in gdi: if pyHealpix is None:
raise ImportError( raise ImportError(
"The module pyHealpix is needed but not available") "The module pyHealpix is needed but not available")
......
...@@ -37,7 +37,7 @@ class LMGLTransformation(SlicingTransformation): ...@@ -37,7 +37,7 @@ class LMGLTransformation(SlicingTransformation):
if module != 'pyHealpix': if module != 'pyHealpix':
raise ValueError("Unsupported SHT module.") raise ValueError("Unsupported SHT module.")
if 'pyHealpix' not in gdi: if pyHealpix is None:
raise ImportError( raise ImportError(
"The module pyHealpix is needed but not available.") "The module pyHealpix is needed but not available.")
......
...@@ -36,7 +36,7 @@ class LMHPTransformation(SlicingTransformation): ...@@ -36,7 +36,7 @@ class LMHPTransformation(SlicingTransformation):
if module != 'pyHealpix': if module != 'pyHealpix':
raise ValueError("Unsupported SHT module.") raise ValueError("Unsupported SHT module.")
if gdi.get('pyHealpix') is None: if pyHealpix is None:
raise ImportError( raise ImportError(
"The module pyHealpix is needed but not available.") "The module pyHealpix is needed but not available.")
......
...@@ -13,7 +13,7 @@ class GLMollweide(Heatmap): ...@@ -13,7 +13,7 @@ class GLMollweide(Heatmap):
def __init__(self, data, xsize=800, color_map=None, def __init__(self, data, xsize=800, color_map=None,
webgl=False, smoothing=False): webgl=False, smoothing=False):
# smoothing 'best', 'fast', False # smoothing 'best', 'fast', False
if 'pyHealpix' not in gdi: if pyHealpix is None:
raise ImportError( raise ImportError(
"The module pyHealpix is needed but not available.") "The module pyHealpix is needed but not available.")
self.xsize = xsize self.xsize = xsize
......
...@@ -12,7 +12,7 @@ pyHealpix = gdi.get('pyHealpix') ...@@ -12,7 +12,7 @@ pyHealpix = gdi.get('pyHealpix')
class HPMollweide(Heatmap): class HPMollweide(Heatmap):
def __init__(self, data, xsize=800, color_map=None, webgl=False, def __init__(self, data, xsize=800, color_map=None, webgl=False,
smoothing=False): # smoothing 'best', 'fast', False smoothing=False): # smoothing 'best', 'fast', False
if 'pyHealpix' not in gdi: if pyHealpix is None:
raise ImportError( raise ImportError(
"The module pyHealpix is needed but not available.") "The module pyHealpix is needed but not available.")
self.xsize = xsize self.xsize = xsize
......
...@@ -31,7 +31,7 @@ class PlotterBase(Loggable, object): ...@@ -31,7 +31,7 @@ class PlotterBase(Loggable, object):
__metaclass__ = abc.ABCMeta __metaclass__ = abc.ABCMeta
def __init__(self, interactive=False, path='.', title=""): def __init__(self, interactive=False, path='.', title=""):
if 'plotly' not in gdi: if plotly is None:
raise ImportError("The module plotly is needed but not available.") raise ImportError("The module plotly is needed but not available.")
self.interactive = interactive self.interactive = interactive
self.path = path self.path = path
......
...@@ -45,7 +45,7 @@ class GLSpace(Space): ...@@ -45,7 +45,7 @@ class GLSpace(Space):
Number of latitudinal bins (or rings) that are used for this Number of latitudinal bins (or rings) that are used for this
pixelization. pixelization.
nlon : int, *optional* nlon : int, *optional*
Number of longditudinal bins that are used for this pixelization. Number of longitudinal bins that are used for this pixelization.
Attributes Attributes
---------- ----------
...@@ -57,7 +57,7 @@ class GLSpace(Space): ...@@ -57,7 +57,7 @@ class GLSpace(Space):
Number of latitudinal bins (or rings) that are used for this Number of latitudinal bins (or rings) that are used for this
pixelization. pixelization.
nlon : int nlon : int
Number of longditudinal bins that are used for this pixelization. Number of longitudinal bins that are used for this pixelization.
total_volume : np.float total_volume : np.float
The total volume of the space. The total volume of the space.
shape : tuple of np.ints shape : tuple of np.ints
...@@ -89,7 +89,7 @@ class GLSpace(Space): ...@@ -89,7 +89,7 @@ class GLSpace(Space):
# ---Overwritten properties and methods--- # ---Overwritten properties and methods---
def __init__(self, nlat, nlon=None): def __init__(self, nlat, nlon=None):
if 'pyHealpix' not in gdi: if pyHealpix is None:
raise ImportError( raise ImportError(
"The module pyHealpix is needed but not available.") "The module pyHealpix is needed but not available.")
...@@ -163,7 +163,7 @@ class GLSpace(Space): ...@@ -163,7 +163,7 @@ class GLSpace(Space):
@property @property
def nlon(self): def nlon(self):
""" Number of longditudinal bins that are used for this pixelization. """ Number of longitudinal bins that are used for this pixelization.
""" """
return self._nlon return self._nlon
......
...@@ -16,47 +16,15 @@ ...@@ -16,47 +16,15 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik # NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes. # and financially supported by the Studienstiftung des deutschen Volkes.
import d2o
import numpy as np
from nose_parameterized import parameterized from nose_parameterized import parameterized
from nifty import RGSpace, LMSpace, HPSpace, GLSpace, PowerSpace from nifty import RGSpace, LMSpace, HPSpace, GLSpace, PowerSpace
from nifty.config import dependency_injector as di from nifty.config import dependency_injector as di
from string import strip
def pretty_str(obj):
if type(obj) == list:
return " ".join(pretty_str(x) for x in obj)
if type(obj) == tuple:
return " ".join(pretty_str(x) for x in obj)
if type(obj) == RGSpace:
return type(obj).__name__
elif type(obj) == LMSpace:
return type(obj).__name__
elif type(obj) == HPSpace:
return type(obj).__name__
elif type(obj) == GLSpace:
return type(obj).__name__
elif type(obj) == PowerSpace:
return type(obj).__name__
elif isinstance(obj, d2o.distributed_data_object):
return 'd2o'
elif type(obj) == dict:
if 'error' in obj:
return 'error_' + obj['error'].__name__
else:
return ''
elif type(obj) == np.ndarray:
return 'DATA'
else:
return str(obj)
def custom_name_func(testcase_func, param_num, param): def custom_name_func(testcase_func, param_num, param):
return "%s_%s" % ( return "%s_%s" % (
testcase_func.__name__, testcase_func.__name__,
strip(parameterized.to_safe_name( parameterized.to_safe_name("_".join(str(x) for x in param.args)),
" ".join(pretty_str(x) for x in param.args)), '_')
) )
......
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