Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Eva Schiffer
UW-Glance
Commits
b8ad57f9
Commit
b8ad57f9
authored
Feb 23, 2022
by
Eva Schiffer
Browse files
change our command line default to be having pass/fail testing on, new option to turn off
parent
8343dadd
Changes
3
Hide whitespace changes
Inline
Side-by-side
pyglance/glance/compare.py
View file @
b8ad57f9
...
...
@@ -833,7 +833,7 @@ def report_two_inputs_library_call (a_path, b_path, var_list=None,
# if no criteria were set then this will be true
didPassAll
=
True
do_pass_fail
=
options_set
[
DO_TEST_PASSFAIL_KEY
]
# todo, this is a temporary hack, should be loaded with other options
# load the user settings from either the command line or a user defined config file
pathsTemp
,
runInfo
,
defaultValues
,
requestedNames
,
usedConfigFile
=
config_organizer
.
load_config_or_options
(
a_path
,
b_path
,
options_set
,
...
...
@@ -1040,7 +1040,7 @@ def report_two_inputs_library_call (a_path, b_path, var_list=None,
min_acceptable_r_squared_default
=
defaultValues
[
MIN_OK_R_SQUARED_COEFF_KEY
],
)
varRunInfo
[
DID_VARIABLE_PASS_KEY
]
=
didPass
varRunInfo
[
DID_VARIABLE_PASS_KEY
]
=
didPass
if
do_pass_fail
else
None
# update the overall pass status
didPassAll
=
didPassAll
and
didPass
if
didPass
is
not
None
else
didPassAll
...
...
@@ -1145,7 +1145,7 @@ def report_two_inputs_library_call (a_path, b_path, var_list=None,
tempVarStats
=
variable_stats
.
dictionary_form
()
epsilonPassedPercent
=
(
1.0
-
epsilon_failed_fraction
)
*
100.0
finitePassedPercent
=
(
1.0
-
non_finite_fail_fraction
)
*
100.0
tmpDidPass
=
varRunInfo
[
DID_VARIABLE_PASS_KEY
]
# TODO, need to reevaluate this: if do_pass_fail else None
tmpDidPass
=
varRunInfo
[
DID_VARIABLE_PASS_KEY
]
tempShape
=
tempVarStats
[
"General Statistics"
][
"shape"
]
tempValue
=
None
if
SINGLE_VAL_MSG
not
in
tempShape
else
tempVarStats
[
"General Statistics"
][
"max_a"
]
# since it's the only value, it's also the max!
variableComparisons
[
displayName
]
=
{
...
...
@@ -1453,11 +1453,11 @@ def stats_two_inputs_library_call(afn, bfn, var_list=None,
print
((
'
\n\n
'
+
statistics
.
get_comparison_doc_string
()),
file
=
output_channel
,)
# if we are doing pass/fail, we need to return a status code
status_code
=
0
status_code
=
0
# note: if we aren't doing pass/fail, stats will return zero
if
do_pass_fail
:
status_code
=
0
if
not
has_failed
else
3
LOG
.
debug
(
"stats is returning status code: "
+
str
(
status_code
))
return
status_code
# note: if we aren't doing pass/fail, stats will return zero
return
status_code
def
stats_one_input_library_call
(
afn
,
var_list
=
None
,
options_set
=
None
,
do_document
=
False
,
output_channel
=
sys
.
stdout
):
...
...
pyglance/glance/config_organizer.py
View file @
b8ad57f9
...
...
@@ -643,9 +643,13 @@ def parse_arguments (version_string, commands_list, commands_help_text, ) :
help
=
'regular expression to remove from all file names when automatically matching files for comparison'
)
# should pass/fail be tested?
parser
.
add_argument
(
'-x'
,
'--doPassFail'
,
dest
=
DO_TEST_PASSFAIL_KEY
,
parser
.
add_argument
(
'--noPassFail'
,
dest
=
DO_TEST_PASSFAIL_KEY
,
action
=
"store_false"
,
default
=
True
,
help
=
"do not test for pass/fail while comparing data (will have no effect unless data is compared)"
)
# note: this older version has been deprecated, so it will not be advertised in the help message
parser
.
add_argument
(
'-x'
,
'--doPassFail'
,
dest
=
TMP_PASSFAIL_OLD_KEY
,
action
=
"store_true"
,
default
=
False
,
help
=
"test for pass/fail while comparing data (only affects analysis where data is compared)"
)
help
=
argparse
.
SUPPRESS
)
# whether or not to do multiprocessing
parser
.
add_argument
(
'-f'
,
'--fork'
,
dest
=
DO_MAKE_FORKS_KEY
,
...
...
@@ -714,7 +718,13 @@ def convert_options_to_dict (options) :
# whether or not to do pass fail testing
tempOptions
[
DO_TEST_PASSFAIL_KEY
]
=
options
.
usePassFail
# if the user used the old pass fail option, tell them it's deprecated
if
options
.
oldUsePassFail
:
LOG
.
warning
(
"The command line option -x or --doPassFail has been deprecated. "
"Glance will now do pass/fail testing by default. "
"Use --noPassFail to turn pass/fail testing off."
)
# whether or not to do multiprocessing
tempOptions
[
DO_MAKE_FORKS_KEY
]
=
options
.
doFork
...
...
pyglance/glance/constants.py
View file @
b8ad57f9
...
...
@@ -41,6 +41,7 @@ DO_MAKE_FORKS_KEY = 'doFork'
DO_CLEAR_MEM_THREADED_KEY
=
'useThreadsToControlMemory'
USE_SHARED_ORIG_RANGE_KEY
=
'useSharedRangeForOriginal'
DO_TEST_PASSFAIL_KEY
=
'usePassFail'
TMP_PASSFAIL_OLD_KEY
=
'oldUsePassFail'
DO_IMAGES_ONLY_ON_FAIL_KEY
=
'only_plot_on_fail'
USE_NO_LON_OR_LAT_VARS_KEY
=
'noLonLatVars'
SHORT_CIRCUIT_DIFFS_KEY
=
'short_circuit_diffs'
...
...
Write
Preview
Supports
Markdown
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