FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit 987428eb authored by L. Bower's avatar L. Bower
Browse files

adding regional forecast images to the advisory

parent 04c70e93
No related branches found
No related tags found
No related merge requests found
......@@ -46,8 +46,8 @@ class ProcessorBase:
def __init__(self) -> None:
super().__init__()
time_now = datetime.datetime.today()
self.todayString = time_now.strftime('%Y%m%d')
self.nowString = time_now.strftime('%Y%m%d-%H%M-%S')
self.today_string = time_now.strftime('%Y%m%d')
self.now_string = time_now.strftime('%Y%m%d-%H%M-%S')
def parse_and_check_args(self) -> dict:
......@@ -99,7 +99,7 @@ class ProcessorBase:
'-d', '--run-date',
metavar = 'YYYYMMDD',
action = 'store',
default = self.todayString,
default = self.today_string,
help = 'Initial day of calculation, starting at 00 UTC (Default is today)',
dest = 'start_date',
)
......@@ -129,11 +129,11 @@ class ProcessorBase:
raise RuntimeError
# check the startstring
if args.start_date is not self.todayString:
if args.start_date is not self.today_string:
try:
# check date string is formatted correctly
provided_start_date = datetime.datetime.strptime(args.start_date, '%Y%m%d')
today_date = datetime.datetime.strptime(self.todayString, '%Y%m%d')
today_date = datetime.datetime.strptime(self.today_string, '%Y%m%d')
# early limit is quite arbitrary, but this is earliest year of available survey data for Ethiopia
date_limit_early = datetime.datetime.strptime('20070101', '%Y%m%d')
......@@ -198,7 +198,7 @@ class ProcessorBase:
:return:
"""
if os.path.exists(job_path):
archived_dir_path = f"{job_path}-ARCHIVE_{self.nowString}"
archived_dir_path = f"{job_path}-ARCHIVE_{self.now_string}"
message = f"Job path {job_path} already exists, so moving it to {archived_dir_path}"
print(message)
os.rename(job_path, archived_dir_path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment