Skip to content

Align june_events sentinel handling with engine's consistent-sentinel rollout#19

Open
gavdoubleu wants to merge 7 commits into
IDAS-Durham:mainfrom
gavdoubleu:update-analysis-tools-sentinels
Open

Align june_events sentinel handling with engine's consistent-sentinel rollout#19
gavdoubleu wants to merge 7 commits into
IDAS-Durham:mainfrom
gavdoubleu:update-analysis-tools-sentinels

Conversation

@gavdoubleu

Copy link
Copy Markdown
Contributor

Summary

  • Consistent sentinels for event-logging IDs, encounter types, symptoms #16 narrowed infector_symptom_id uint16_t -> uint8_t and made the engine write kNoSymptomId (255) directly for no-infector rows (seed/fomite/compartmental infections), replacing the old ambiguous 0 ("recovered"). june_events predated that fix.
  • Split decode/sentinels.py's single generic UNSET_REGISTRY_INDEX into DEFAULT_ENCOUNTER_TYPE_ID and NO_SYMPTOM_ID, mirroring kDefaultEncounterTypeId/kNoSymptomId in include/core/types.h, even though both are 255.
  • Removed load_enriched.py's manual NaN-masking workaround for infector_symptom_id; it's now handled by REGISTRY_SENTINELS/UNSET_LABEL_OVERRIDES, the same path already used for encounter_type_id.
  • Updated CONTEXT.md/PDR.md to document the two distinct 255 sentinels, and flagged that tests/fixtures/simulation_events_fixture.h5 still predates Consistent sentinels for event-logging IDs, encounter types, symptoms #16 (uint16 infector_symptom_id, 0 for no-infector) until rebuilt via build_fixture.py against a current simulation_events.h5.

Test plan

  • pytest analysis_tools/june_events/tests/ — 41 passed

gavdoubleu added 7 commits May 28, 2026 15:00
Reproducible conda environment for building and running JUNE2. Includes cxx-compiler (GCC on Linux), cmake, hdf5, yaml-cpp, openmpi, Python test deps (h5py, numpy), and optional deps metis and gperftools.
…ollout

IDAS-Durham#16 narrowed infector_symptom_id uint16_t->uint8_t & made the engine write
kNoSymptomId (255) directly for no-infector rows (seed/fomite/compartmental),
replacing the old ambiguous 0 ("recovered"). june_events predated that fix:
decode/sentinels.py only had one generic UNSET_REGISTRY_INDEX=255, and
load_enriched.py worked around the ambiguity with a manual NaN-masking pass
keyed on infector_id==-1 before registry decode.

- decode/sentinels.py, decode/__init__.py: split UNSET_REGISTRY_INDEX into
  DEFAULT_ENCOUNTER_TYPE_ID and NO_SYMPTOM_ID, mirroring kDefaultEncounterTypeId
  and kNoSymptomId in include/core/types.h even though both are 255 - the
  engine no longer treats them as one concept, so neither should this module.
- load_enriched.py: drop _mask_infector_symptom_for_no_infector; register
  infector_symptom_id's sentinel/label in REGISTRY_SENTINELS/
  UNSET_LABEL_OVERRIDES instead, same path already used for encounter_type_id.
- tests/test_load_enriched.py: update no-infector fixture row to uint8/255
  (was uint16/0) to match the engine's actual wire format post-IDAS-Durham#16.
- CONTEXT.md, PDR.md: document the two distinct 255 sentinels and flag that
  tests/fixtures/simulation_events_fixture.h5 still predates IDAS-Durham#16 (uint16
  infector_symptom_id, 0 for no-infector) until rebuilt via build_fixture.py
  against a current simulation_events.h5.
@gavdoubleu
gavdoubleu requested a review from mtcorread as a code owner July 17, 2026 18:03
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.

1 participant