From a3abe21c3638d7c197f8cd3ce11b3b2ad6950861 Mon Sep 17 00:00:00 2001 From: "INTERNAL\\stitova" Date: Thu, 19 Dec 2024 15:47:03 -0800 Subject: [PATCH] updating weather example - was failing due to Jenkins no longer making new weather files. --- examples/weather/example.py | 3 +-- examples/weather/scenarios_walkthrough.py | 11 +++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/weather/example.py b/examples/weather/example.py index f72c691..25ed631 100644 --- a/examples/weather/example.py +++ b/examples/weather/example.py @@ -10,8 +10,7 @@ print(input_dir) cb = emod_task.EMODTask.from_files(config_path=str(Path(input_dir).joinpath('config.json')), campaign_path=str(Path(input_dir).joinpath('campaign.json')), - eradication_path=str(Path(input_dir).joinpath('Eradication')), - ) + eradication_path=str(Path(input_dir).joinpath('Eradication'))) cb.common_assets.add_asset(str(Path(__file__).parent.joinpath('input/demographics.json'))) cb.common_assets.add_directory(str(Path(__file__).parent.joinpath('output/demo1')), relative_path="climate") cb.set_parameter('Simulation_Duration', 15) diff --git a/examples/weather/scenarios_walkthrough.py b/examples/weather/scenarios_walkthrough.py index d027198..aaf4ada 100644 --- a/examples/weather/scenarios_walkthrough.py +++ b/examples/weather/scenarios_walkthrough.py @@ -13,16 +13,19 @@ print("\n---=| WEATHER REQUEST |=---\n") # Request weather files -startdate = (datetime.today() - timedelta(180+365)).replace(day=1).strftime('%Y%j') -enddate= (datetime.today() - timedelta(180)).replace(day=1).strftime('%Y%j') +# using hardcoded dates because no new data is being generated is Jenkins failures +# Weather data is now only available until April 2024 or 2024152 (year + day of the year) +# startdate = (datetime.today() - timedelta(180+365)).replace(day=1).strftime('%Y%j') +# enddate= (datetime.today() - timedelta(180)).replace(day=1).strftime('%Y%j') wr = generate_weather(platform="Calculon", site_file="input/site_details.csv", - start_date=startdate, - end_date=enddate, + start_date=2023152, # see note above + end_date=2024152, # see note above node_column="id", id_reference="Custom user", local_dir=weather_dir1) + assert wr.files_exist print("Weather request files:") print("\n".join(wr.files))