Skip to content
Snippets Groups Projects
Commit 664de416 authored by Lene Wasskog's avatar Lene Wasskog
Browse files

refactor: Rename variables

parent 8b0d2ce7
Branches
No related tags found
No related merge requests found
Pipeline #6011 skipped
...@@ -75,7 +75,6 @@ tm_max = "air_temperature_2m_max" ...@@ -75,7 +75,6 @@ tm_max = "air_temperature_2m_max"
THRESHOLD = 15 THRESHOLD = 15
# Run given command using subprocess.run. Handle logging. # Run given command using subprocess.run. Handle logging.
def run_command(command, stdout=subprocess.PIPE): def run_command(command, stdout=subprocess.PIPE):
logging.debug(f"{command}") logging.debug(f"{command}")
...@@ -157,8 +156,8 @@ def split_by_date(input_file, prefix): ...@@ -157,8 +156,8 @@ def split_by_date(input_file, prefix):
if __name__ == "__main__": if __name__ == "__main__":
start_time = time.time() # For logging execution time script_start_time = time.time() # For logging execution time
today = datetime.now().date() today = datetime.now().date() # timezone not included, since we are only interested in the year
cron_run = True cron_run = True
# Check if a year argument is provided # Check if a year argument is provided
...@@ -166,7 +165,6 @@ if __name__ == "__main__": ...@@ -166,7 +165,6 @@ if __name__ == "__main__":
year = int(sys.argv[1]) year = int(sys.argv[1])
cron_run = False cron_run = False
else: else:
today = datetime.now().date()
year = today.year year = today.year
# Ensure that model is not run for future year # Ensure that model is not run for future year
...@@ -346,7 +344,7 @@ if __name__ == "__main__": ...@@ -346,7 +344,7 @@ if __name__ == "__main__":
remove_temporary_files() remove_temporary_files()
end_time = time.time() script_end_time = time.time()
logging.info( 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)}"
) )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment