gnuradio / pmt

pmt
GNU Lesser General Public License v3.0
11 stars 11 forks source link

Python Bindings #2

Open mormj opened 3 years ago

mormj commented 3 years ago

What does the PMT library look like in Python?

jsallay commented 3 years ago

I have three thoughts on the matter.

  1. Since we are just wrapping flatbuffers, we don't need to wrap the c++ code. We can just write equivalent python wrappers for flatbuffers. I realize this means that we have additional independent code. However, I don't know how well pybind11 would work with things like iterators. I'm guessing that since pmts are approximating a python dictionary anyway that the wrapper code would be pretty simple.
  2. We should definitely include numpy support (i.e. convert to/from numpy arrays and pmts).
  3. We should make sure that when we pass a pmt from python to c++ or vice versa that it doesn't alloc new memory. We should be able to just pass pointers around.