AttributeError: module ‘math’ has no attribute ‘exponent_ff’

2020-07-08 Thread Alex Batts
Hello,

I tried to create my own OOT module, one that can do exponents on floats.
However, I keep running into this error:

self.math_exponent_ff_0 = math.exponent_ff()
AttributeError: module ‘math’ has no attribute ‘exponent_ff’

I saw an earlier post on the forums that had a couple fixes, but I tried
those and it did not work. Any help would be appreciated. If need be, I can
post files as well to see code.

Thank you,

Alex


Re: AttributeError: module ‘math’ has no attribute ‘exponent_ff’

2020-07-08 Thread Marcus Müller

Hi Alex,

um, where's that line from? There's no "exponent_ff" in Python's 
"built-in" math module, so this is not surprising.


Best regards,
Marcus

On 08/07/2020 18.57, Alex Batts wrote:

Hello,

I tried to create my own OOT module, one that can do exponents on 
floats. However, I keep running into this error:


self.math_exponent_ff_0 = math.exponent_ff()
AttributeError: module ‘math’ has no attribute ‘exponent_ff’

I saw an earlier post on the forums that had a couple fixes, but I tried 
those and it did not work. Any help would be appreciated. If need be, I 
can post files as well to see code.


Thank you,

Alex




smime.p7s
Description: S/MIME Cryptographic Signature


Re: AttributeError: module ‘math’ has no attribute ‘exponent_ff’

2020-07-08 Thread Alex Batts
I created my own “Math” module. This is to distinguish from the built in
“Math Operators” module.

On Wed, Jul 8, 2020 at 12:59 PM Marcus Müller  wrote:

> Hi Alex,
>
> um, where's that line from? There's no "exponent_ff" in Python's
> "built-in" math module, so this is not surprising.
>
> Best regards,
> Marcus
>
> On 08/07/2020 18.57, Alex Batts wrote:
> > Hello,
> >
> > I tried to create my own OOT module, one that can do exponents on
> > floats. However, I keep running into this error:
> >
> > self.math_exponent_ff_0 = math.exponent_ff()
> > AttributeError: module ‘math’ has no attribute ‘exponent_ff’
> >
> > I saw an earlier post on the forums that had a couple fixes, but I tried
> > those and it did not work. Any help would be appreciated. If need be, I
> > can post files as well to see code.
> >
> > Thank you,
> >
> > Alex
>
>


Re: AttributeError: module ‘math’ has no attribute ‘exponent_ff’

2020-07-08 Thread Marcus Müller
That's cool, but I'd strongly recommend not calling your module "math", 
because that name clashes with the existing Python "math" module.
I think that might be happening: something you import imports math, and 
thus the native module, which overrides yours.


Best regards,
Marcus

On 08/07/2020 19.05, Alex Batts wrote:
I created my own “Math” module. This is to distinguish from the built in 
“Math Operators” module.


On Wed, Jul 8, 2020 at 12:59 PM Marcus Müller > wrote:


Hi Alex,

um, where's that line from? There's no "exponent_ff" in Python's
"built-in" math module, so this is not surprising.

Best regards,
Marcus

On 08/07/2020 18.57, Alex Batts wrote:
 > Hello,
 >
 > I tried to create my own OOT module, one that can do exponents on
 > floats. However, I keep running into this error:
 >
 > self.math_exponent_ff_0 = math.exponent_ff()
 > AttributeError: module ‘math’ has no attribute ‘exponent_ff’
 >
 > I saw an earlier post on the forums that had a couple fixes, but
I tried
 > those and it did not work. Any help would be appreciated. If need
be, I
 > can post files as well to see code.
 >
 > Thank you,
 >
 > Alex





smime.p7s
Description: S/MIME Cryptographic Signature


Re: volk and alignment

2020-07-08 Thread Marcus Müller

Hi Thomas,

hadn't taken the time to respond yet, sorry about that!

> Is there a maximum size that volk_get_alignment could return, a size
> that's reasonable?

I'd go with "realistically, yes, but isn't relying on that a bad idea?".

I'm thinking back and forth about how to address that problem.
Basically, what we'd need is a "worst case of all available machines" 
alignment, that is present in an integer constant expression, so you can 
put it into alignas(), right?


Best regards,
Marcus

On 06/07/2020 11.28, Thomas Habets wrote:
While doing https://github.com/gnuradio/gnuradio/pull/3619 it 
occurred to me that some dynamic volk_malloc (volk::vector<>) should be 
doable as stack allocations. There's nothing magic about the 
allocations, they're just aligned.


