Conditional equations with tuples

How do you translate the following GAMS condition to GAMSpy?
GAMS:
Equation Eq1 calculate active energy cost;
Eq1(pivots,days,tou)$sum(crops,map_cp(crops,pivots))..

GAMSPy ???

You can translate it as:

import gamspy as gp

m = gp.Container()
eq1 = gp.Equation(m, "eq1", domain=[pivots, days, tou])
eq1[pivots, days, tou].where[gp.Sum(crops, map_cp[crops, pivots])] = ...

See: Conditions and Assignments in the documentation.

Thanks. I see the “sum” must “Sum” for it to work.