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

Roadmap for PyCall 2.0 #629

Open
4 of 5 tasks
stevengj opened this issue Jan 23, 2019 · 12 comments
Open
4 of 5 tasks

Roadmap for PyCall 2.0 #629

stevengj opened this issue Jan 23, 2019 · 12 comments

Comments

@stevengj
Copy link
Member

stevengj commented Jan 23, 2019

Now that #517 is merged, there are a few things remaining to do before we try to move all PyCall users to the new interface.

First, we need to deprecate some more things (probably in a "1.9" release or similar) to help with the transition:

Some other things I would like to change/fix during the big transition:

@marius311
Copy link
Contributor

marius311 commented Jan 24, 2019

Are we slated to lose @pyimport numpy as np type syntax? If so, I'd cast my vote against that, I find it quite logical to be able to mirror exactly the Python importing syntax, and I'd bet it makes things for anyone coming from Python simpler too.

@tkf
Copy link
Member

tkf commented Jan 24, 2019

I think #599 is the ultimate way to make PyCall Pythonista-friendly. If you know Python syntax, just eval/exec it. If py"..." has a proper namespacing, it's PEP 20-compliant so no Pythonista would complain :)

@marius311
Copy link
Contributor

Interesting, so eventually it would just be py"import numpy as np" and then you have access to np from Julia? That's pretty cool, I see no problem with that solution from a user perspective (all I'd ask is that @pyimport stays around until that's implemented).

@stevengj
Copy link
Member Author

stevengj commented Jan 24, 2019

Yes, @pyimport numpy as np is deprecated and will disappear. You now do np = pyimport("numpy").

And py"import numpy as np" seems unlikely to ever define a variable np in Julia. @tkf is just talking about enhancing the usage of Python snippets via py"..." so that it is better namespaced. I don't think it's feasible to have py"..." blocks use the same namespace as surrounding Julia code, however. It seems like there's no way to do that in a local scope, for example, and you wouldn't want py"..." code that executes in a local scope to suddenly start defining a bunch of global Julia variables with eval.

The goal of PyCall is not to allow you to use Python syntax in Julia (except in py"..." blocks).

@tkf
Copy link
Member

tkf commented Feb 5, 2019

Also:

@stevengj
Copy link
Member Author

stevengj commented Feb 8, 2019

What I'd like to do now is to test some of the main PyCall-using packages like SymPy and PyPlot on PyCall master — we should make sure they should continue to work, albeit with lots of deprecation messages, before making a release with getproperty. Help with this would be appreciated.

@tkf
Copy link
Member

tkf commented Feb 9, 2019

By testing, you mean reverse-dependency tests like this JuliaPy/PyPlot.jl#425, JuliaPy/SymPy.jl#251, and JuliaPy/Pandas.jl#47 (note: all of them worked)? Or just trying PyCall master in daily use?

@stevengj
Copy link
Member Author

stevengj commented Feb 9, 2019

Reverse-dependency tests are fine. PyPlot's test suite isn't very good, though, so it requires some manual playing around. In particular, would be good to fix #636

@tkf
Copy link
Member

tkf commented Feb 15, 2019

Now that #636 is fixed, are there other blockers for v1.19?

@stevengj
Copy link
Member Author

No, I think we are ready for a new 1.x release.

@ararslan
Copy link
Member

ararslan commented Jul 6, 2020

The getindex(::PyObject, ::AbstractString) deprecation introduced two years ago means that accessing values in Python dicts requires d.__getitem__(k) instead of d[k]. I'm assuming that the removal of that deprecation would permit using d[k] directly, which would be nice. Is there an expected timeline now for PyCall 2.0? Seems all but one of Steven's items in the issue body have been implemented.

@tkf
Copy link
Member

tkf commented Sep 2, 2020

Another thing we can do is to change the default build to use libpython shipped via the artifact system, even in Linux. This might improve the experience of end-users who happen to use Python libraries as transitive dependencies.

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

4 participants