OpenSourceEconomics / lcm

Solution and simulation of life cycle models in Python with GPU acceleration.
Apache License 2.0
16 stars 1 forks source link

Update functools.py #71

Closed timmens closed 4 months ago

timmens commented 6 months ago

In this PR, I

The more general decorator allow_kwargs is replaced with the more specific allow_only_kwargs to reduce complexity when developing (i.e., I do not have to think about any mixed-case scenarios) and to throw errors more quickly and with more informative error messages. When working with functions internally, we either want to call them with keyword-only arguments (in which case I do not need the possibility to call them without keyword arguments) or with positional arguments. In the latter case we do not gain anything by implementing an allow_only_args decorator, which is why we stick with the more general one here.