Is there a maximum size that volk_get_alignment could return, a size 
that's reasonable?


The reason I ask is that if it's "yes: 64", then calling code would be 
cleaner when all it needs is a temporary but aligned space.


E.g.
https://github.com/gnuradio/gnuradio/blob/master/gr-filter/lib/fir_filter.cc#L103
could skip the d_output member, and instead just have local variable 
`alignas(64) float tmp;`.




--
typedef struct me_s {
  char name[]      = { "Thomas Habets" };
  char email[]     = { "tho...@habets.se " };
  char kernel[]    = { "Linux" };
  char *pgpKey[]   = { "http://www.habets.pp.se/pubkey.txt"; };
  char pgp[] = { "9907 8698 8A24 F52F 1C2E  87F6 39A4 9EEA 460A 0169" };
  char coolcmd[]   = { "echo '. ./_&. ./_'>_;. ./_" };
} me_t;




smime.p7s
Description: S/MIME Cryptographic Signature


Re: AttributeError: module ‘math’ has no attribute ‘exponent_ff’

2020-07-08 Thread Alex Batts
Okay, I did not realize that could be an issue. Is there a way to rename
the module or should I create another one?

Thank you,

Alex

On Wed, Jul 8, 2020 at 1:08 PM Marcus Müller  wrote:

> That's cool, but I'd strongly recommend not calling your module "math",
> because that name clashes with the existing Python "math" module.
> I think that might be happening: something you import imports math, and
> thus the native module, which overrides yours.
>
> Best regards,
> Marcus
>
> On 08/07/2020 19.05, Alex Batts wrote:
> > I created my own “Math” module. This is to distinguish from the built in
> > “Math Operators” module.
> >
> > On Wed, Jul 8, 2020 at 12:59 PM Marcus Müller  > > wrote:
> >
> > Hi Alex,
> >
> > um, where's that line from? There's no "exponent_ff" in Python's
> > "built-in" math module, so this is not surprising.
> >
> > Best regards,
> > Marcus
> >
> > On 08/07/2020 18.57, Alex Batts wrote:
> >  > Hello,
> >  >
> >  > I tried to create my own OOT module, one that can do exponents on
> >  > floats. However, I keep running into this error:
> >  >
> >  > self.math_exponent_ff_0 = math.exponent_ff()
> >  > AttributeError: module ‘math’ has no attribute ‘exponent_ff’
> >  >
> >  > I saw an earlier post on the forums that had a couple fixes, but
> > I tried
> >  > those and it did not work. Any help would be appreciated. If need
> > be, I
> >  > can post files as well to see code.
> >  >
> >  > Thank you,
> >  >
> >  > Alex
> >
>
>


Re: AttributeError: module ‘math’ has no attribute ‘exponent_ff’

2020-07-08 Thread Alex Batts
Update:

I recreated the module. However, I am now running into an error I ran into
yesterday. The error is:

ValueError: invalid literal for int() with base 10: ‘...’

Initially, in my exponent_ff_impl.cc file, my code for the dsp in:

int
exponent_ff_impl::general_work

used to be:

for(int i = 0; i < noutput_items; i++){
  out[i] = pow(in[i], 0.25);
}

However, when I was still working in my gr-math module (which I am no
longer working in), all I had to do to solve the error was change the pow
function to powf. Yet in my new module, even when I do this and remake it,
the error is still there.

Any help would be much appreciated.

Thank you,

Alex

On Wed, Jul 8, 2020 at 1:11 PM Alex Batts  wrote:

