Questions tagged [pybinding]

18 questions
6
votes
2 answers

Creating a NumPy array directly from __array_interface__

Suppose I have an __array_interface__ dictionary and I would like to create a numpy view of this data from the dictionary itself. For example: buff = {'shape': (3, 3), 'data': (140546686381536, False), 'typestr': '
Daniel
  • 19,179
  • 7
  • 60
  • 74
6
votes
1 answer

Pybind11 Type Error

I've recently been trying to write a function in C++ that converts a vector of doubles into a vector of strings. I want to run this from a python interpreter so I'm using Pybind11 to interface C++ and Python. This is what I have so far, #include…
3
votes
0 answers

pybind11 with C++ that needs linking with static library

I apologize in advance if this is obvious. We are investigating using pybind to bind Python to our C++ code. Everything seems to work fine until we have discovered a problem. Our software builds and links with various static libraries (mostly…
Pete P
  • 1,048
  • 7
  • 12
3
votes
1 answer

Pybind11: passing a string* argument to a constructor

In a C++ library that I'm not allowed to change I have a constructor that looks like this: Dfa(const int n_state, const int dim_alf, const string *alf); If I simply bind with .def(py::init()) it compiles…
user4351223
3
votes
4 answers

pybinding cannot import name allow_rasterization

I just install pybinding and I'm trying to run the first example that is proposed in the documentation of this library. import pybinding as pb import numpy as np import matplotlib.pyplot as plt import pybinding as pb d = 0.2 # [nm] unit cell…
Oscar Muñoz
  • 439
  • 1
  • 5
  • 18
2
votes
1 answer

Error: Incompatible function arguments

I'm using pybind11 to access some functions which I wrote in C++ from python. I wish to return an initialized struct instance to python(from a class member function) so that I can access the instance values in python. I have provided a simplified…
Surabhi Verma
  • 108
  • 1
  • 2
  • 11
1
vote
0 answers

Explicit deletion of copy constructor and assignment in Pybind11

If you have a class with explicit deletion of the copy constructor and assignment operation as in the following example Foo(const Foo& other) = delete; Foo& operator=(const Foo& other) = delete; how can you specify it in the…
1
vote
0 answers

Compilation for pybind11 project with more .cpp

I have make 4.2.1 and the following make file which is supposed to run the step for compiling PyRubix.cpp in which there are all the pybind11 functions I…
1
vote
0 answers

pybind11 incompatible function arguments. The following argument types are supported: 1. (arg0: _GstPadProbeInfo) -> capsule

I want to call a C++ function from Python using pybind11. The C++ function is declared as: void *getimage(GstPadProbeInfo *info) In Python, I am calling getimage with: image = example.getimage(info) where the Python type of info is…
Charmed
  • 33
  • 5
1
vote
1 answer

undefined symbol using pybind11 cmd

i want to use pybind11 to create .so , my code contains this header `#include #include #include #include #include #include #include #include…
Charmed
  • 33
  • 5
1
vote
1 answer

Wrapping variadic templates in pybind11

I'm writing python bindings for glog like library which uses macro and has cout like syntax for logging. LOG(LEVEL)<<" "<<" ".... So I'm using this function to call the macro template void log(auto level,…
1
vote
1 answer

Assign value to a class member variable in python from c++ with boost python

I have a C++ class that is exposed to python with boost python framework. struct Var { Var(std::string name) : name(name), value() {} std::string const name; float value; }; BOOST_PYTHON_MODULE(hello) { …
sbunny
  • 433
  • 6
  • 25
1
vote
2 answers

WPF Binding Alternatives / Enhancements

I love WPF bindings, but I often find myself wish I could do a little more. PyBindings seem like a good start, but the Python syntax seems very clunky and out of place in a XAML file. Are there any alternatives out there? Something with a simpler…
Armentage
  • 12,065
  • 8
  • 33
  • 33
1
vote
1 answer

Error extending and embedding Python 3.5 with pybind11

I'm starting to play with the library pybind11. It's really good library, well documented and it works for me but only with Python 2.7. I'm not able to get it working for Python 3.5 and I don't know what I'm doing wrong. This is my "hello world"…
Alex Moreno
  • 151
  • 1
  • 8
1
vote
2 answers

Error while compiling MonoDevelop 5.7

I'm trying to compile "MonoDevelop 5.7" with "PyBinding" but sends me an error. I downloaded the code of Mono and MonoDevelop from GitHub and compile the Mono code did not give me any problems. ./Configure…
R4v3nPr0
  • 121
  • 8
1
2