gnuradio / pmt

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

Use numpy types for pybind vector #56

Closed mormj closed 2 years ago

mormj commented 2 years ago

Previously, a user would specify pmtf.pmt([1,2,3]) and this would internally store the pmt to whatever pmtf::vector type matched first. With this change, that still happens, but a user can specify:

pmtf.pmt(np.array[1,2,3],dtype=np.uint16) 

and internally will be stored as the correct typed pmtf::vector

Likewise, what is returned with the __call__ method

x()

is now a numpy array that matches the type of the vector of the pmt