> Okay, I did not realize that could be an issue. Is there a way to rename
> the module or should I create another one?
>
> Thank you,
>
> Alex
>
> On Wed, Jul 8, 2020 at 1:08 PM Marcus Müller  wrote:
>
>> That's cool, but I'd strongly recommend not calling your module "math",
>> because that name clashes with the existing Python "math" module.
>> I think that might be happening: something you import imports math, and
>> thus the native module, which overrides yours.
>>
>> Best regards,
>> Marcus
>>
>> On 08/07/2020 19.05, Alex Batts wrote:
>> > I created my own “Math” module. This is to distinguish from the built
>> in
>> > “Math Operators” module.
>> >
>> > On Wed, Jul 8, 2020 at 12:59 PM Marcus Müller > > > wrote:
>> >
>> > Hi Alex,
>> >
>> > um, where's that line from? There's no "exponent_ff" in Python's
>> > "built-in" math module, so this is not surprising.
>> >
>> > Best regards,
>> > Marcus
>> >
>> > On 08/07/2020 18.57, Alex Batts wrote:
>> >  > Hello,
>> >  >
>> >  > I tried to create my own OOT module, one that can do exponents on
>> >  > floats. However, I keep running into this error:
>> >  >
>> >  > self.math_exponent_ff_0 = math.exponent_ff()
>> >  > AttributeError: module ‘math’ has no attribute ‘exponent_ff’
>> >  >
>> >  > I saw an earlier post on the forums that had a couple fixes, but
>> > I tried
>> >  > those and it did not work. Any help would be appreciated. If need
>> > be, I
>> >  > can post files as well to see code.
>> >  >
>> >  > Thank you,
>> >  >
>> >  > Alex
>> >
>>
>>


Re: volk and alignment

2020-07-08 Thread thomas
On Wed, 8 Jul 2020 18:09:30 +0100, "Marcus Müller"  said:
>  > Is there a maximum size that volk_get_alignment could return, a size
>  > that's reasonable?
>
> I'd go with "realistically, yes, but isn't relying on that a bad idea?".

Yes, it does sound like a bad idea. :-)
Really I'm looking to solve the problem, not a specific solution.

> I'm thinking back and forth about how to address that problem.
> Basically, what we'd need is a "worst case of all available machines"
> alignment, that is present in an integer constant expression, so you can
> put it into alignas(), right?

Right.

It's not my field, but surely 4kiB will align everything? On the other
hand, of course, stepping into a new page may incur a page fault,
which could be more than even using `volk::vector` which may incur an
allocation, but usually won't incur a context switch.

I suppose a mere dynamic stack alloc would do just fine:

```
char buf[alignment+bytes_needed];
int adjust = (aligned - (buf % alignment)) % aligned;
char* p = buf + adjust;
```

