p-phung/flood hazard logic - #126
Merged
Merged
Conversation
…er, use station-mapping logic
…ruis/IBF into p-phung/flood-hazard-logic
Contributor
Author
|
jannisvisser
requested changes
May 18, 2026
jannisvisser
left a comment
Contributor
There was a problem hiding this comment.
- you need to add pipelines/flood/bronze to data/.gitignore
- I notice the test data is only for ETH, which is fine for this item and this temporary data solution.
- It does however mean that the main run command as defined in pipelines/README.md is failing (because the floods.yaml config is set to KEN). We need to align this. Let's switch the test-country from KEN to ETH throughout then? (I can do that). Or another solution? @gulfaraz what do you think?
- Additionally, we need to switch to all countries, but let's do that in AB#41454 then. I made a note on it in refinement box.
- see some last inline comments
- functional testing, no-alert seems to work normal (no data posted), but for alert (with using *100)
- when looking in the database I notice that all the population_exposed values per admin-area come out negative (below zero). Can you check? I have also made an add integrity checks task for sw-dev, as I think we should use such findings to improve on this.
- also for alert-severity I see only one 'run' record (and one 'median) per alert, instead of 50. Can you check? (also added to list of 'add integrity checks', although not completely sure if we can implement it).
Contributor
Author
|
jannisvisser
approved these changes
May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AB#41515
Describe your changes
Introducing flood hazard logic:
Main script
flood/forecast.pyEntry point for flood hazard logic via
calculate_flood_forecasts(...)Load input data (see Bronze input data below)
Build country spatial extent
Process discharge per station (for now 2 first stations for faster run)
Build alert payload
Compute exposure
Write final output to local forecast folder
forecast.pyfillsDataSubmitter.pipelines/infra/run_forecasts.pyfinalizes and writesforecast.json.pipelines/output, resulting in paths like:pipelines/output/floods/{ISO3}/{timestamp}/forecast.jsondata/pipelines/output/floods/....Supporting scripts
extract_forecast.pycompute_alert_extent.py*_empty.tif.determine_exposure.pyutils_raster.pyBronze input data
Data: link(~800MB). Extract and place in folder
flood.bronze/holds preprocessed flood inputs used byforecast.py:bronze/glofas/dis_00_YYYYMMDDHH.ncand creates_sliced.ncfiles.bronze/thresholds/*_{ISO3}.json).bronze/station-district/{ISO3}_station_district_mapping.json).bronze/population/{ISO3}.tif).bronze/flood_extents/flood_map_{ISO3}_rp*.tif) plus empty fallback.Notes
TODOcomments), especially around reading flood inputs directly from localbronze/instead of fully throughDataProvider, and station-basin-adminarea mapping (#Add match_station_basin function to identify unique basins for GloFAS stations #99)*100is added in extracting GloFAS data, seeextract_discharge_glofas_station()inflood/extract_forecast.py. This is to mock alert scenario. This will be removed when a scenario testing schema is in place.tests/are generated by Claude.Checklist before requesting a code review