Commit d7986d11 authored by Theo Steininger's avatar Theo Steininger
Browse files

Removed pretty_str from

parent 45c8584b
......@@ -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__
return ''
elif type(obj) == np.ndarray:
return 'DATA'
return str(obj)
def custom_name_func(testcase_func, param_num, param):
return "%s_%s" % (
" ".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