Skip to content

Commit

Permalink
removed proportion_asymptomatic (this is no longer used in the opencl…
Browse files Browse the repository at this point in the history
… model)
  • Loading branch information
Nick Malleson committed Nov 11, 2020
1 parent 59cb127 commit 8cc167e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
17 changes: 6 additions & 11 deletions experiments/opencl_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def get_mean_total_counts(summaries, disease_status: int):
@staticmethod
def create_parameters(parameters_file: str = None,
current_risk_beta: float = None,
proportion_asymptomatic: float = None,
infection_log_scale: float = None,
infection_mode: float = None,
presymptomatic: float = None,
Expand Down Expand Up @@ -131,13 +130,11 @@ def create_parameters(parameters_file: str = None,
)

# Some parameters are set in the default.yml file and can be overridden
if proportion_asymptomatic is None:
proportion_asymptomatic = disease_params["asymp_rate"]
pass # None here yet

p = Params(
location_hazard_multipliers=location_hazard_multipliers,
individual_hazard_multipliers=individual_hazard_multipliers,
proportion_asymptomatic=proportion_asymptomatic
)

# Remaining parameters are defined within the Params class and have to be manually overridden
Expand Down Expand Up @@ -251,17 +248,15 @@ def run_model_with_params(cls, input_params: List, return_full_details=False):
"Call the OpenCLRunner.init() function")

current_risk_beta = input_params[0]
proportion_asymptomatic = input_params[1]
infection_log_scale = input_params[2]
infection_mode = input_params[3]
presymptomatic = input_params[4]
asymptomatic = input_params[5]
symptomatic = input_params[6]
infection_log_scale = input_params[1]
infection_mode = input_params[2]
presymptomatic = input_params[3]
asymptomatic = input_params[4]
symptomatic = input_params[5]

params = OpenCLRunner.create_parameters(
parameters_file=cls.PARAMETERS_FILE,
current_risk_beta=current_risk_beta,
proportion_asymptomatic=proportion_asymptomatic,
infection_log_scale=infection_log_scale,
infection_mode=infection_mode,
presymptomatic=presymptomatic,
Expand Down
5 changes: 1 addition & 4 deletions tests/experiments/opencl_runner_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,10 @@ def test_run_model_with_params():

(fitness, sim, obs, out_params, summaries) = OpenCLRunner.run_model_with_params(np.array([
0.005, # current_risk_beta
0.123, # proportion_asymptomatic
0.75, # infection_log_scale
7.123, # infection_mode
1.0, # presymptomatic
0.75, # asymptomatic
0.75, # asymptomatic
0.5 #symptomatic
]), return_full_details=True)

Expand All @@ -78,8 +77,6 @@ def test_run_model_with_params():
assert len(sim) == len(obs) # Returned observations should be same length as the simulated number of iterations

# Check the returned parameters are correct (should be different to the default)
assert OpenCLRunner.create_parameters().proportion_asymptomatic != out_params.proportion_asymptomatic
assert out_params.proportion_asymptomatic == 0.123
assert out_params.infection_mode == 7.123

# Individual hazard multipliers should be correct (I'm not sure why I can't access them with their
Expand Down

0 comments on commit 8cc167e

Please sign in to comment.