Skip to content

feat(farmer_demo): seed large commercial farm with idle land for CEL demo (#1119)#323

Open
emjay0921 wants to merge 1 commit into
19.0from
fix/1119-seed-large-idle-farm
Open

feat(farmer_demo): seed large commercial farm with idle land for CEL demo (#1119)#323
emjay0921 wants to merge 1 commit into
19.0from
fix/1119-seed-large-idle-farm

Conversation

@emjay0921

Copy link
Copy Markdown
Contributor

Why is this change needed?

Docs Scenario 5 (Climate Resilience) STEP 4 contrasts the qualifying smallholder against EC1 — a large commercial farm (50 ha, idle) to show the CEL r.is_group == true and is_smallholder and farm_size_idle > 0 rejecting it on is_smallholder even though it has idle land. No demo farm had both is_smallholder = False (size above the 5 ha threshold) and farm_size_idle > 0, so this exclusion couldn't be demonstrated (OP#1119).

How was the change implemented?

  • Added blueprint bp_22_ec1_large_commercial_idle to FARMER_BLUEPRINTS: a 50 ha crop farm (count: 1) with idle_pct: 0.1 (≈5 ha fallow) and all program eligibility False (it's the deliberate rejection example). 50 ha > 5 ha threshold ⇒ is_smallholder = False, and farm_size_idle > 0.
  • The blueprint generator already supports idle_pct, so no generator changes were needed. EC1 is volume-generated, matching the docs (USE_CASES Story 9 / EC1).

New unit tests

  • test_1119_ec1_large_commercial_not_smallholder_with_idle — generates the EC1 blueprint and asserts farm_total_size > smallholder threshold, is_smallholder == False, and farm_size_idle > 0.

Unit tests executed by the author

spp_farmer_registry_demo suite: 0 failed, 0 error(s) of 133 tests (fresh DB, --stop-after-init). The ~730 farm-count range tests remain green with the +1 farm.

How to test manually

  1. Run the farmer demo data generator (with volume farms enabled).
  2. Registry → Groups, filter/sort by farm size → open the 50 ha farm (EC1): confirm not a smallholder and idle/fallow land > 0.
  3. Open Programs → Climate Resilience → Eligibility and confirm this farm is not eligible (fails is_smallholder), while a smallholder with idle land qualifies.

Related links

https://projects.acn.fr/work_packages/1119

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.77%. Comparing base (1caf794) to head (bba2970).
⚠️ Report is 3 commits behind head on 19.0.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             19.0     #323      +/-   ##
==========================================
- Coverage   74.28%   66.77%   -7.51%     
==========================================
  Files         372      100     -272     
  Lines       25385     9794   -15591     
==========================================
- Hits        18857     6540   -12317     
+ Misses       6528     3254    -3274     
Flag Coverage Δ
spp_analytics ?
spp_api_v2_cycles ?
spp_api_v2_entitlements ?
spp_api_v2_gis ?
spp_api_v2_programs ?
spp_api_v2_simulation ?
spp_audit_programs ?
spp_base_common 91.07% <ø> (+0.80%) ⬆️
spp_case_demo ?
spp_case_entitlements ?
spp_case_programs ?
spp_cr_type_assign_program ?
spp_dci_compliance ?
spp_dci_demo ?
spp_dci_server_social ?
spp_demo ?
spp_demo_phl_luzon ?
spp_drims ?
spp_drims_sl ?
spp_drims_sl_demo ?
spp_farmer_registry_demo 61.06% <ø> (+0.04%) ⬆️
spp_gis_report ?
spp_grm_demo ?
spp_indicator ?
spp_indicator_studio ?
spp_metric_service ?
spp_mis_demo_v2 ?
spp_programs 65.27% <ø> (+<0.01%) ⬆️
spp_registry 86.94% <ø> (+0.10%) ⬆️
spp_security 69.56% <ø> (+2.89%) ⬆️
spp_simulation ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...p_farmer_registry_demo/models/farmer_blueprints.py 100.00% <ø> (ø)

... and 272 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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