not a Python function
- Lenguaje dominante
- Julia
- Estrellas
- 1.5k
- Forks
- 186
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
sorry if i'm being dumb about this, but functions with multiple input arguments don't seem to be recognized as functions:
```
julia> using PyCall
julia> @pyimport scipy.optimize as so
julia> so.curve_fit((x,m,b)->m*x+b, 1:10, 2:2:20)
ERROR: PyError (:PyObject_Call)
TypeError(' is not a Python function',)
File "/home/arthurb/.julia/v0.4/Conda/deps/usr/lib/python2.7/site-packages/scipy/optimize/minpack.py", line 604, in curve_fit
args, varargs, varkw, defaults = _getargspec(f)
File "/home/arthurb/.julia/v0.4/Conda/deps/usr/lib/python2.7/site-packages/scipy/_lib/_util.py", line 289, in getargspec_no_self
argspec = inspect.getargspec(func)
File "/home/arthurb/.julia/v0.4/Conda/deps/usr/lib/python2.7/inspect.py", line 816, in getargspec
raise TypeError('{!r} is not a Python function'.format(func))
[inlined code] from /home/arthurb/.julia/v0.4/PyCall/src/exception.jl:81
in pycall at /home/arthurb/.julia/v0.4/PyCall/src/PyCall.jl:356
in call at /home/arthurb/.julia/v0.4/PyCall/src/PyCall.jl:372
julia> so.newton(x -> cos(x) - x, 1)
0.7390851332151607
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Reproduce the scipy.optimize.curve_fit example and compare it with the working newton call. Start in PyCall/src/PyCall.jl around pycall and call, using the traceback locations as context. Done means Julia anonymous functions with multiple arguments work with Python code that inspects its callable signature, with regression coverage for this example.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- julia, python
- Área
- backend
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100