Commit 7b4f3f69 authored by Pumpe, Daniel (dpumpe)'s avatar Pumpe, Daniel (dpumpe)

Merge branch 'master' of gitlab.mpcdf.mpg.de:ift/NIFTy

parents 51184972 85b5d01c
#!/bin/bash
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
......@@ -37,7 +37,7 @@ class GLLMTransformation(SlicingTransformation):
if module != 'pyHealpix':
raise ValueError("Unsupported SHT module.")
if 'pyHealpix' not in gdi:
if pyHealpix is None:
raise ImportError(
"The module pyHealpix is needed but not available.")
......
......@@ -38,7 +38,7 @@ class HPLMTransformation(SlicingTransformation):
if module != 'pyHealpix':
raise ValueError("Unsupported SHT module.")
if 'pyHealpix' not in gdi:
if pyHealpix is None:
raise ImportError(
"The module pyHealpix is needed but not available")
......
......@@ -37,7 +37,7 @@ class LMGLTransformation(SlicingTransformation):
if module != 'pyHealpix':
raise ValueError("Unsupported SHT module.")
if 'pyHealpix' not in gdi:
if pyHealpix is None:
raise ImportError(
"The module pyHealpix is needed but not available.")
......
......@@ -36,7 +36,7 @@ class LMHPTransformation(SlicingTransformation):
if module != 'pyHealpix':
raise ValueError("Unsupported SHT module.")
if gdi.get('pyHealpix') is None:
if pyHealpix is None:
raise ImportError(
"The module pyHealpix is needed but not available.")
......
......@@ -13,7 +13,7 @@ class GLMollweide(Heatmap):
def __init__(self, data, xsize=800, color_map=None,
webgl=False, smoothing=False):
# smoothing 'best', 'fast', False
if 'pyHealpix' not in gdi:
if pyHealpix is None:
raise ImportError(
"The module pyHealpix is needed but not available.")
self.xsize = xsize
......
......@@ -12,7 +12,7 @@ pyHealpix = gdi.get('pyHealpix')
class HPMollweide(Heatmap):
def __init__(self, data, xsize=800, color_map=None, webgl=False,
smoothing=False): # smoothing 'best', 'fast', False
if 'pyHealpix' not in gdi:
if pyHealpix is None:
raise ImportError(
"The module pyHealpix is needed but not available.")
self.xsize = xsize
......
......@@ -31,7 +31,7 @@ class PlotterBase(Loggable, object):
__metaclass__ = abc.ABCMeta
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.")
self.interactive = interactive
self.path = path
......
......@@ -45,7 +45,7 @@ class GLSpace(Space):
Number of latitudinal bins (or rings) that are used for this
pixelization.
nlon : int, *optional*
Number of longditudinal bins that are used for this pixelization.
Number of longitudinal bins that are used for this pixelization.
Attributes
----------
......@@ -57,7 +57,7 @@ class GLSpace(Space):
Number of latitudinal bins (or rings) that are used for this
pixelization.
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
The total volume of the space.
shape : tuple of np.ints
......@@ -89,7 +89,7 @@ class GLSpace(Space):
# ---Overwritten properties and methods---
def __init__(self, nlat, nlon=None):
if 'pyHealpix' not in gdi:
if pyHealpix is None:
raise ImportError(
"The module pyHealpix is needed but not available.")
......@@ -163,7 +163,7 @@ class GLSpace(Space):
@property
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
......
......@@ -16,47 +16,15 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
import d2o
import numpy as np
from nose_parameterized import parameterized
from nifty import RGSpace, LMSpace, HPSpace, GLSpace, PowerSpace
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):
return "%s_%s" % (
testcase_func.__name__,
strip(parameterized.to_safe_name(
" ".join(pretty_str(x) for x in param.args)), '_')
parameterized.to_safe_name("_".join(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