Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cspp-geo-gridded-glm
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cspp_geo
cspp-geo-gridded-glm
Commits
156ca01c
Commit
156ca01c
authored
4 years ago
by
Nick Bearson
Browse files
Options
Downloads
Patches
Plain Diff
correct the default logging level, and clamp to the accepted logging values (#11)
parent
a90ee80f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!5
2020 02 10 beta1 high priority
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gridded_glm/libexec/_minute_gridder.py
+3
-2
3 additions, 2 deletions
gridded_glm/libexec/_minute_gridder.py
with
3 additions
and
2 deletions
gridded_glm/libexec/_minute_gridder.py
+
3
−
2
View file @
156ca01c
...
...
@@ -28,7 +28,7 @@ def create_parser():
import
argparse
parser
=
argparse
.
ArgumentParser
(
description
=
parse_desc
)
parser
.
add_argument
(
'
-v
'
,
'
--verbose
'
,
dest
=
'
verbosity
'
,
action
=
"
count
"
,
default
=
0
,
help
=
'
each occurrence increases verbosity 1 level through ERROR-WARNING-INFO-DEBUG (default
INFO
)
'
)
help
=
'
each occurrence increases verbosity 1 level through ERROR-WARNING-INFO-DEBUG (default
ERROR
)
'
)
parser
.
add_argument
(
'
-l
'
,
'
--log
'
,
dest
=
"
log_fn
"
,
default
=
None
,
help
=
"
specify the log filename
"
)
# from Requirements: "Output is Gridded GLM in the native glmtools NetCDF4 format, with a user option to produce AWIPS-compatible NetCDF tiles as described below"
...
...
@@ -183,7 +183,8 @@ if __name__ == '__main__':
# Configure logging
levels
=
[
logging
.
ERROR
,
logging
.
WARN
,
logging
.
INFO
,
logging
.
DEBUG
]
logging
.
basicConfig
(
level
=
levels
[
min
(
3
,
args
.
verbosity
)],
filename
=
args
.
log_fn
)
clamp
=
lambda
n
,
minn
,
maxn
:
max
(
min
(
maxn
,
n
),
minn
)
# used below to keep us from going off the end of the logging levels
logging
.
basicConfig
(
level
=
levels
[
clamp
(
args
.
verbosity
,
0
,
len
(
levels
)
-
1
)],
filename
=
args
.
log_fn
)
if
levels
[
min
(
3
,
args
.
verbosity
)]
>
logging
.
DEBUG
:
import
warnings
warnings
.
filterwarnings
(
"
ignore
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment