diff --git a/src/xfel_calibrate/calibrate.py b/src/xfel_calibrate/calibrate.py index a19663148161645990076c2fe7b14379f43ad306..6d53b8dae25ba793948463ab13ec230434397255 100755 --- a/src/xfel_calibrate/calibrate.py +++ b/src/xfel_calibrate/calibrate.py @@ -83,6 +83,11 @@ def make_initial_parser(**kwargs): help='Filename (and optionally path) for output' ' 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.') + parser.add_argument('--skip-report', action='store_true', help='Skip report generation in finalize step.') @@ -990,7 +995,7 @@ def run(): # canonical representation. not_reproducible_args = sorted( ('--' + x.replace('_', '-') - for x in ['skip_report', 'skip_env_freeze'] + for x in ['not_reproducible', 'skip_report', 'skip_env_freeze'] if args[x])) # If any of these arguments are set, present a warning. @@ -1003,11 +1008,14 @@ def run(): 'location is sufficient for your ' 'needs.'.format(', '.join(not_reproducible_args))) - try: - input('Press ENTER to continue or CTRL+C to abort...') - except KeyboardInterrupt: - # Catch the interrupt and silently exit. - sys.exit(0) + 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) reproducible = False else: