7  Method notes

7.1 The DRC trigger code

drc_trigger.py is the Python port of the DRC trigger written for the Haiti analysis (OCHA-DAP/ds-aa-hti-cholera, src/hti_cholera/trigger.py at 0bc54ba), copied unchanged apart from its docstring. It ports these functions from OCHA-DAP/pa-aa-cod-infectious-disease (private; main at a44d9a3, 30 July 2026, still the latest main on 4 November 2026):

DRC repository (R) drc_trigger.py
R/idsr/compute_yearly_thresholds.R yearly_thresholds()
R/idsr/classify_trigger_levels.R, R/idsr/classify_heatmap.R classify()
R/idsr/activation_frequency.R: extract_onsets(), constrain_same_unit() classify() (onset flag), mute_same_unit()
R/constrain_activation_triggers.R: spatiotemp_constrain_activations(), per_province mute tracking mute_spatial()

The details that matter:

  • Percentiles use R’s quantile type 3 (numpy closest_observation) over non-zero weeks only.
  • Exceedance is strict (>), for both the percentile and the rate rule.
  • In the rate rule, a previous week of 0 counts as 1.
  • An excluded year (here 2020) gets no percentile threshold and is left out of every other year’s baseline. Its weeks can still reach alert through the rate rule, as in the DRC code. (2020 has three cases, so this changes nothing here.)
  • The six-month mutes use calendar months. The same-unit mute keeps an onset only if it comes strictly after the six months; the spatial mute covers the six months inclusive.
  • Same-week onsets in the spatial constraint are taken in P-code order, as in the DRC pipeline. Taking the larger outbreak first instead gives the same L3 activations for every baseline in this book.

Checks. In the Haiti repository, the port is compared with outputs of the DRC code itself, run on Haiti’s data: every unit-week level and every onset at L1, L2, L3 and L2.5 agree, for four configurations. That check had no excluded years. The unit tests here (tests/test_drc_trigger.py, copied from Haiti’s) add the excluded-year path and BAY’s state adjacency.

7.2 Choices specific to BAY

  • Unit: the LGA (admin 2). The panel has the 55 LGAs in the 2023 population file; every case in the line-list maps to one of them. BAY has 65 LGAs; the other ten have no cases in the line-list, so they cannot reach alert and do not change any threshold (only weeks with cases enter it).
  • Weeks: Monday-start ISO weeks; the year is the ISO year. The line-list’s own epiweek column is the ISO week of onset. Six cases fall in a different ISO year from their calendar year.
  • Date: date of onset, as in the line-list’s week numbers.
  • State adjacency: from the COD-AB boundaries. Borno borders Adamawa and Yobe; Adamawa and Yobe do not touch. Each state is its own neighbour, as in DRC’s lookup.
  • One pool: no endemic / non-endemic split (Chapter 4).
  • Excluded year: 2020, a reporting gap (three cases). Evaluable years: 2018, 2019, 2021, 2022, 2023.
  • Laboratory condition: not applied; the line-list has no laboratory results.
  • Return periods: Weibull plotting position, (years + 1) / years with an activation, over the five evaluable years.

7.3 Not done

  • An endemic / non-endemic split. Nigeria’s cholera control plan may identify hotspot LGAs; if so, that list would be the BAY equivalent of the DRC’s endemic provinces.
  • Incidence. The DRC 2026 revision uses raw counts, so this book does too. BAY LGAs range from about 100,000 people (Kwaya Kusar) to 920,000 (Maiduguri) in the 2023 population file, and the earlier version of this book used a threshold per head of population.
  • Block bootstrap of the activation rate (DRC chapter 8). Five years are too few for it to add much.
  • A cross-check against the DRC code on BAY data. The R code was run on Haiti’s data, not on these.

7.4 Reproducing

# Python 3.12 environment with: ocha-stratus, pandas, numpy, matplotlib, geopandas,
# openpyxl, mapclassify, jupyter, tabulate, pytest
cd exploration/cholera_analysis
python -m pytest tests          # unit tests for drc_trigger.py
quarto render                   # reads the line-list from blob; needs DSCI_AZ_* credentials

Data read at render time: the line-list (pa-aa-nga-cholera/raw/healthsector/CHOLERA_BAY 2018_2023.xlsx), the 2023 LGA populations, the COD-AB boundaries, and the IDSR completeness and timeliness file (nga-aa-cholera/private/raw/cholera/Completeness_timeliness_2023_2024 W15.xlsx), all on the dev projects container. CERF allocations are typed into analysis_utils.py from CERF’s OneGMS feed, read on 4 November 2026.