gnuradio / pmt

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

Python Bindings for wrap #22

Closed mormj closed 2 years ago

mormj commented 2 years ago

Add some basic python bindings to create and access pmtf from python. There is probably a more elegant way to do this

Access like this:

import pmtf
x = pmtf.wrap([1,2,3])
y = x()
# y should now be a list of int

Signed-off-by: Josh Morman mormjb@gmail.com

mormj commented 2 years ago

I'd still like to do more with this 1) Make the c++ () operator return the raw datatype variant wrap_variant_t

jsallay commented 2 years ago

So I have been working on the double copy issue and arrived to a similar conclusion that we probably need to restructure how we are doing things.

I would merge this in and then let's talk sometime this week about our thoughts on the overall structure.

On Sun, Nov 14, 2021, 4:07 PM mormj @.***> wrote:

I'd still like to do more with this

  1. Make the c++ () operator return the raw datatype variant wrap_variant_t

    • this gets tricky because of the class hierarchy with wrap and base.
  2. have pmtf.string("hello") and pmtf.scalar_s32(7) form - more so for maps and vectors to be able to use the operators

  3. it might be time to address the overall class structure (abstract base vs pimpl, etc.) as (1) got very complicated with the get and can_be methods

    • is there a way to have these virtual methods on the base class?

— You are receiving this because your review was requested. Reply to this email directly, view it on GitHub https://github.com/gnuradio/pmt/pull/22#issuecomment-968363271, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHPWDXF3KVYWZR5I7UNSSOTUMAQK3ANCNFSM5H7A76JQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

mormj commented 2 years ago

Yeah at least merging this now will allow blocks to take a pmt in as a constructor argument