diff --git a/ADASMELIAE.py b/ADASMELIAE.py index 29965683c64e2e601da552b5a625e094a7cbc196..c44a575dd753fd273c5c45c91b3de7761e362171 100755 --- a/ADASMELIAE.py +++ b/ADASMELIAE.py @@ -75,7 +75,6 @@ tm_max = "air_temperature_2m_max" THRESHOLD = 15 - # Run given command using subprocess.run. Handle logging. def run_command(command, stdout=subprocess.PIPE): logging.debug(f"{command}") @@ -157,8 +156,8 @@ def split_by_date(input_file, prefix): if __name__ == "__main__": - start_time = time.time() # For logging execution time - today = datetime.now().date() + script_start_time = time.time() # For logging execution time + today = datetime.now().date() # timezone not included, since we are only interested in the year cron_run = True # Check if a year argument is provided @@ -166,7 +165,6 @@ if __name__ == "__main__": year = int(sys.argv[1]) cron_run = False else: - today = datetime.now().date() year = today.year # Ensure that model is not run for future year @@ -346,7 +344,7 @@ if __name__ == "__main__": remove_temporary_files() - end_time = time.time() + script_end_time = time.time() logging.info( - f"End model {model_id} - Execution time: {'{:.2f} seconds'.format(end_time - start_time)}" + f"End model {model_id} - Execution time: {'{:.2f} seconds'.format(script_end_time - script_start_time)}" )