How to get the full output from python using PyCall


I’m trying to use the iminuit package from python. However, I do not know whether it is possible to get all the output from python. Here is some simple code in python:

from iminuit import Minuit
def f(a, b):
    return a**2 + b**2

pymin = Minuit(f, a=1, b=1, pedantic=False, print_level = 1)

The output is:

The julia code:

minuit = pyimport(:iminuit)
f(a, b) = a^2 + b^2
pyfun = py"lambda fun: lambda a, b: fun(a, b)"
fmin = minuit.Minuit(pyfun(f); a=1, b=1,pedantic=false, print_level = 1)

The output is much less:

How can I get the output like in python?

Thank you!

Isn’t this all the same stuff (just badly formatted)?

Indeed all values are obtained, but the “keys” are lost.

Try pycall(fmin.migrad, PyObject) to prevent PyCall from trying to convert the output to a native Julia tuple.

Thank you!