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

Use PythonCall to wrap Python ArviZ #5

Merged
merged 51 commits into from
Aug 9, 2023
Merged

Use PythonCall to wrap Python ArviZ #5

merged 51 commits into from
Aug 9, 2023

Conversation

sethaxen
Copy link
Member

@sethaxen sethaxen commented Aug 8, 2023

PyCall uses a single Python environment for all packages that use PyCall, which is very error-prone and makes guaranteeing this package loads correctly on any given system completely impossible. PythonCall has a more sane approach, where each Julia environment has a corresponding Conda environment into which all Julia packages install their Python dependencies, where our contribution to this environment is managed by a CondaPkg.toml file.

This PR makes the following replacements in dependencies:

  • PyCall => PythonCall
  • Conda => CondaPkg
  • PyPlot => PythonPlot

The downside to PythonCall is that by default it converts (almost?) no Julia types to Python types or vice versa, so we need to do a lot more work with our interface functions to ensure a seamless user experience.

docs/lazyhelp.jl Outdated Show resolved Hide resolved
docs/lazyhelp.jl Outdated Show resolved Hide resolved
src/ArviZPythonPlots.jl Outdated Show resolved Hide resolved
src/lazyhelp.jl Outdated Show resolved Hide resolved
src/plots.jl Outdated Show resolved Hide resolved
src/plots.jl Outdated Show resolved Hide resolved
src/utils.jl Outdated Show resolved Hide resolved
src/xarray.jl Outdated Show resolved Hide resolved
src/xarray.jl Outdated Show resolved Hide resolved
@sethaxen
Copy link
Member Author

sethaxen commented Aug 8, 2023

Great, the package seems to load without any special handling in the CI. This seems much better than using PyCall and will allow more users to install the package with ease, so I'll finalize the change.

@sethaxen
Copy link
Member Author

sethaxen commented Aug 9, 2023

Reading JuliaPy/PythonCall.jl#237, it seems we may need JuliaLang/julia#46976 to avoid the libstdc++ error. This has been backported to Julia v1.8, so I've set the lower version bound there.

@sethaxen sethaxen marked this pull request as ready for review August 9, 2023 10:59
@sethaxen sethaxen merged commit 71afdf6 into main Aug 9, 2023
7 of 11 checks passed
@sethaxen sethaxen deleted the pythoncall branch August 9, 2023 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant