Giter Site home page Giter Site logo

Comments (5)

cjdoris avatar cjdoris commented on August 27, 2024

Hi thanks for the report.

I'm actually rewriting this package from scratch, so won't be fixing bugs in the current release. The new version is on branch 'rewrite'. Not documented yet but very similar API to old version.

I believe this particular bug is not present in the new version. Please try it out and let me know.

from pythoncall.jl.

PallHaraldsson avatar PallHaraldsson commented on August 27, 2024

Yes, works in 1.8, and beta2. I didn't test further, for now:

julia> @time using PythonCall # 1.6
  3.005584 seconds (2.36 M allocations: 139.871 MiB, 1.84% gc time)

julia> @time using PythonCall # 1.7
  3.966541 seconds (2.46 M allocations: 153.414 MiB, 1.56% gc time, 0.17% compilation time)

julia> @time using PythonCall # 1.8
  3.786829 seconds (2.34 M allocations: 146.184 MiB, 0.99% gc time, 0.32% compilation time)

I'm not sure why 1.6 is fastest, possibly related to allocations, while seems not the whole story.


$ ~/julia-1.8-DEV-d1145d4569/bin/julia -O1
julia> @time using PythonCall
  2.681354 seconds (2.34 M allocations: 146.187 MiB, 1.46% gc time, 0.19% compilation time)

$ ~/julia-1.8-DEV-d1145d4569/bin/julia -O0 --compile=min
julia> @time using PythonCall
  0.692783 seconds (465.87 k allocations: 35.170 MiB, 1.85% gc time)

You can close the issue on my account, or keep it open a little longer so people may see it after 1.7 release in case you've not made the rewrite official.

The last timing is comparable to PyCall.jl, with or without NumPyArrays.jl from @mkitti.

from pythoncall.jl.

cjdoris avatar cjdoris commented on August 27, 2024

Thanks, those are interesting timings. I'll look into making startup quicker once the package is more complete. It will probably always be slower than PyCall to start simply because this is a bigger package.

from pythoncall.jl.

mkitti avatar mkitti commented on August 27, 2024

After writing NumPyArrays.jl, it occurred to me that PyCall.jl might actually be too big. Why should a Py[thon]Call support NumPy arrays at all? NumPy is not the only n-dimensional array package for Python. xarray comes to mind.

My suggestion is to consider breaking up the package into smaller modular packages. Maybe PythonCall is the the package that depends on multiple smaller packages, with a core package called PythonCallCore or PythonCallBase.

An example of this is https://github.com/JuliaDiff/ChainRulesCore.jl and https://github.com/JuliaDiff/ChainRules.jl

from pythoncall.jl.

cjdoris avatar cjdoris commented on August 27, 2024

In fact PythonCall does not directly support numpy. Instead it supports the buffer protocol and the array interface, which a broad class of array types support (bytes, ndarray, pandas, xarray, ...)

from pythoncall.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.