pymc-devs / pymc2

THIS IS THE **OLD** PYMC PROJECT (VERSION 2). PLEASE USE PYMC INSTEAD:
http://pymc-devs.github.com/pymc/
Other
879 stars 229 forks source link

Problem with `pymc.Lambda` using 2.3.7.rc1 #172

Closed ian-r-rose closed 6 years ago

ian-r-rose commented 6 years ago

I have a model that I am creating using pymc.Lambda. Depending upon the context, it can have a variable number of parameters, so I have packed them into an argument list, so the construction of the deterministic looks something like

deterministic = pymc.Lambda('name', lambda args=args: do_stuff(*args))

This works as expected in 2.3.6, but when I was testing 2.3.7.rc1 I got the error

ValueError: name: All arguments to lam_fun must have default values.

So far as I can tell, the problem is due to this change, where arguments with the names args and kwds are special-cased.

I fixed my problem by renaming the lambda argument, but only after some digging. Is there perhaps another way to do this that doesn't rely on special argument names? If not, perhaps we can add a warning to the docstring for Lambda?

fonnesbeck commented 6 years ago

Hi Ian. If you want to go ahead and do a PR that does what you need and not regress the issue in #76 I would be happy to merge it.