Re: How to set variable number of inputs/outputs in Python OOT modules

2021-02-04 Thread George Edwards
Hello Jeff, Thanks! I kept playing with it and got it to work. Regards, George On Thu, Feb 4, 2021 at 1:54 PM Jeff Long wrote: > The examples you can search for in the code base (recommend you do this) > show syntax such as > > def __init__(self, input_rate, sps): > gr.hier_block2.

Re: How to set variable number of inputs/outputs in Python OOT modules

2021-02-04 Thread Jeff Long
This does appear to be broken for embedded python blocks. GRC assumes the list style of signature. I'll put in an issue describing this. On Thu, Feb 4, 2021 at 3:15 PM Tim Huggins wrote: > I am using 3.8.2 and was trying to quickly test it in an embedded python > block (the block was displaying

Re: How to set variable number of inputs/outputs in Python OOT modules

2021-02-04 Thread Jeff Long
The line in_sig = gr.io_signature(3,3, gr.sizeof_gr_complex) just worked for me on both 3.8 and master. Are you using an older version? On Thu, Feb 4, 2021 at 2:48 PM Tim Huggins wrote: > I do not believe that you want to encapsulate the call with [ ], even so > there may be an issue with th

Re: How to set variable number of inputs/outputs in Python OOT modules

2021-02-04 Thread Jeff Long
The examples you can search for in the code base (recommend you do this) show syntax such as def __init__(self, input_rate, sps): gr.hier_block2.__init__(self, "atsc_rx", gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature

Re: How to set variable number of inputs/outputs in Python OOT modules

2021-02-04 Thread Tim Huggins
I do not believe that you want to encapsulate the call with [ ], even so there may be an issue with that command. I am unsure what the issue is but when I make the call: in_sig = gr.io_signature(3,3, gr.sizeof_gr_complex) The error message is: Can't create an instance of your block: object of t

Re: How to set variable number of inputs/outputs in Python OOT modules

2021-02-04 Thread George Edwards
Hi Tim, Thanks for your suggestion! I just tried it and it does not work. The Python OOT def __init__(self, ) method requires that one fills in in_sig = xxx and out_sig = xxx. I tried your suggestion above for variable number of inputs and set: in_sig = [gr.io_signature(1, -1, gr.sizeof_gr_com

Re: How to set variable number of inputs/outputs in Python OOT modules

2021-02-03 Thread George Edwards
Hi Gavin, Thanks for the information! Does this mean that if I wanted 3 inputs and 5 outputs and all floating point values, then inside the Python code, I simply set in_sig = [numpy.float32] out_sign = [numpy.float32] And, in the yml file I set: inputs: - domain: stream dtype: fl

Re: How to set variable number of inputs/outputs in Python OOT modules

2021-02-03 Thread George Edwards
Hi Jeff, Thanks for your response! If you can write a short code snippet to show me how to do this I would appreciate it very much. For instance, I am making an OOT Python Interpolator block which takes a number of inputs and I would like to be able to set a parameter value to tell the block how

Re: How to set variable number of inputs/outputs in Python OOT modules

2021-02-03 Thread Gavin Jacobs
In 3.7, you would use the tag, but in 3.8 the trick to setting multiple ins/outs in the YML file, is the keyword "multiplicity". You can see the details of how to configure here: https://wiki.gnuradio.org/index.php/YAML_GRC YAML GRC - GNU Radio Star

Re: How to set variable number of inputs/outputs in Python OOT modules

2021-02-03 Thread Jeff Long
`gr.io_signature()` in Python works exactly the same as it does in C++. The legacy Python way (list of types) is still used in most places, but you have the option. On Wed, Feb 3, 2021 at 3:17 PM George Edwards wrote: > Hello, > > I wish to build an OOT module in Python which can take a variable

How to set variable number of inputs/outputs in Python OOT modules

2021-02-03 Thread George Edwards
Hello, I wish to build an OOT module in Python which can take a variable number of inputs and outputs. In C++ OOT, there are the io signatures <+min_in+>, <+max_in+>, etc. which can be set to 1 and -1 to mean the input can be any number. Python does not have these, it has the in_sig and out_sig wh