Skip to content

Add cohort_geometries() to access cohort GeoJSON metadata - #1053

Merged
jonbrenas merged 7 commits into
malariagen:masterfrom
adilraza99:GH435-cohort-geometries
Mar 15, 2026
Merged

Add cohort_geometries() to access cohort GeoJSON metadata#1053
jonbrenas merged 7 commits into
malariagen:masterfrom
adilraza99:GH435-cohort-geometries

Conversation

@adilraza99

@adilraza99 adilraza99 commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a new cohort_geometries() method to expose cohort boundary geometries through the API.

Changes

  • add cohort_geometries() to AnophelesSampleMetadata
  • load GeoJSON cohort boundary data using the standard json library
  • add caching consistent with existing metadata access patterns
  • validate accepted cohort_set values
  • add tests and minimal GeoJSON fixtures

Impact

Provides access to cohort geometry metadata while keeping the API simple and dependency-free.

Part of #435

@codecov

codecov Bot commented Mar 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.27%. Comparing base (ab59c87) to head (0606d4b).
⚠️ Report is 43 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1053      +/-   ##
==========================================
+ Coverage   90.25%   90.27%   +0.02%     
==========================================
  Files          51       51              
  Lines        5631     5678      +47     
==========================================
+ Hits         5082     5126      +44     
- Misses        549      552       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@adilraza99
adilraza99 force-pushed the GH435-cohort-geometries branch from 6989ac6 to 0606d4b Compare March 7, 2026 23:50
@adilraza99

Copy link
Copy Markdown
Contributor Author

Hi @jonbrenas, CI checks are passing now.
Could you please take a look when you have a moment?

@jonbrenas

Copy link
Copy Markdown
Collaborator

Hi @adilraza99, could you create a notebook with an example of how to use this new function?

@adilraza99

Copy link
Copy Markdown
Contributor Author

Thanks for taking a look! Sure, I can add a small example notebook showing how to use the cohort_geometries() function. I'll add it shortly.

@adilraza99

Copy link
Copy Markdown
Contributor Author

@jonbrenas
Thanks! I've added an example notebook demonstrating how to use the cohort_geometries() API, and verified that it runs correctly.

Also noting that the work for this issue is split across two PRs - this one and the earlier PR that addressed the first part of #435.

@adilraza99
adilraza99 force-pushed the GH435-cohort-geometries branch from 5cdd0e7 to 25efaa0 Compare March 15, 2026 02:01
@jonbrenas
jonbrenas merged commit fe4f512 into malariagen:master Mar 15, 2026
8 checks passed
adilraza99 added a commit to adilraza99/malariagen-data-python that referenced this pull request Mar 15, 2026
adilraza99 added a commit to adilraza99/malariagen-data-python that referenced this pull request Mar 15, 2026
- improve validation and handling of cohort metadata
- ensure consistent behaviour when cohort data is missing
- maintain compatibility with cohort_geometries changes introduced in malariagen#1053
- add tests covering edge cases and error handling
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.

2 participants