Skip to content

Commit

Permalink
commenting out analyzer that's failing because of comps login issues …
Browse files Browse the repository at this point in the history
…(nothing else has that problem, will investigate), cleaning up calibra folder BEFORE the run, small fixes.
  • Loading branch information
stitova-idm committed Sep 20, 2023
1 parent 6761884 commit 089a50e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
34 changes: 18 additions & 16 deletions examples/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_command(script="run_simulations.py", python_version: str = None):
# doing it manually because... too complicated otherwise? re
expected_outputs = [r"monique/calibration/baseline_calibration/01_serialize_transmission_sweep/experiment_id.txt",
r"monique/calibration/baseline_calibration/02_run_transmission_sweep/experiment_id.txt",
r"monthly_U5_PfPR.csv",
# r"monthly_U5_PfPR.csv",
r"../data/example_files/simulation_output/calibration/baseline_calibration/LL_allxLH_each_admin_run/CC_run3.csv",
r"../data/example_files/simulation_inputs/larval_habitats/monthly_habitats_1.csv",
r"monique/calibration/seasonality_calibration/01_burnin_for_seasonalityCalib/experiment_id.txt",
Expand Down Expand Up @@ -82,17 +82,17 @@ rule run_transmission_sweep:
shell(get_command(script=baseline_calibration + r"02_run_transmission_sweep/run_simulations.py",
python_version=config['python_version']))

rule analyze_ssmt_monthy_U5_PfPR:
input: baseline_calibration + r"02_run_transmission_sweep/experiment_id.txt",
baseline_calibration + r"03_analyze_ssmt_monthly_U5_PfPR.py"
output: r"monthly_U5_PfPR.csv"
run:
with open(input[0]) as exp_id_file:
burnin_id = exp_id_file.read()
update_parameters_in_file(input[1],
{"experiments = ": f"experiments = {{'PfPR_sweep_main_example': '{burnin_id}'}}\n"})
shell(get_command(script=baseline_calibration + r"03_analyze_ssmt_monthly_U5_PfPR.py",
python_version=config['python_version']))
# rule analyze_ssmt_monthy_U5_PfPR:
# input: baseline_calibration + r"02_run_transmission_sweep/experiment_id.txt",
# baseline_calibration + r"03_analyze_ssmt_monthly_U5_PfPR.py"
# output: r"monthly_U5_PfPR.csv"
# run:
# with open(input[0]) as exp_id_file:
# burnin_id = exp_id_file.read()
# update_parameters_in_file(input[1],
# {"experiments = ": f"experiments = {{'PfPR_sweep_main_example': '{burnin_id}'}}\n"})
# shell(get_command(script=baseline_calibration + r"03_analyze_ssmt_monthly_U5_PfPR.py",
# python_version=config['python_version']))

rule find_best_xLH_fits:
output:
Expand Down Expand Up @@ -131,11 +131,11 @@ rule seasonality_calibration:
"burnin_years = ": " burnin_years = 5\n"})
update_parameters_in_file(input[2],{"USER_PATH = ": f"USER_PATH = r'../data'\n",
"sif_id = None": "sif_id = 'dtk_sif.id'\n"})
shell(get_command(script=r"monique/calibration/seasonality_calibration/02_seasonality_calibration/run_calibration.py",
python_version=config['python_version']))
calibra = seasonality_cal + r"02_seasonality_calibration/Calibra_results"
if os.path.exists(calibra):
shutil.rmtree(calibra)
shell(get_command(script=r"monique/calibration/seasonality_calibration/02_seasonality_calibration/run_calibration.py",
python_version=config['python_version']))

rule save_best_seasonality_fit:
input: seasonality_cal + r"/03_save_best_seasonality_fit.py"
Expand Down Expand Up @@ -204,13 +204,15 @@ run_2005_to_2022 = r"ben/example/run_2005-2022/"

rule run_2005_2022:
input: run_1960_to_2004 + r"experiment_id.txt",
run_2005_to_2022 + r"params.py",run_2005_to_2022 + r"manifest.py"
run_2005_to_2022 + r"params.py",
run_2005_to_2022 + r"manifest.py"
output: run_2005_to_2022 + r"experiment_id.txt"
run:
with open(input[0]) as exp_id_file:
burnin_id = exp_id_file.read()
update_parameters_in_file(input[1],{"burnin_id = ": f"burnin_id = '{burnin_id}'\n",
"iopath = ": "iopath = 'ben/IO' \n"})
"iopath = ": "iopath = 'ben/IO' \n",
"ser_date =": "ser_date = 5 * 365\n"})
update_parameters_in_file(input[2],{"BEN_DIR = ": f"BEN_DIR = r'ben'\n",
"sif_path = ": "sif_path = 'dtk_sif.id'\n"})
shell(get_command(script=run_2005_to_2022 + r"run_simulations.py",
Expand Down
1 change: 1 addition & 0 deletions examples/ben/example/run_2005-2022/set_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def set_config(config):
config.parameters.Report_Event_Recorder_Events = ['Received_NMF_Treatment', 'Received_Severe_Treatment',
'Received_Treatment']
config.parameters.Report_Event_Recorder_Ignore_Events_In_List = 0
config.parameters.Custom_Individual_Events = ['Received_NMF_Treatment']

set_species_param(config, 'arabiensis', 'Anthropophily', 0.88, overwrite=True)
set_species_param(config, 'arabiensis', 'Indoor_Feeding_Fraction', 0.5, overwrite=True)
Expand Down

0 comments on commit 089a50e

Please sign in to comment.