pycall.rb
pycall.rb copied to clipboard
Calling Python functions from the Ruby language
In ruby: ``` >> PyCall.import_module('scipy.stats').norm.pdf([1, 2, 3], 0, 10) PyCall::PyError: : pdf() takes 2 positional arguments but 4 were given from /Users/mrkn/src/github.com/mrkn/pycall.rb/lib/pycall/pyobject_wrapper.rb:43:in `pdf' ``` In python: ``` >>> import scipy.stats...
When I compile a simple code on Windows get this error : ``` C:/COSMOS/Vendor/Ruby/lib/ruby/gems/2.4.0/gems/pycall-1.2.1/lib/pycall/libpython/finder.rb:34:in `rescue in find_python_config': PyCall::PythonNotFound (PyCall::PythonNotFound) from C:/COSMOS/Vendor/Ruby/lib/ruby/gems/2.4.0/gems/pycall-1.2.1/lib/pycall/libpython/finder.rb:27:in `find_python_config' from C:/COSMOS/Vendor/Ruby/lib/ruby/gems/2.4.0/gems/pycall-1.2.1/lib/pycall/libpython/finder.rb:41:in `find_libpython' from C:/COSMOS/Vendor/Ruby/lib/ruby/gems/2.4.0/gems/pycall-1.2.1/lib/pycall/init.rb:35:in `init' from C:/COSMOS/Vendor/Ruby/lib/ruby/gems/2.4.0/gems/pycall-1.2.1/lib/pycall/init.rb:16:in...
``` # Enviroment uname -a Linux ip-10-1-25-22 4.4.0-1037-aws #46-Ubuntu SMP Wed Sep 27 19:05:49 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux lsb_release -a No LSB modules are available. Distributor ID: Ubuntu...
In Python, classes and modules can be deleted by `importlib.reload` and `del`. Using `WeakRef` we can detect such deletion and remove the entry of the deleted classes and modules from...
Here https://github.com/mrkn/pycall.rb/blob/master/lib/pycall/wrapper_object_cache.rb#L30
When i try to import numpy: require 'pycall/import' include PyCall::Import pyimport 'numpy', as: :np this give me this error: DEBUG(find_libpython) find_libpython("C:\\APPL\\Python37\\python.exe") DEBUG(find_libpython) investigate_python_config("C:\\APPL\\Python37\\python.exe") DEBUG(find_libpython) libs: ["python37", "python"] DEBUG(find_libpython) libpaths: ["C:\\APPL\\Python37",...
Is it possible to somehow ensure that Python object was removed from memory? I am trying to use PyCall to use GDAL with Ruby. The only way to ensure that...
In pycall 1.0.3, PyCall::List doesn't respond to `empty?` method. ``` undefined method `empty?' for # ```
Now pycall.rb converts Ruby's Array and Hash to Python's list and dict, respectively. For reducing conversion costs, we need to introduce wrappers of Array and Hash in Python-side. These wrapper...
We need to define new Ruby-level methods to both superclass and subclass for Python classes that they are superclass and subclass relation. Here is an example. `A` is a superclass....