def METHOD_NAME(ppci, net):
    for power_mode, cost in net.pwl_cost.groupby("power_type"):
        gens, cost, signs = _map_costs_to_gen(net, cost)
        if power_mode == "q":
            gens += len(ppci["gen"])
        for gen, points, sign in zip(gens, cost.points.values, signs):
            costs = costs_from_areas(points, sign)
            ppci["gencost"][gen, COST:COST+len(costs)] = costs
            ppci["gencost"][gen, NCOST] = len(costs) / 2