Skip to content
Snippets Groups Projects
Commit 98efc5b4 authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Rename `date_format` to template

Clearer for the user.
parent 095ebf7a
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@ argparser = argparse.ArgumentParser()
argparser.add_argument("first_file",
help = "NetCDF file containing SSH and velocity at a "
"single date")
argparser.add_argument("date_format",
argparser.add_argument("template",
help = "template of basename with date format")
argparser.add_argument("-l", "--last_date", help = "%%Y-%%m-%%d")
argparser.add_argument("-b", "--bbox", nargs=4, type = float,
......@@ -35,7 +35,7 @@ for orient in ["cyclo", "anti"]:
shutil.rmtree(f"SHPC_{orient}_all_dates")
dirname, basename = path.split(args.first_file)
my_date = datetime.datetime.strptime(basename, args.date_format).date()
my_date = datetime.datetime.strptime(basename, args.template).date()
nc_file = args.first_file
nco_instance = nco.Nco()
......@@ -96,7 +96,7 @@ while True:
my_date += datetime.timedelta(1)
if my_date > last_date: break
basename = my_date.strftime(args.date_format)
basename = my_date.strftime(args.template)
nc_file = path.join(dirname, basename)
os.remove("unpacked.nc")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment