Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vax dedup #26

Merged
merged 15 commits into from
Nov 22, 2023
Merged

Vax dedup #26

merged 15 commits into from
Nov 22, 2023

Conversation

jonathanhhb
Copy link
Collaborator

@jonathanhhb jonathanhhb commented Nov 10, 2023

This PR adds support for vaccine de-duplication which enables boosting. It requires a new version of the model: emod_typhoid==0.0.4.dev7

https://github.com/InstituteforDiseaseModeling/emodpy-typhoid/pull/26/files#diff-512107aeda10e42e2086b731f9e875a96c5b1e5d265acfa1163ef625fdef459fR5

Jonathan Bloedow and others added 7 commits November 3, 2023 17:33
* add sft tests

* Add broadcast co_event and doc for intervention

* Add path to manifest.py so we can run test at any dir

* Added README.md for tests

* Add unittests coverage test

* Add coverage_check.py

* Change coverage test file name to get_unittest_coverage.py
Adding new examples for Pakistan provinces and various coverage regimes.
Copy link

Copy link

Copy link

elif deduplication_policy == "combine":
intervention.Enable_Intervention_Replacement = 0
else:
raise ValueError( f"duplication_policy needs to be 'replace' or 'combine', not '{duplication_policy}'." )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{duplication_policy} should be {deduplication_policy}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@@ -150,7 +150,10 @@ def add_vax_intervention(campaign, values, min_age=0.75, max_age=15, binary_immu
import emodpy_typhoid.interventions.typhoid_vaccine as tv
print(f"Telling emod-api to use {manifest.schema_file} as schema.")
campaign.set_schema(manifest.schema_file)
camp_coverage = values['coverage']
if 'coverage' in values:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not working for run('Coverage_RIA') case.
I changed to following to replace line 153 to line 156 which seems working for all cases

for key in values.keys():
        if 'coverage' in key:
            camp_coverage = values[key]
            break

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Thanks.

@@ -25,7 +25,7 @@ def new_intervention( camp, efficacy=0.82, mode="Shedding", constant_period=0, d
constant_period (float, optional): The constant period of the waning effect in days. Default is 0.
decay_constant (float, optional): The decay time constant for the waning effect. Default is 6935.0.
expected_expiration (float, optional): The mean duration before efficacy becomes 0. If this is set to non-zero value, the constant_period and decay_constant are ignored. These are two different modes of waning.

deduplication_policy (string, optional): Defaults to 'replace'. Can also be 'combine'.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 28 for docstring should not be here. Should be moved to def new_vax function's doc string

@shchen-idmod
Copy link
Collaborator

@jonathanhhb
Copy link
Collaborator Author

Thanks for the review @shchen-idmod. Making those changes now.

That's very surprising about the population difference just from the builds! And a great catch. I'll look into that.

@@ -73,7 +73,7 @@ def new_vax( camp, efficacy=0.82, mode="Acquisition", constant_period=0, decay_c
elif deduplication_policy == "combine":
intervention.Enable_Intervention_Replacement = 0
else:
raise ValueError( f"duplication_policy needs to be 'replace' or 'combine', not '{duplication_policy}'." )
raise ValueError( f"deduplication_policy needs to be 'replace' or 'combine', not '{duplication_policy}'." )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need to change the last word in this line

if 'coverage' in key:
camp_coverage = values[key]
break
else:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to else

Copy link

Copy link

@jonathanhhb jonathanhhb merged commit eac16bf into main Nov 22, 2023
2 checks passed
@jonathanhhb jonathanhhb deleted the vax_dedup branch November 22, 2023 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants