PolicyEngine / openfisca-tools

Python tools for enhancing OpenFisca country packages.
1 stars 1 forks source link

Function to generate sum-of-variables formula #23

Closed nikhilwoodruff closed 2 years ago

nikhilwoodruff commented 2 years ago

Would be of the format list[str] -> function[entity, period, parameters -> float]

And then invoked via:

class variable(Variable):
  ...

  formula = sum_of_variables([var1, var2])
MaxGhenis commented 2 years ago

Nice idea. Two questions:

  1. Would all variables have to be at the same entity as the variable, or could it do a mix of add and aggr behind the scenes?
  2. Could the set of variables come from a parameter?
nikhilwoodruff commented 2 years ago

I think:

  1. add will enable either entity level.
  2. Nice idea, will implement