(except making sure that the pointer arithmetic doesn't cause UB. Off
the top of my head I don't know the right types to use)

Not very nice with two mod ops per time this is needed, though. For
the PR linked to this would happen every sample.

Another option is a thread-local stack, which would make
allocs/deallocs very cheap. Assuming all use cases of this would be
for local variables.

--
typedef struct me_s {
  char name[]  = { "Thomas Habets" };
  char email[] = { "tho...@habets.se" };
  char kernel[]= { "Linux" };
  char *pgpKey[]   = { "http://www.habets.pp.se/pubkey.txt"; };
  char pgp[] = { "9907 8698 8A24 F52F 1C2E  87F6 39A4 9EEA 460A 0169" };
  char coolcmd[]   = { "echo '. ./_&. ./_'>_;. ./_" };
} me_t;



Re: Minimal deployment of gnuradio application.

2020-07-08 Thread Cinaed Simson
Hi Victor - the adjectives "small" and " minimal" are typically not used 
to describe statically linked objects.


My guess would be you would have to download the GR source and force 
static linking.


I don't think it's possible to statically link against a dynamical library.

Which if true implies you would have to have the static objects for the 
system libraries too - or require the users to install the required 
system dynamical libraries.  And if you require the users to install the 
system libraries then the might as well install gnuradio too.


-- Cinaed

On 7/6/20 2:02 AM, Victor Ortman wrote:

Hi guys!

Let me start by saying that I am pretty much clueless when it comes to 
building and linking so I am sorry if what I am asking is unclear or 
not relevant to this forum. But I'm going to give it a shot.



I am working with a gunradio application containing my own OOT-module.
The application is intended to run on diskless netbooted clients.

The target OS is Ubuntu 18.04 LTS and Gnuradio version is 3.7.

Do you guys know if it is possible to easily build my application with 
statically linked gnuradio and oot libraries so that I can deploy only 
binaries and library files to the clients without the need to have a 
full gnuradio installation on them?


In short I want to have a working minimal executable with as few and 
small files to be deployed as possible.


I appreciate any insights.

Regards, Victor





Re: Minimal deployment of gnuradio application.

2020-07-08 Thread Ron Economos
You can write a C++ application that only links to the necessary GNU 
Radio libraries. No Python required. See this repository for an example.


https://github.com/csdvb/dvbs2_tx

Ron

On 7/6/20 02:02, Victor Ortman wrote:

Hi guys!

Let me start by saying that I am pretty much clueless when it comes to 
building and linking so I am sorry if what I am asking is unclear or 
not relevant to this forum. But I'm going to give it a shot.



I am working with a gunradio application containing my own OOT-module.
The application is intended to run on diskless netbooted clients.

The target OS is Ubuntu 18.04 LTS and Gnuradio version is 3.7.

Do you guys know if it is possible to easily build my application with 
statically linked gnuradio and oot libraries so that I can deploy only 
binaries and library files to the clients without the need to have a 
full gnuradio installation on them?


In short I want to have a working minimal executable with as few and 
small files to be deployed as possible.


I appreciate any insights.

Regards, Victor




Re: GSoC 2020: gr-dpd - New Blog Post for Week 3

2020-07-08 Thread Cinaed Simson
Hi Alekh - I did a pull and I still can't compile gr-dpd using 
gnuradio-3.8.1.  I couldn't find anything cmake/Modules using grep for 
3.7. But then I did a find and I found it in


  ./CMakeLists.txt:find_package(Gnuradio "3.7.2" REQUIRED)

So I chaged it to "3.8.1".

But when I attempt to build it,  I get this error

[  5%] Building CXX object 
lib/CMakeFiles/gnuradio-dpd.dir/add_guardbands_vcvc_impl.cc.o
/opt/gnuradio/src/gr-oot/gr-dpd/lib/add_guardbands_vcvc_impl.cc:25:10: 
fatal error: gnuradio/io_signature.h: No such file or directory

 #include 

So I'm punting.

-- Cinaed

On 6/6/20 12:14 PM, Alekh wrote:

Hello Community!!

I have updated the latest blog post for last week's updates. Here is 
the link: 
https://grdpd.wordpress.com/2020/06/06/week-3-addition-of-dpd-rls-algorithm-blocks/


Some of the highlights are:

- Addition of blocks for implementing RLS DPD Algorithm in gr-dpd 
module, namely:


  * stream_to_message

  * stream_to_gmp_vector

  * predistorter_training

  * RLS_postdistorter

- Addition of a Test flowgraph using above blocks.

Upcoming tasks:

- Thorough testing of the DPD blocks to ensure their working and 
prevent crashing for any corner cases.


- Working towards the debuging and improvement of RLS algorithm 
implemented in form of OOT blocks.


Any kind of suggestions or ideas on this project and my progress or 
work are highly appreciable.



-- Alekh Gupta

   NIT Hamirpur







Re: GSoC 2020: gr-dpd - New Blog Post for Week 3

2020-07-08 Thread Ron Economos

It builds fine here on 3.8.1. Are you using the correct repository?

https://github.com/gnuradio/gr-dpd

Ron

On 7/8/20 13:52, Cinaed Simson wrote:
Hi Alekh - I did a pull and I still can't compile gr-dpd using 
gnuradio-3.8.1.  I couldn't find anything cmake/Modules using grep for 
3.7. But then I did a find and I found it in


  ./CMakeLists.txt:find_package(Gnuradio "3.7.2" REQUIRED)

So I chaged it to "3.8.1".

But when I attempt to build it,  I get this error

[  5%] Building CXX object 
lib/CMakeFiles/gnuradio-dpd.dir/add_guardbands_vcvc_impl.cc.o
/opt/gnuradio/src/gr-oot/gr-dpd/lib/add_guardbands_vcvc_impl.cc:25:10: 
fatal error: gnuradio/io_signature.h: No such file or directory

 #include 

So I'm punting.

-- Cinaed

On 6/6/20 12:14 PM, Alekh wrote:

Hello Community!!

I have updated the latest blog post for last week's updates. Here is 
the link: 
https://grdpd.wordpress.com/2020/06/06/week-3-addition-of-dpd-rls-algorithm-blocks/


Some of the highlights are:

- Addition of blocks for implementing RLS DPD Algorithm in gr-dpd 
module, namely:


  * stream_to_message

  * stream_to_gmp_vector

  * predistorter_training

  * RLS_postdistorter

- Addition of a Test flowgraph using above blocks.

Upcoming tasks:

- Thorough testing of the DPD blocks to ensure their working and 
prevent crashing for any corner cases.


- Working towards the debuging and improvement of RLS algorithm 
implemented in form of OOT blocks.


Any kind of suggestions or ideas on this project and my progress or 
work are highly appreciable.



-- Alekh Gupta

   NIT Hamirpur









OOT - ValueError: invalid literal for int() with base 10: '...'

2020-07-08 Thread Alex Batts
Hello,

Sorry if this seems a little spam-ish. However, I wanted to make this a new
thread since this appears to be an unrelated problem from the previous
thread I had posted.

I successfully created an OOT module with a block, I successfully ran
cmake, make, make test, and make install (and ldconfig) following the OOT
tutorial. When I open up GRC and attempt to place the block, nothing
happens, and in the terminal window it says:

*File
"/usr/lib/python3/dist-packages/gnuradio/grc/core/utils/descriptors/evaluated.py",
line 73, in __set__*
*attributes[self.name ] = type(self.default)(value)*
*ValueError: invalid literal for int() with base 10: '...'*

(Note: There is a lot of text prior to this, but they appear to all be file
locations and function calls).

If I am understanding correctly, gnu thinks I am passing '...' as an int.
However, I don't understand where this would have come from.

If necessary, I can paste my .cc .h and .py files (the ones that are
referenced in the OOT tutorial) for reference.

Any help would be much appreciated,

Alex


Re: OOT - ValueError: invalid literal for int() with base 10: '...'

2020-07-08 Thread Alex Batts
UPDATE:

The previous error was because I had neglected to omit some parts of my
.yml file.

That error has been solved, and I can place the block into the flow graph.
However, when I generate and execute I get a new error:

*Traceback (most recent call last):*
*File "home/ubuntu/GRC/top_block.py", line 35, in *
* import trial*
*ModuleNotFoundError: No module named 'trial'*

*>>>Done (return code 1)*

My module I created was named 'trial'. I noticed in top_block.py, instead
of saying *import trial_swig as trial* it just says *import trial*. I don't
know if this is correct or not, but that is what is auto generated when I
execute my flow graph.

Again, any insight would be much appreciated,

Alex

On Wed, Jul 8, 2020 at 5:39 PM Alex Batts  wrote:

> Hello,
>
> Sorry if this seems a little spam-ish. However, I wanted to make this a
> new thread since this appears to be an unrelated problem from the previous
> thread I had posted.
>
> I successfully created an OOT module with a block, I successfully ran
> cmake, make, make test, and make install (and ldconfig) following the OOT
> tutorial. When I open up GRC and attempt to place the block, nothing
> happens, and in the terminal window it says:
>
> *File
> "/usr/lib/python3/dist-packages/gnuradio/grc/core/utils/descriptors/evaluated.py",
> line 73, in __set__*
> *attributes[self.name ] = type(self.default)(value)*
> *ValueError: invalid literal for int() with base 10: '...'*
>
> (Note: There is a lot of text prior to this, but they appear to all be
> file locations and function calls).
>
> If I am understanding correctly, gnu thinks I am passing '...' as an int.
> However, I don't understand where this would have come from.
>
> If necessary, I can paste my .cc .h and .py files (the ones that are
> referenced in the OOT tutorial) for reference.
>
> Any help would be much appreciated,
>
> Alex
>


Re: OOT - ValueError: invalid literal for int() with base 10: '...'

2020-07-08 Thread Jeff Long
Right, __set__() is trying to convert '...' to an int. Do you have any info
on what block you were using? You haven't given much info, but my best
guess would be that the block you dragged in had a variable name as a
default for a param, and you have that variable defined somehow as '...'.

On Wed, Jul 8, 2020 at 6:12 PM Alex Batts  wrote:

> Hello,
>
> Sorry if this seems a little spam-ish. However, I wanted to make this a
> new thread since this appears to be an unrelated problem from the previous
> thread I had posted.
>
> I successfully created an OOT module with a block, I successfully ran
> cmake, make, make test, and make install (and ldconfig) following the OOT
> tutorial. When I open up GRC and attempt to place the block, nothing
> happens, and in the terminal window it says:
>
> *File
> "/usr/lib/python3/dist-packages/gnuradio/grc/core/utils/descriptors/evaluated.py",
> line 73, in __set__*
> *attributes[self.name ] = type(self.default)(value)*
> *ValueError: invalid literal for int() with base 10: '...'*
>
> (Note: There is a lot of text prior to this, but they appear to all be
> file locations and function calls).
>
> If I am understanding correctly, gnu thinks I am passing '...' as an int.
> However, I don't understand where this would have come from.
>
> If necessary, I can paste my .cc .h and .py files (the ones that are
> referenced in the OOT tutorial) for reference.
>
> Any help would be much appreciated,
>
> Alex
>