Commit 87d151ee authored by M Selig's avatar M Selig

Merge pull request #6 from JohannesBuchner/master

bugfix ("raise" added before TypeError in enforce_power)
parents a52439f0 579f4362
......@@ -2443,7 +2443,7 @@ class rg_space(space):
try:
spec = np.array(spec(kindex),dtype=self.datatype)
except:
TypeError(about._errors.cstring("ERROR: invalid power spectra function.")) ## exception in ``spec(kindex)``
raise TypeError(about._errors.cstring("ERROR: invalid power spectra function.")) ## exception in ``spec(kindex)``
elif(np.isscalar(spec)):
spec = np.array([spec],dtype=self.datatype)
else:
......@@ -3548,7 +3548,7 @@ class lm_space(space):
try:
spec = np.array(spec(np.arange(self.para[0]+1,dtype=np.int)),dtype=self.datatype)
except:
TypeError(about._errors.cstring("ERROR: invalid power spectra function.")) ## exception in ``spec(kindex)``
raise TypeError(about._errors.cstring("ERROR: invalid power spectra function.")) ## exception in ``spec(kindex)``
elif(np.isscalar(spec)):
spec = np.array([spec],dtype=self.datatype)
else:
......@@ -4384,7 +4384,7 @@ class gl_space(space):
try:
spec = np.array(spec(np.arange(self.para[0],dtype=np.int)),dtype=self.datatype)
except:
TypeError(about._errors.cstring("ERROR: invalid power spectra function.")) ## exception in ``spec(kindex)``
raise TypeError(about._errors.cstring("ERROR: invalid power spectra function.")) ## exception in ``spec(kindex)``
elif(np.isscalar(spec)):
spec = np.array([spec],dtype=self.datatype)
else:
......@@ -5027,7 +5027,7 @@ class hp_space(space):
try:
spec = np.array(spec(np.arange(3*self.para[0],dtype=np.int)),dtype=self.datatype)
except:
TypeError(about._errors.cstring("ERROR: invalid power spectra function.")) ## exception in ``spec(kindex)``
raise TypeError(about._errors.cstring("ERROR: invalid power spectra function.")) ## exception in ``spec(kindex)``
elif(np.isscalar(spec)):
spec = np.array([spec],dtype=self.datatype)
else:
......
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