Skip to content

Commit 78c3ff5

Browse files
committed
Support MilkProduction activities with only quantity_produced - see HEA-887
Some BSSs (e.g.BF04~2011) have MilkProduction activities with a quantity_produced but no quantity_sold, and hence no income. They also have no percentage_kcals because that is initially part of the ButterProduction activities. This was causing the MilkProduction to be ignored, and therefore not available when attempting to transfer the kcals from the ButterProduction to the MilkProduction. This commit ensures that strategies that have a `quantity_produced` are kept, even if they don't have income, expenditure or kcals.
1 parent 60e0266 commit 78c3ff5

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

pipelines/assets/livelihood_activity.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,13 @@ def get_instances_from_dataframe(
771771
field in livelihood_activity
772772
and (livelihood_activity[field] or livelihood_activity[field] == 0)
773773
)
774-
for field in ["income", "expenditure", "kcals_consumed", "percentage_kcals"]
774+
for field in [
775+
"quantity_produced", # MilkProduction may have quantity_produced but not any of the others.
776+
"income",
777+
"expenditure",
778+
"kcals_consumed",
779+
"percentage_kcals",
780+
]
775781
)
776782
]
777783

0 commit comments

Comments
 (0)