diff --git a/SEPTREFHUM.py b/SEPTREFHUM.py index a1cb743084cf15ef88abb184f2d8ba4a73efed8a..0e1bb803b09f2f0b5d68511714c6d9c98b1291ad 100755 --- a/SEPTREFHUM.py +++ b/SEPTREFHUM.py @@ -69,14 +69,11 @@ if last_wh_date is not None: print(f"Last date of WH calculations is {last_wh_date}. Start date = {start_date}") - -# TODO: let filename/pattern be configurable <== DONE?? weatherdata_files = glob.glob(f"{infile_path}{filename_pattern}") #print(f"{infile_path}{filename_pattern}") #print("What are the weatherdata files?") #print(weatherdata_files) for file_path in sorted(weatherdata_files): - print("Examining %s" % file_path) # TODO: When filename/pattern is configurable: make the string search adaptable file_name = os.path.basename(file_path) # Skip if we don't have a complete date, which could indicate that we are looking at a yearly file of daily data @@ -85,12 +82,7 @@ for file_path in sorted(weatherdata_files): except ValueError as e: print(e) continue - #file_date = file_name[file_name.index("nordic")+7:file_name.index("nordic")+17] - # Skip if we don't have a complete date (10 characters), which could indicate that we are looking at a yearly file of daily data - #if len(file_date) != 10: - # continue - - #wh_sum_date = local_timezone.localize(datetime.strptime(f"{file_date}", "%Y-%m-%d")) + # Only process files from the three last days (if this is not a work from scratch) if start_date is not None and wh_sum_date < start_date: continue