Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ebas-io
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
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
EBAS
ebas-io
Commits
dcdf332d
Commit
dcdf332d
authored
3 years ago
by
Paul Eckhardt
Browse files
Options
Downloads
Patches
Plain Diff
ADD: --ignore for rescode
CHANGE: change ignore_parameters to regular --ignore option
parent
dd8fb0d5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Examples/ebas_convert.py
+15
-4
15 additions, 4 deletions
Examples/ebas_convert.py
with
15 additions
and
4 deletions
Examples/ebas_convert.py
+
15
−
4
View file @
dcdf332d
...
@@ -76,7 +76,8 @@ def add_private_args(parser, cmdline): # pylint: disable=W0613
...
@@ -76,7 +76,8 @@ def add_private_args(parser, cmdline): # pylint: disable=W0613
'
--ignore
'
,
'
--ignore
'
,
type
=
ParseStrings
(
allow_scalar
=
True
,
allow_list
=
True
,
type
=
ParseStrings
(
allow_scalar
=
True
,
allow_list
=
True
,
allowed_values
=
[
'
numformat
'
,
'
dx0
'
,
allowed_values
=
[
'
numformat
'
,
'
dx0
'
,
'
identical-values
'
]),
'
identical-values
'
,
'
parameter
'
,
'
rescode
'
]),
default
=
[],
default
=
[],
help
=
'
ignore certain errors while reading (numformat, dx0,
'
help
=
'
ignore certain errors while reading (numformat, dx0,
'
'
identical-values)
\n\n
'
'
identical-values)
\n\n
'
...
@@ -91,7 +92,11 @@ def add_private_args(parser, cmdline): # pylint: disable=W0613
...
@@ -91,7 +92,11 @@ def add_private_args(parser, cmdline): # pylint: disable=W0613
'
should be read, use this flag to downgrade the ERROR severity to
'
'
should be read, use this flag to downgrade the ERROR severity to
'
'
WARNING. For the opposite (those cases are definitely identified as
'
'
WARNING. For the opposite (those cases are definitely identified as
'
'
ERROR should not be read while the rest of the file should be read,
'
'
ERROR should not be read while the rest of the file should be read,
'
'
consider the --skip-variables parameter)
'
)
'
consider the --skip-variables parameter)
\n\n
'
'
parameter: ignore validity of parameters (component names or
'
'
component/matrix combination.
\n\n
'
'
rescode: ignore wrong resolution codes (not consistent with
'
'
resolution of data).
'
)
parser_nasa_group
.
add_argument
(
parser_nasa_group
.
add_argument
(
'
--skip-variables
'
,
'
--skip-variables
'
,
type
=
ParseIntegers
(
allow_scalar
=
True
,
allow_list
=
True
,
type
=
ParseIntegers
(
allow_scalar
=
True
,
allow_list
=
True
,
...
@@ -106,7 +111,6 @@ def add_private_args(parser, cmdline): # pylint: disable=W0613
...
@@ -106,7 +111,6 @@ def add_private_args(parser, cmdline): # pylint: disable=W0613
'
start_time and end_time can not be skipped, numflags may not be
'
'
start_time and end_time can not be skipped, numflags may not be
'
'
skipped
'
)
'
skipped
'
)
parser_nasa_group
.
add_argument
(
'
--skip_unitconvert
'
,
action
=
'
store_true
'
)
parser_nasa_group
.
add_argument
(
'
--skip_unitconvert
'
,
action
=
'
store_true
'
)
parser_nasa_group
.
add_argument
(
'
--ignore_parameter
'
,
action
=
'
store_true
'
)
parser_nasa_group
.
add_argument
(
parser_nasa_group
.
add_argument
(
'
filenames
'
,
nargs
=
'
*
'
,
'
filenames
'
,
nargs
=
'
*
'
,
help
=
'
input file(s), EBAS NASA-Ames format
'
)
help
=
'
input file(s), EBAS NASA-Ames format
'
)
...
@@ -248,12 +252,19 @@ def read_file(args, logger, filename):
...
@@ -248,12 +252,19 @@ def read_file(args, logger, filename):
ignore_identicalvalues
=
False
ignore_identicalvalues
=
False
if
'
identical-values
'
in
args
.
ignore
:
if
'
identical-values
'
in
args
.
ignore
:
ignore_identicalvalues
=
True
ignore_identicalvalues
=
True
ignore_parameter
=
False
if
'
parameter
'
in
args
.
ignore
:
ignore_parameter
=
True
ignore_rescode
=
False
if
'
rescode
'
in
args
.
ignore
:
ignore_rescode
=
True
skip_variables
=
[
args
.
skip_variables
]
\
skip_variables
=
[
args
.
skip_variables
]
\
if
isinstance
(
args
.
skip_variables
,
int
)
else
args
.
skip_variables
if
isinstance
(
args
.
skip_variables
,
int
)
else
args
.
skip_variables
try
:
try
:
nas
.
read
(
filename
,
skip_unitconvert
=
args
.
skip_unitconvert
,
nas
.
read
(
filename
,
skip_unitconvert
=
args
.
skip_unitconvert
,
ignore_parameter
=
args
.
ignore_parameter
,
ignore_parameter
=
ignore_parameter
,
ignore_rescode
=
ignore_rescode
,
ignore_numformat
=
ignore_numformat
,
ignore_dx0
=
ignore_dx0
,
ignore_numformat
=
ignore_numformat
,
ignore_dx0
=
ignore_dx0
,
ignore_identicalvalues
=
ignore_identicalvalues
,
ignore_identicalvalues
=
ignore_identicalvalues
,
skip_variables
=
skip_variables
)
skip_variables
=
skip_variables
)
...
...
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