Commit 53c03aa0 authored by Jait Dixit's avatar Jait Dixit
Browse files

Change error message text for LMSpace, GLSpace and HPSpace

parent c0a6badc
Pipeline #9880 passed with stage
in 27 minutes and 45 seconds
......@@ -192,11 +192,9 @@ class GLSpace(Space):
def _parse_nlat(self, nlat):
nlat = int(nlat)
if nlat < 2:
raise ValueError(
"nlat must be a positive number.")
raise ValueError("nlat must be greater than 2.")
elif nlat % 2 != 0:
raise ValueError(
"nlat must be a multiple of 2.")
raise ValueError("nlat must be a multiple of 2.")
return nlat
def _parse_nlon(self, nlon):
......
......@@ -199,9 +199,10 @@ class HPSpace(Space):
def _parse_nside(self, nside):
nside = int(nside)
if nside & (nside - 1) != 0 or nside < 2:
raise ValueError(
"nside must be positive and a multiple of 2.")
if nside < 2:
raise ValueError("nside must be greater than 2.")
elif nside % 2 != 0:
raise ValueError("nside must be a multiple of 2.")
return nside
# ---Serialization---
......
......@@ -183,7 +183,7 @@ class LMSpace(Space):
def _parse_lmax(self, lmax):
lmax = np.int(lmax)
if lmax < 1:
raise ValueError("Negative lmax is not allowed.")
raise ValueError("lmax must be non-zero and positive.")
# exception lmax == 2 (nside == 1)
if (lmax % 2 == 0) and (lmax > 2):
self.logger.warn("Unrecommended parameter (lmax <> 2*n+1).")
......
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