Closed Eric-Sommer closed 2 months ago
The problem is that if it was placed in kinderzuschlag.py
, it would become part of the DAG. That's why we put it where it is.
But I think this should actually happen! It is also a good example of the value of setting kinderzuschlag_max
to null
starting in 2021.
The function could just be (untested)
def kinderzuschlag_max(hh_id, kinderzuschlag_params, kindergeld_params):
if "kinderzuschlag_max" in kinderzuschlag_params:
out_scalar = kinderzuschlag_params["kinderzuschlag_max"]
else:
params["kinderzuschlag"]["kinderzuschlag_max"] = (
params["kinderzuschlag"]["exmin"]["regelsatz"]["kinder"]
+ params["kinderzuschlag"]["exmin"]["kosten_der_unterkunft"]["kinder"]
+ params["kinderzuschlag"]["exmin"]["heizkosten"]["kinder"]
) / 12 - params["kindergeld"]["kindergeld"][1]
return pd.Series(out_scalar, index=hh_id)
(stuff under else
just taken from current function)
Shouldn't it rather be:
if "kinderzuschlag_max" not in kinderzuschlag_params:
Shouldn't it rather be:
if "kinderzuschlag_max" not in kinderzuschlag_params:
I agree. @mjbloemer is however right in pointing out that this leads to errors before 2004 when there is no [exmin
] parameter. So maybe
if "kinderzuschlag_max" not in kinderzuschlag_params and "exmin" in kinderzuschlag_params
:
My point was not about the exmin parameter, but that there is no Kinderzuschlag prior to 2005.
Shouldn't it rather be:
if "kinderzuschlag_max" not in kinderzuschlag_params:
Thanks! Almost. I fixed it above directly
My point was not about the exmin parameter, but that there is no Kinderzuschlag prior to 2005.
And you are completely right, of course. You're just too fast for me :wink:
I added that to GEP-04, we'll need to find a good way of handling such cases at the function level. The function kinderzuschlag_max
should not be part of the DAG prior to the existence of kinderzuschlag
.
See here, docs take a while to build, we probably committed too much today.
Only part missing is #789. Hence, I'll close this one as completed.
Current situation
In PR #267, we solved the new calculation for the maximum kinderzuschlag by setting the
kinderzuschlag_max
inpolicy_enviroment.py
(link). While this works fine, this is not the place one would look for it.Suggestion
by @mjbloemer :