You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PyObject can be converted to Function. This works :) I don't close the issue because maybe is a real issue...
julia> a = py_aln.align[:globalds]
PyObject <Bio.pairwise2.alignment_function instance at 0xaf48680>
julia> aa = convert(Function,a)
fn (generic function with 1 method)
julia> aa("AHHH","HHHA",py_mat.ident,-0.25,-0.5)
1-element Array{Any,1}:
("AHHH-","-HHHA",17.5,0,5)
You can also call pycall(a, PyAny, "AHHH","HHHA",py_mat.ident,-0.25,-0.5).
The problem is that PyCall is not automatically able to detect that alignment_function is a function type (and Julia doesn't allow one to overload apply (JuliaLang/julia#2403), because alignment_function is a BioPython-specific type that is not a subclass of types.FunctionType. I could check whether it is callable, but the problem is that a lot of objects are callable and I don't necessarily want to autoconvert all callable objects into opaque anonymous functions.
What is wrong here?
In Python:
In Julia:
The text was updated successfully, but these errors were encountered: