Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors trying to use logomaker #164

Closed
cossio opened this issue Apr 24, 2022 · 6 comments
Closed

Errors trying to use logomaker #164

cossio opened this issue Apr 24, 2022 · 6 comments

Comments

@cossio
Copy link

cossio commented Apr 24, 2022

I am trying to use the logomaker python package, https://logomaker.readthedocs.io/en/latest/examples.html.

I try this:

logomaker = PythonCall.pyimport("logomaker")
crp_df = logomaker.get_example_matrix("crp_energy_matrix"; print_description=false)
crp_logo = logomaker.Logo(crp_df, shade_below=.5, fade_below=.5, font_name="Arial Rounded MT Bold")
crp_logo.style_spines(visible=false)
crp_logo.style_spines(spines=["left", "bottom"], visible=true)
crp_logo.style_xticks(rotation=90, fmt="%d", anchor=0)
crp_logo

following the first example in the link above.

However this gives a series of errors.

First, the following line is printed multiple times: Intel MKL ERROR: Parameter 11 was incorrect on entry to DGEEV.. Not sure what that means.

Second, I get the following explicit error:

Python: LogomakerError: type(spines) = <class 'juliacall.VectorValue'>; must be of type (tuple, list, set) 

Stacktrace:
 [1] pythrow()
   @ PythonCall ~/.julia/packages/PythonCall/XgP8G/src/err.jl:94
 [2] errcheck
   @ ~/.julia/packages/PythonCall/XgP8G/src/err.jl:10 [inlined]
 [3] pycallargs
   @ ~/.julia/packages/PythonCall/XgP8G/src/abstract/object.jl:154 [inlined]
 [4] pycall(::PythonCall.Py; kwargs::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:spines, :visible), Tuple{Vector{String}, Bool}}})
   @ PythonCall ~/.julia/packages/PythonCall/XgP8G/src/abstract/object.jl:165
 [5] #_#11
   @ ~/.julia/packages/PythonCall/XgP8G/src/Py.jl:360 [inlined]
 [6] top-level scope
   @ In[20]:5
 [7] eval
   @ ./boot.jl:373 [inlined]
 [8] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
   @ Base ./loading.jl:1196
@cjdoris
Copy link
Collaborator

cjdoris commented Apr 24, 2022

For the second issue, it looks like you want spines=pylist(["left", "bottom"]) to explicitly pass a list.

For the first, I'm not sure. I'd guess Python's MKL is conflicting with Julia's somehow.

@cossio
Copy link
Author

cossio commented Apr 24, 2022

Thanks. Using pylist solves the second issue. However I still do not see a plot. Instead a python object is returned.

image

@cjdoris
Copy link
Collaborator

cjdoris commented Apr 25, 2022

Return crp_logo.fig to return the underlying Matplotlib figure instead.

@cossio
Copy link
Author

cossio commented Apr 25, 2022

That works, thanks.

The only remaining issue is MKL. Do you have any ideas about that?
Or it means I should not use MKL in a Julia session if I want to call PythonCall?

@cjdoris
Copy link
Collaborator

cjdoris commented Apr 25, 2022

There's a warning on the MKL readme that it needs to be the first package loaded. Maybe it's that?

Or maybe you need to make sure that Python is using the same version of MKL?

Or just don't use MKL.jl like you suggested. I'm not sure.

@cossio
Copy link
Author

cossio commented Apr 25, 2022

Ok I'll close this issue.
Thanks for your help.

@cossio cossio closed this as completed Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants