Commit fd6d03be authored by Theo Steininger's avatar Theo Steininger

Merge branch 'MR_issue67' into 'master'

improve grid size checks for GL

See merge request !56
parents f1b1b6d4 1a1bcaa1
Pipeline #11417 passed with stages
in 30 minutes and 23 seconds
......@@ -205,10 +205,9 @@ class GLSpace(Space):
def _parse_nlat(self, nlat):
nlat = int(nlat)
if nlat < 2:
raise ValueError("nlat must be greater than 2.")
elif nlat % 2 != 0:
raise ValueError("nlat must be a multiple of 2.")
if nlat < 1:
raise ValueError(
"nlat must be a positive number.")
return nlat
def _parse_nlon(self, nlon):
......@@ -216,9 +215,8 @@ class GLSpace(Space):
nlon = 2 * self.nlat - 1
else:
nlon = int(nlon)
if nlon != 2 * self.nlat - 1:
self.logger.warn("nlon was set to an unrecommended value: "
"nlon <> 2*nlat-1.")
if nlon < 1:
raise ValueError("nlon must be a positive number.")
return nlon
# ---Serialization---
......
......@@ -37,10 +37,7 @@ CONSTRUCTOR_CONFIGS = [
'total_volume': 4 * np.pi,
'dtype': np.dtype('float64')
}],
[1, None, None, {
'error': ValueError
}],
[5, None, None, {
[0, None, None, {
'error': ValueError
}]
]
......
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