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