What’s new
All notable changes to the codebase are documented in this file.
Version 0.8.1 (2026-06-10)
- Fixed a UID/position confusion bug (#425) where several interventions identified agents by running
np.where/np.flatnonzeroover a starsimArr’s compact, alive-only.valuesview and then treating the resulting positions as UIDs. Once any agents had died (so UIDs no longer matched compact positions), this silently selected the wrong agents. AffectedHouseholdContactTracing.step,TPTHousehold.check_eligibility,TxDelivery._get_eligible,Migration._members_by_household_id, andHealthSeekingBehavior.step. All now use native starsim filtering (arr.auids[mask]) so positions map back to real UIDs. - Added regression tests covering household contact tracing, treatment eligibility, care-seeking, and diagnostic administration after agent deaths.
Version 0.8.0 (2026-06-02)
- Added
migration.pywith a singleMigrationdemographics class providing bidirectional, household-aware population turnover:- Immigration (new agents enter) and emigration (existing agents leave), each driven by an annual
ss.freqrate; settingemigration_rate=0gives immigration-only behavior - Optional
maintain_populationmode that tops up arrivals each step to hold the active (non-terminal) population near its starting size - Configurable immigrant age profiles via
immigration_age_distributionbins or anage_datahistogram, plus optional age-weighted emigrant selection viaemigration_age_distribution - TB-state-aware imports: immigrants enter with a TB-state mix from
tb_state_distribution, or a default derived from the TB module’sinit_prevand progression parameters - Household integration with
ss.HouseholdNet: immigrants are assigned to existing households (size-weighted) and wired into household edges, and emigrants are removed from their households - Per-step
n_immigrants,n_emigrants, andnet_migrationresults
- Immigration (new agents enter) and emigration (existing agents leave), each driven by an annual
- Removed the separate
Immigrationclass in favor of the unifiedMigrationclass - Removed the
TBAcutemodel variant and its ACUTE state; onlyTBis supported now
Version 0.7.0 (2026-03-16)
- Added
tbsim.Sim, a convenience wrapper aroundss.Simthat auto-routes flat parameters between the sim and the TB module, provides TB-specific defaults (demographics, networks, disease), and supports atb_modelargument for selecting among TB model variants. Includes ademo()function for quick setup. - Refactored all diagnostic and treatment interventions into a product/delivery architecture:
- Added
Dxdiagnostic product class with DataFrame-based test definitions supporting state, age, and HIV stratification - Added built-in diagnostic products:
Xpert,OralSwab,FujiLAM,CAD - Added
DxDeliveryintervention for delivering diagnostics with eligibility filtering, coverage, and false-negative retry logic - Added
Txtreatment product class with drug-type-based efficacy - Added built-in treatment products:
DOTS,DOTSImproved,FirstLine,SecondLine - Added
TxDeliveryintervention for delivering treatments with success/failure tracking and retry logic - Simplified
drug_types.pyto a single dictionary of drug parameters (previously ~600 lines of class hierarchy) - Removed old monolithic
tb_diagnostic.py,tb_drug_types.py, andtb_treatment.py
- Added
- Removed
TB_EMODand renamedTB_LSHTMto TB; onlyTBandTBAcuteare supported now - Added
HouseholdStatsanalyzer for tracking household size distributions, age-mixing matrices, and contact patterns over time when usingss.HouseholdNet. Includes visualization methods for household statistics, age-mixing heatmaps, and normalized contact matrices. - Renamed
tb_health_seeking.pytohealth_seeking.pyand simplified theHealthSeekingBehaviorclass - Moved
immigration.pyto an archive folder - Added admin files (
code_of_conduct.md,contributing.md,CHANGELOG.md) - Updated
starsimdependency to v3.2.1 forHouseholdNetsupport