Skip to content

Commit

Permalink
Merge pull request #59 from OCHA-DAP/HAPI-134-more-food-security-coun…
Browse files Browse the repository at this point in the history
…tries

HAPI-134 add two more food security countries
  • Loading branch information
turnerm authored Oct 27, 2023
2 parents 76c0d12 + 334c24f commit ad2ba8f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased
## [0.6.0] - 2023-10-26

### Added

- Minor unit tests
- Food security and related tables for Mali
- Food security and related tables for Burkina Faso, Chad, and Mali

## [0.5.5] - 2023-10-19

Expand Down
3 changes: 3 additions & 0 deletions src/hapi/pipelines/app/pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ def _create_configurable_scrapers(
_create_configurable_scrapers(
"operational_presence", "admintwo", adminlevel=self.admintwo
)
_create_configurable_scrapers(
"food_security", "adminone", adminlevel=self.adminone
)
_create_configurable_scrapers(
"food_security", "admintwo", adminlevel=self.admintwo
)
Expand Down
2 changes: 2 additions & 0 deletions src/hapi/pipelines/configs/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ commit_limit: 1000

HAPI_countries:
- AFG
- BFA
- MLI
- NGA
- TCD

country_name_overrides:
BOL: "Bolivia"
Expand Down
16 changes: 14 additions & 2 deletions src/hapi/pipelines/configs/food_security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,19 @@ food_security_default:
- "#affected+ch+food+p5+num"
- "#affected+ch+food+p3plus+num"

food_security_adminone:
food_security_ch:
dataset: "cadre-harmonise"
format: "xlsx"
admin:
- ~
- "adm1_pcod2"
admin_exact: True
prefilter: "adm0_pcod3 in ['TCD'] and adm2_pcod2 is None"
filter_cols:
- "adm0_pcod3"
- "adm2_pcod2"

food_security_admintwo:
food_security_ch:
dataset: "cadre-harmonise"
Expand All @@ -110,7 +123,6 @@ food_security_admintwo:
- ~
- "adm2_pcod2"
admin_exact: True
# TODO: Figure out why this has to be in here
prefilter: "adm0_pcod3 in ['MLI']"
prefilter: "adm0_pcod3 in ['BFA', 'MLI', 'TCD']"
filter_cols:
- "adm0_pcod3"
8 changes: 4 additions & 4 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ def test_pipelines(self, configuration, folder):
pipelines.output()

count = session.scalar(select(func.count(DBLocation.id)))
assert count == 3
assert count == 5
count = session.scalar(select(func.count(DBAdmin1.id)))
assert count == 84
assert count == 122
count = session.scalar(select(func.count(DBAdmin2.id)))
assert count == 1312
assert count == 1465
count = session.scalar(select(func.count(DBDataset.id)))
assert count == 7
count = session.scalar(select(func.count(DBResource.id)))
Expand Down Expand Up @@ -126,4 +126,4 @@ def test_pipelines(self, configuration, folder):
count = session.scalar(
select(func.count(DBFoodSecurity.id))
)
assert count == 13678
assert count == 43463

0 comments on commit ad2ba8f

Please sign in to comment.