eduaguilera/whep

feed_intake_build: dead columns computed and joined in .build_feed_demand

Offen

#222 geöffnet am 22.07.2026

 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)R (3 Forks)auto 404
area:livestockclean codegood first issuehelp wantedmechanicalno-data-neededpriority:low

Repository-Metriken

Stars
 (1 Stern)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

What

In .build_feed_demand (R/feed_intake_build.R:204-209), demand_tot and demand_share are computed per (year, area_code, feed_type) and .feed_animal_type_lookup (graniv_grazers) is joined, but the sole consumer .build_feed_demand_codes (R/feed_intake_redistribute.R:398-401) reads only demand_aft. These are dead.

Why it matters

Harmless, but demand_share = demand_aft / (demand_tot * 1000) (with demand_tot itself pre-divided by 1000) is an error-prone expression a future reader could misuse.

Suggested fix / check

Remove the unused columns and lookup join.


From deep static audit (2026-07-22), parallel subsystem review pass. Deduplicated against then-open issues. Not verified by running unless stated.

Contributor Guide