Skip to content

Add country-aware IMD year selection and test runner modes#1379

Merged
eatyourpeas merged 4 commits intolivefrom
imd_for_country_and_year
Apr 26, 2026
Merged

Add country-aware IMD year selection and test runner modes#1379
eatyourpeas merged 4 commits intolivefrom
imd_for_country_and_year

Conversation

@eatyourpeas
Copy link
Copy Markdown
Member

@eatyourpeas eatyourpeas commented Apr 26, 2026

Summary

This PR updates IMD calculation to select the dataset year by cohort and country, adds explicit s/test execution modes, and refreshes the organisation IMD map integration.

What changed

  • update IMD recalculation to use England 2025 data for cohort 8+ and keep non-England cohorts on 2019
  • add postcode and lead-centre country fallback logic for IMD year selection
  • update IMD and case model tests to tolerate country-aware IMD helper calls
  • add explicit s/test modes for in-container, local host, and isolated spin-up workflows
  • refresh testing documentation and agent notes for the new s/test behavior
  • update the organisation summary map to @rcpch/imd-map@0.2.1, refresh the SRI hash, and start centered on the lead centre

Validation

  • ./s/test epilepsy12/tests/model_tests/test_imd.py epilepsy12/tests/model_tests/test_case.py

Notes

  • a prior isolated ./s/test --spin-up epilepsy12/tests/model_tests/test_imd.py run was blocked by PostGIS startup/connection issues in the temporary compose environment; the in-container focused test run passed

closes #1371

…p workflows

- add explicit mode flags to s/test:
  - --container / --in-container (default running container mode)
  - --local / --host / --outside-container (host mode)
  - --spin-up / --up / --with-up (ephemeral test compose mode)
- add conflict checking so only one mode can be selected at a time
- add spin-up cleanup trap to always tear down temporary compose project
- update help text and examples for new mode-based usage
- update docs to describe all three test execution workflows
@eatyourpeas eatyourpeas merged commit 73cf491 into live Apr 26, 2026
1 check passed
@eatyourpeas eatyourpeas deleted the imd_for_country_and_year branch April 26, 2026 13:21
@rcpch-prout
Copy link
Copy Markdown

rcpch-prout Bot commented Apr 26, 2026

Seen on STAGING, LIVE (merged by @eatyourpeas 26 minutes and 46 seconds ago) Please check your changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cohort 8+ IMD calculations don't work for Welsh postcodes

1 participant