Skip to content

Commit

Permalink
updating weather example - was failing due to Jenkins no longer makin…
Browse files Browse the repository at this point in the history
…g new weather files.
  • Loading branch information
stitova-idm committed Dec 19, 2024
1 parent c2689f3 commit a3abe21
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 1 addition & 2 deletions examples/weather/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 7 additions & 4 deletions examples/weather/scenarios_walkthrough.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit a3abe21

Please sign in to comment.