From 664de4163c75aa854feba8fe5ae613ca615667ed Mon Sep 17 00:00:00 2001
From: Lene Wasskog <lene.wasskog@nibio.no>
Date: Fri, 28 Feb 2025 11:39:11 +0100
Subject: [PATCH] refactor: Rename variables

---
 ADASMELIAE.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/ADASMELIAE.py b/ADASMELIAE.py
index 2996568..c44a575 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)}"
     )
-- 
GitLab