Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
all comment changes here so far

Co-authored-by: Thomas Hladish <[email protected]>
  • Loading branch information
arik-shurygin and tjhladish authored Feb 23, 2024
1 parent f3f271a commit 2fa01d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def make_list_if_not(obj):


def distribution_converter(dct):
'''Converts the distribution as specified in JSON config file into a numpyro distribution object'''
# a distribution is identified by the "distribution" and "params" keys
if "distribution" in dct.keys() and "params" in dct.keys():
numpyro_dst = dct["distribution"]
Expand Down Expand Up @@ -209,10 +210,10 @@ def age_limit_checks(key, age_limits):
test_ascending(key, age_limits)
assert all(
[isinstance(a, int) for a in age_limits]
), "ages must be int, not float"
), "ages must be int, not float because census age data is specified as int"
assert (
age_limits[-1] < MAX_AGE_CENSUS_DATA
), "age limits can not exceed 84 years of age, the last age bin is implied and does not need to be included"
), "age limits can not exceed " + str(MAX_AGE_CENSUS_DATA) + " years of age, the last age bin is implied and does not need to be included"


def compare_geq(keys, vals):
Expand Down
4 changes: 2 additions & 2 deletions example_end_to_end_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
INITIALIZER_CONFIG_PATH = config_path + "config_initializer_covid.json"
# defines the running variables, strain R0s, external strain introductions etc.
RUNNER_CONFIG_PATH = config_path + "config_runner_covid.json"
# defines __distributions__ that act like priors to infer runner variables.
# defines prior __distributions__ for inferring runner variables.
INFERER_CONFIG_PATH = config_path + "config_inferer_covid.json"
# defines how the solution should be viewed, what slices examined, how to save.
INTERPRETER_CONFIG_PATH = config_path + "config_interpreter_covid.json"
Expand All @@ -47,7 +47,7 @@
ihr = [0.002, 0.004, 0.008, 0.06]
model_incidence = jnp.sum(solution.ys[3], axis=(2, 3, 4))
model_incidence = jnp.diff(model_incidence, axis=0)
rng = np.random.default_rng(seed=8675399)
rng = np.random.default_rng(seed=8675309)
m = np.asarray(model_incidence) * ihr
k = 10.0
p = k / (k + m)
Expand Down

0 comments on commit 2fa01d1

Please sign in to comment.