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
Merge requests
!5
2020 02 10 beta1 high priority
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
2020 02 10 beta1 high priority
2020-02-10-beta1-high-priority
into
master
Overview
1
Commits
9
Pipelines
0
Changes
1
Merged
Nick Bearson
requested to merge
2020-02-10-beta1-high-priority
into
master
4 years ago
Overview
1
Commits
9
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Viewing commit
156ca01c
Prev
Next
Show latest version
1 file
+
3
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
156ca01c
correct the default logging level, and clamp to the accepted logging values (#11)
· 156ca01c
Nick Bearson
authored
4 years ago
gridded_glm/libexec/_minute_gridder.py
+
3
−
2
Options
@@ -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
"
)
Loading