Monday, September 25, 2023

Re: self.set_history error for python custom block

Python incompatibility can safely be ruled out; you wouldn't get far enough. Please share
a minimal example of a block that triggers the behaviour.

Best,
Marcus

On 25.09.23 15:49, Ivan Iudice wrote:
> Nobody knows where could be the problem?
> I thought an incompatibility between gnuradio and python versions.
> Regards.
>
> Ivan
>
>> Il giorno 21 set 2023, alle ore 18:13, Ivan Iudice <krono86@tiscali.it> ha scritto:
>>
>> Dear Jeff,
>> thank you for answer.
>> My code does exactly the same things.
>> Regards.
>>
>> Ivan
>>
>>> Il giorno 21 set 2023, alle ore 17:55, Jeff Long <willcode4@gmail.com> ha scritto:
>>>
>>> 
>>> Here is an example (from the QA code) of using history from a Python block.
>>>
>>> https://github.com/gnuradio/gnuradio/blob/5953d3c96b42086c5f8c5f97b6fd7e57717f9aa5/gr-blocks/python/blocks/qa_block_gateway.py#L60 <https://github.com/gnuradio/gnuradio/blob/5953d3c96b42086c5f8c5f97b6fd7e57717f9aa5/gr-blocks/python/blocks/qa_block_gateway.py#L60>
>>>
>>> See if your code appears to be doing the same thing.
>>>
>>> On Thu, Sep 21, 2023 at 11:03 AM <krono86@tiscali.it <mailto:krono86@tiscali.it>> wrote:
>>>
>>> __
>>> Hello List!
>>> I'm trying to implement a sync block into a OOT module that use previous samples of
>>> the input streams.
>>> So, I'm using the method set_history in the constructor.
>>> The problem is that when I use self.set_history(N) I obtain the following errors:
>>>
>>> Generating: '/home/userr/workspace/gnuradio-oot/gr-customModule/examples/untitled.py'
>>>
>>> Executing: /usr/bin/python3 -u
>>> /home/user/workspace/gnuradio-oot/gr-customModule/examples/untitled.py
>>>
>>> QSocketNotifier: Can only be used with threads started with QThread
>>> Traceback (most recent call last):
>>>   File "/home/user/workspace/gnuradio-oot/gr-customModule/examples/untitled.py",
>>> line 291, in <module>
>>>     main()
>>>   File "/home/user/workspace/gnuradio-oot/gr-customModule/examples/untitled.py",
>>> line 269, in main
>>>     tb = top_block_cls()
>>>          ^^^^^^^^^^^^^^^
>>>   File "/home/user/workspace/gnuradio-oot/gr-customModule/examples/untitled.py",
>>> line 179, in __init__
>>>     self.customModule_testBlock_0_0 = customModule.testBlock(1, max_lag, lags,
>>> alpha, win_len, 1, False)
>>>
>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>   File
>>> "/usr/local/lib/python3.11/dist-packages/gnuradio/customModule/testBlock.py", line
>>> 33, in __init__
>>>     self.set_history(self.max_pos_lag-self.min_neg_lag+1)
>>>     ^^^^^^^^^^^^^^^^
>>>   File "/usr/lib/python3/dist-packages/gnuradio/gr/gateway.py", line 129, in
>>> __getattr__
>>>     if not hasattr(self, "gateway"):
>>>            ^^^^^^^^^^^^^^^^^^^^^^^^
>>>   File "/usr/lib/python3/dist-packages/gnuradio/gr/gateway.py", line 129, in
>>> __getattr__
>>>     if not hasattr(self, "gateway"):
>>>            ^^^^^^^^^^^^^^^^^^^^^^^^
>>>   File "/usr/lib/python3/dist-packages/gnuradio/gr/gateway.py", line 129, in
>>> __getattr__
>>>     if not hasattr(self, "gateway"):
>>>            ^^^^^^^^^^^^^^^^^^^^^^^^
>>>   [Previous line repeated 984 more times]
>>> RecursionError: maximum recursion depth exceeded
>>>
>>> >>> Done (return code 1)
>>>
>>> I'm using GNU Radio 3.10.5.1 (Python 3.11.2) on Debian 12.
>>> What is going on?
>>> Thanks in advance!
>>> Ivan
>>>

No comments:

Post a Comment