Forum: GNU Radio pure python block?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Matteo C. (Guest)
on 2006-03-23 22:32
(Received via mailing list)
Suppose I am willing to test some ideas, and that I do not care about
latency or speed - I just want to be able to drop some quick lines of
code to see if the idea is a good one or not... it would be nice to
write a function in python and put it in the graph to see how it
performs in the chain, using no real time sources or sinks (eg files)

is it possible? how?

Matteo
Eric B. (Guest)
on 2006-03-23 23:02
(Received via mailing list)
On Thu, Mar 23, 2006 at 09:31:01PM +0100, Matteo C. wrote:
> Suppose I am willing to test some ideas, and that I do not care about
> latency or speed - I just want to be able to drop some quick lines of
> code to see if the idea is a good one or not... it would be nice to
> write a function in python and put it in the graph to see how it
> performs in the chain, using no real time sources or sinks (eg files)
>
> is it possible? how?
>
> Matteo

This is not currently possible.

But then it's not impossible either ;)

We could either leverage the "ufunc" framework that was briefly
mentioned in the past week, or create a new C++ block derived from
gr_block, gr_sync_block, etc, that accepts a python closure as a
constructor arg.  The block's work method would then recursively
invoke the interpreter to evaluate the python code.

What kind of args do think the python code would accept?
Is it sample at a time, or would you be passing, say NumPy arrays for
the input and output?

Eric
Matteo C. (Guest)
on 2006-03-27 22:53
(Received via mailing list)
I guess that, being the array approach the one used in c++ blocks, that
would be the best to use in python as well. So I would definitely work
with input and output arrays.

ciao
Matteo
This topic is locked and can not be replied to.