[julia-users] Re: Python Callbacks using pyjulia

2016-10-20 Thread Frank Hellmann
Thanks a lot for your help! The workaround works and more importantly I understand what happened now. Unfortunately now I get a massive stack trace and a segmentation fault... I guess I'll take that over to the DASSL developers. On Wednesday, October 19, 2016 at 7:17:23 PM UTC+2, Steven G.

[julia-users] Re: Python Callbacks using pyjulia

2016-10-19 Thread Steven G. Johnson
A workaround from pyjulia might be to create a Julia function that can wrap a Julia Function around a Python function fwrap = j.eval('f -> (args...) -> f(args...)') and then do j.dasslSolve(fwrap(f), 1.0, [0.0, 10.0]) Not super elegant, but occasionally inter-language calling requires this

[julia-users] Re: Python Callbacks using pyjulia

2016-10-19 Thread cdm
it seems a near term work around could be had through PyCall ... ? https://github.com/JuliaPy/PyCall.jl On Wednesday, October 19, 2016 at 7:21:05 AM UTC-7, Steven G. Johnson wrote: > > It looks like this is a problem in the DASSL.jl package. They made the > common mistake of

[julia-users] Re: Python Callbacks using pyjulia

2016-10-19 Thread Steven G. Johnson
It looks like this is a problem in the DASSL.jl package. They made the common mistake of over-specifying the types of their arguments, and in particular they require you to pass a Julia ::Function argument for the equations to be solved, rather than any callable object (here, the Python

[julia-users] Re: Python Callbacks using pyjulia

2016-10-19 Thread cdm
any luck with replicating the example from the README at https://github.com/pwl/DASSL.jl

[julia-users] Re: Python Callbacks using pyjulia

2016-10-19 Thread Frank Hellmann
The python script looks like this (sorry, thought attachments would be inlined): import julia j = julia.Julia() j.using("DASSL") f = lambda t, x, dx: x - dx r = j.dasslSolve(f, 1., [0., 10.])