discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] QA code for python hierarchical block


From: Cinaed Simson
Subject: Re: [Discuss-gnuradio] QA code for python hierarchical block
Date: Mon, 19 Jun 2017 16:10:42 -0700
User-agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Thunderbird/52.2.0

On 06/19/2017 02:58 PM, Miklos Maroti wrote:
> Hi Cinaed,
> 
> Thanks for the pointer. This is what I found:
> 
> - in qa_polar_encoder_systematic.py we have
> import fec_swig as fec
> from extended_encoder import extended_encoder
> 
> - in extended_encoder.py we have
> import fec_swig as fec

I think you're looking in the source directory - you need to look at the
shell scripts in the build directory.

And by build directory, I mean the build directory for gnuradio.

The shell scripts are generated during the build - they're not present
in the source directory.

In a nut shell, the shell script contains all the swig directories in
the source direcotry in the PYTHONPATH variable.

Then the shell scripts executes the qa python scripts in the source
directory and the swig reference gets resolved.

And in the case of fec after the install, look in PYTHONPATH directory
./gnuradio/lib/python2.7/dist-packages/gnuradio/fec there's a
fec_swig.py script and a shared library _fec_swig.so.

It may not be what you're looking - I don't what they do in general.

-- Cinaed


> 
> I assume that people use the extended_encoder from their own code (or
> from GRC), so I would have just used "import fec" within the
> extended_encoder.py. It seems that I do not fully understand the
> difference between "import xxx" and "import xxx_swig", I thought that
> the later is only for debugging, but apparently it includes only the
> cpp wrappers.
> 
> So in an xxx OOT module I should always import xxx_swig (and never
> import xxx) and import python files by name if I want to use other
> hierarchical modules. Is this accurate?
> 
> Best,
> Miklos
> 
> 
> On Mon, Jun 19, 2017 at 11:40 PM, Cinaed Simson <address@hidden> wrote:
>> On 06/19/2017 01:22 PM, Miklos Maroti wrote:
>>> Hello,
>>>
>>> I have a simple question: I would like to write QA code for a
>>> hierarchical python block. That hierarchical block uses cpp blocks
>>> from the same out of tree module. The python code for the hierarchical
>>> block imports the xxx module, but that is not available in QA code
>>> yet, and in other places we import xxx_swig as xxx instead. However
>>> this is not going to work, I cannot put this into the hierarchical
>>> block code. Is there a good (standard) way to write QA code that works
>>> before the module is installed?
>>>
>>> Best,
>>> Miklos
>>
>> I think I might know what you mean - I've never done it myself - but
>> I've been confused by trying to turn the qa python scripts in the source
>> directory.
>>
>> If you still have build directory for gnuradio, take a look at the shell
>> scripts in
>>
>>   ./src/gnuradio-3.7.11/build/gr-fec/python/fec
>>
>> -- Cinaed
>>
>>>
>>> _______________________________________________
>>> Discuss-gnuradio mailing list
>>> address@hidden
>>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>>
>>
>>
>> _______________________________________________
>> Discuss-gnuradio mailing list
>> address@hidden
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]