Skip to content

Commit

Permalink
py norm
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumevernieres committed May 23, 2024
1 parent dece0c1 commit 812944d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/gw-ci/get_cycles.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import argparse
from datetime import datetime, timedelta


def read_idate_from_yaml(file_path):
idate_value = None
with open(file_path, 'r') as file:
Expand All @@ -13,6 +14,7 @@ def read_idate_from_yaml(file_path):
break
return idate_value


def format_dates(idate_str):
date_obj = datetime.strptime(idate_str, '%Y%m%d%H')
half_cycle = date_obj.strftime('%Y%m%d%H%M')
Expand All @@ -21,6 +23,7 @@ def format_dates(idate_str):

return half_cycle, full_cycle


def main():
parser = argparse.ArgumentParser(description="Extract and format idate.")
parser.add_argument('yaml_file', help="Path to exp.yaml file")
Expand All @@ -30,5 +33,6 @@ def main():
half_cycle, full_cycle = format_dates(idate_value)
print(f"{half_cycle},{full_cycle}")


if __name__ == "__main__":
main()

0 comments on commit 812944d

Please sign in to comment.