Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NIFTy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ift
NIFTy
Commits
fd6d03be
Commit
fd6d03be
authored
Apr 16, 2017
by
Theo Steininger
Browse files
Options
Browse Files
Download
Plain Diff
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
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
11 deletions
+6
-11
nifty/spaces/gl_space/gl_space.py
nifty/spaces/gl_space/gl_space.py
+5
-7
test/test_spaces/test_gl_space.py
test/test_spaces/test_gl_space.py
+1
-4
No files found.
nifty/spaces/gl_space/gl_space.py
View file @
fd6d03be
...
...
@@ -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---
...
...
test/test_spaces/test_gl_space.py
View file @
fd6d03be
...
...
@@ -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
}]
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment