Skip to content

Albrja/mic 6782/update testing#66

Merged
albrja merged 16 commits intomainfrom
albrja/mic-6782/update-testing
Feb 5, 2026
Merged

Albrja/mic 6782/update testing#66
albrja merged 16 commits intomainfrom
albrja/mic-6782/update-testing

Conversation

@albrja
Copy link
Collaborator

@albrja albrja commented Feb 3, 2026

Albrja/mic 6782/update testing

Update testing model

Changes and notes

-update retesting period so simulants are retested uniformly from 3-5 years instead of every 3 years
-update initialization to reflect updates to testing history sampling

Verification and Testing

Looked at simulants in interactive simulation and saw the correct sampling for simulants test history and future test dates.

@albrja albrja changed the base branch from main to treatment-obs-investigation February 3, 2026 03:04
Base automatically changed from treatment-obs-investigation to main February 3, 2026 22:08
(pd.Timestamp("2035-01-01"), 0.2),
(pd.Timestamp("2040-01-01"), 0.4),
(pd.Timestamp("2045-01-01"), 0.6), # plateaus from here on out
(pd.Timestamp("2027-01-01"), 0.1), # step increase from 0 in 2027
Copy link
Contributor

Choose a reason for hiding this comment

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

Docs say this should be 0% in 2027, you have 10%

@@ -155,7 +156,6 @@ class TestingRates(NamedTuple):

BBBM_AGE_MIN = 60
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be 65 now as of 5 hours ago

BBBM_TESTING_START_DATE = BBBM_TESTING_RATES[0][0]
TIME_STEPS_UNTIL_NEXT_BBBM_TEST = [6.0, 7.0, 8.0, 9.0, 10.0]

# TODO: update time start of ramp with test model updates
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this todo

COLUMNS.BBBM_TEST_DATE
] == self.clock() + self.step_size() - get_timedelta_from_step_size(
self.step_size().days, BBBM_TIMESTEPS_UNTIL_RETEST
self.step_size().days, TIME_STEPS_UNTIL_NEXT_BBBM_TEST[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: would be slightly safer to get the min() in case someone adds time steps out of order later to that list

<= event_time
- get_timedelta_from_step_size(self.step_size().days, BBBM_TIMESTEPS_UNTIL_RETEST)
- get_timedelta_from_step_size(
self.step_size().days, TIME_STEPS_UNTIL_NEXT_BBBM_TEST[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be using 6 time steps or 5? Based on the docs saying:

Simulant has not received a BBBM test in the last three years (more
precisely, they have not had a BBBM test on any of the previous five
time steps)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

6 because they have to get to the 6th time step then to test. And it is <=

aged_in = (pop[COLUMNS.AGE] >= BBBM_AGE_MIN) & (
pop[COLUMNS.AGE] < BBBM_AGE_MIN + step_size_in_years
)
# Retest population will be simulants with previous test date >= 3 years ago
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Retest population will be simulants with previous test date >= 3 years ago
# Retest population will be simulants with previous test date >= 3 years ago,
# so we find newly eligible simulants whose last test is exactly 6 time steps ago

test_history_mask = bbbm_eligible_mask & (
pop[COLUMNS.TESTING_PROPENSITY] < testing_rate
)
pop[COLUMNS.BBBM_TEST_DATE] = self._generate_bbbm_testing_history(
Copy link
Contributor

Choose a reason for hiding this comment

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

don't we still need to provide the historical date? Or is it just not useful since it's in the past at that point?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We do not need history necessarily, we just need a way to sample 3-5 years instead of every 3 years so we are generating future tests since that is easier.

index=simulants[eligible_sims].index,
choices=test_date_options,
additional_key="bbbm_test_date_history",
choices=TIME_STEPS_UNTIL_NEXT_BBBM_TEST[:-1],
Copy link
Contributor

Choose a reason for hiding this comment

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

Remind me why we exclude the last one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We know that simulants will have a test at most 5 years (10 time steps) from their last test. We are going to have simulants test now, or in one of the next 9 time steps.

@albrja albrja requested a review from stevebachmeier February 4, 2026 18:17
@albrja albrja merged commit 93f803f into main Feb 5, 2026
3 checks passed
@albrja albrja deleted the albrja/mic-6782/update-testing branch February 5, 2026 00:16
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.

2 participants

Comments