Skip to content
Snippets Groups Projects

Add warning if xfel-calibrate may not be reproducible

Merged Philipp Schmidt requested to merge feat/non-reproducible-warning into master
@@ -84,16 +84,16 @@ def make_initial_parser(**kwargs):
' report')
parser.add_argument('--not-reproducible', action='store_true',
help='Disable checks or confirmations that may cause '
'the processed result to not be reproducible at '
'a later point in time.')
help='Disable checks to allow the processing result '
'to not be reproducible based on its metadata.')
parser.add_argument('--skip-report', action='store_true',
help='Skip report generation in finalize step.')
parser.add_argument('--skip-env-freeze', action='store_true',
help='Skip recording the Python environment for '
'reproducibility purposes.')
'reproducibility purposes, requires '
'--not-reproducible to run.')
parser.add_argument('--concurrency-par', type=str,
help='Name of concurrency parameter.'
@@ -995,7 +995,7 @@ def run():
# canonical representation.
not_reproducible_args = sorted(
('--' + x.replace('_', '-')
for x in ['not_reproducible', 'skip_report', 'skip_env_freeze']
for x in ['skip_env_freeze']
if args[x]))
# If any of these arguments are set, present a warning.
@@ -1009,13 +1009,11 @@ def run():
'needs.'.format(', '.join(not_reproducible_args)))
if not args['not_reproducible']:
# If reproducibility has not been permitted to be broken
# explicitly, force the user to confirm this explicitly.
try:
input('Press ENTER to continue or CTRL+C to abort...')
except KeyboardInterrupt:
# Catch the interrupt and silently exit.
sys.exit(0)
# If not explicitly specified that reproducibility may be
# broken, remind the user and exit.
print('To proceed, you can explicitly allow reproducibility to '
'be broken by adding --not-reproducible')
sys.exit(1)
reproducible = False
else:
Loading