# Problems with Gnuradio-Companion

**URL:** <https://www.ruby-forum.com/t/problems-with-gnuradio-companion/233187>\
**Category:** GNU Radio\
**Created:** [November 22, 2014, 4:27pm UTC](https://www.ruby-forum.com/t/problems-with-gnuradio-companion/233187 "2014-11-22T16:27:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [November 22, 2014, 4:27pm UTC](https://www.ruby-forum.com/t/problems-with-gnuradio-companion/233187/1 "2014-11-22T16:27:07Z")

</div>

Hi everyone

How does gnuradio-companion find and recognise blocks?

Why is it so damned difficult for a normal person to write and maintain  
a  
block?

I had developed a working block written which functioned fine, even in  
gnuradio-companion. I needed an extra parameter so I added this. I  
modified  
all the appropriate files that I know about in lib, include and so on to  
include the extra parameter input. The modified block compiles without  
errors and it installs and works fine. I have done a sudo ldconfig. It  
even  
works and so do previous Python scripts that use it.

BUT Gnuradio Companion absolutely and completely refuses to find it.  
Error -  
block key not found in platform. Its not in the list of blocks, its just  
gone.

Is the XML file there? yes. Is it properly configured? Yes. Are all the  
other files in the right places? Yes - it would appear so by comparison  
with  
other blocks. No doubt there is some config file somewhere expecting my  
block to have one less parameter hiding in a directory with a curious  
name  
where its obvious to developers but not to mere mortals. Has GRC has  
looked  
is some such place, noted a difference and silently ignored the block  
completely? Three hours I have been bashing away at this and have got  
nowhere.

---

<div class="post-metadata">

**Author:** ![vh1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/278dde/32.png) [@vh1](https://www.ruby-forum.com/u/vh1)\
**Post date:** [November 22, 2014, 4:44pm UTC](https://www.ruby-forum.com/t/problems-with-gnuradio-companion/233187/2 "2014-11-22T16:44:39Z")

</div>

* * *

Discuss-gnuradio mailing list  
removed\_email\_address@domain.invalid  
[https://lists.gnu.org/mailman/listinfo/discuss-gnuradio](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

---

<div class="post-metadata">

**Author:** ![vh1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/278dde/32.png) [@vh1](https://www.ruby-forum.com/u/vh1)\
**Post date:** [November 22, 2014, 5:10pm UTC](https://www.ruby-forum.com/t/problems-with-gnuradio-companion/233187/3 "2014-11-22T17:10:03Z")

</div>

Thanks to Sebastian for his help.

This appears to be a bug? Well maybe my bug. My input parameter was  
intended  
as an identification number and not unreasonably I called it “id”.  
Apparently I can’t call the parameter “id”. I can call it “ix” and grc  
will  
find it. What on earth?

Mike

---

<div class="post-metadata">

**Author:** ![vh1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/278dde/32.png) [@vh1](https://www.ruby-forum.com/u/vh1)\
**Post date:** [November 22, 2014, 6:09pm UTC](https://www.ruby-forum.com/t/problems-with-gnuradio-companion/233187/4 "2014-11-22T18:09:18Z")

</div>

On Sat, Nov 22, 2014 at 11:08 AM, Mike W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> 

$ ipython

In [1]: help(id)

Help on built-in function id in module **builtin** :

id(…)  
id(object) → integer

```
Return the identity of an object. This is guaranteed to be unique 

```

among  
simultaneously existing objects. (Hint: it’s the object’s memory  
address.)

GRC runs in Python. It outputs Python code. You tried to use a reserved  
Python keyword.

Tom

---

<div class="post-metadata">

**Author:** ![vh1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/278dde/32.png) [@vh1](https://www.ruby-forum.com/u/vh1)\
**Post date:** [November 22, 2014, 6:23pm UTC](https://www.ruby-forum.com/t/problems-with-gnuradio-companion/233187/5 "2014-11-22T18:23:48Z")

</div>

On 11/22/2014 12:07 PM, Tom R. wrote:

> ```
> id(object) -> integer
> 
> ```
> 
> Tom

It is _theoretically_ possible for GRC to identify “stuff” that will  
later cause you problems at runtime due to Pythonisms. But that would  
_vastly_  
increase GRC’s complexity, and it would be error-prone, and “false  
positive” rather a lot, it’s simply not practical. GRC could also have  
its own  
“language” for evaluating expressions, rather than use Python. That  
would come with its own set of surprises and gotchas, so, better to use  
a language that is already well-developed, well-understood, and with  
well-defined semantics.

There’s no real way to get around the fact that, at the end of the day,  
you’re programming, and thus run into all the same “gotchas” that  
“conventional” (is there such a thing any more) programmers run into.

---

<div class="post-metadata">

**Author:** ![vh1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/278dde/32.png) [@vh1](https://www.ruby-forum.com/u/vh1)\
**Post date:** [November 22, 2014, 6:28pm UTC](https://www.ruby-forum.com/t/problems-with-gnuradio-companion/233187/6 "2014-11-22T18:28:02Z")

</div>

Hi Tom

Thanks for spotting this one.

There isn’t anything in the documentation on it. No doubt it would be  
obvious to python developers and it is assumed we all know, but I wonder  
if that is true? Especially as we are writing to XML describing the  
interface to a C++ program.

Now I know I am not very clever but how would I know what are reserved  
python codes? It would be obvious to a c programmer not to call  
something float or int, from, for class and so on.

I looked up on the web for reserved python keywords:

Reserved Words

You may not name your variables any of the following words as they mean  
special things in Python:

and

assert

break

class

continue

def

del

elif

else

except

exec

finally

for

from

global

if

import

in

is

lambda

not

or

pass

print

raise

return

try

while

Do NOT use any of the following words either (although they are not  
strictly Python reserved words, they conflict with the names of  
commonly-used Python functions):

Data

Float

Int

Numeric

Oxphys

array

close

float

int

input

open

range

type

write

zeros

You should also avoid all the names defined in the math library (you  
must avoid them if you import the library):

acos

asin

atan

cos

e

exp

fabs

floor

log

log10

pi

sin

sqrt

tan

I would never have guessed not to use lambda. It is just the sort of  
thing I might chose for a wavelength input but “id” is not one of these.  
It’s a function:

[https://docs.python.org/3.3/library/functions.html#abs](https://docs.python.org/3.3/library/functions.html#abs) abs()

[https://docs.python.org/3.3/library/functions.html#func-dict](https://docs.python.org/3.3/library/functions.html#func-dict) dict()

[https://docs.python.org/3.3/library/functions.html#help](https://docs.python.org/3.3/library/functions.html#help) help()

[https://docs.python.org/3.3/library/functions.html#min](https://docs.python.org/3.3/library/functions.html#min) min()

[https://docs.python.org/3.3/library/functions.html#setattr](https://docs.python.org/3.3/library/functions.html#setattr) setattr()

[https://docs.python.org/3.3/library/functions.html#all](https://docs.python.org/3.3/library/functions.html#all) all()

[https://docs.python.org/3.3/library/functions.html#dir](https://docs.python.org/3.3/library/functions.html#dir) dir()

[https://docs.python.org/3.3/library/functions.html#hex](https://docs.python.org/3.3/library/functions.html#hex) hex()

[https://docs.python.org/3.3/library/functions.html#next](https://docs.python.org/3.3/library/functions.html#next) next()

[https://docs.python.org/3.3/library/functions.html#slice](https://docs.python.org/3.3/library/functions.html#slice) slice()

[https://docs.python.org/3.3/library/functions.html#any](https://docs.python.org/3.3/library/functions.html#any) any()

[https://docs.python.org/3.3/library/functions.html#divmod](https://docs.python.org/3.3/library/functions.html#divmod) divmod()

[https://docs.python.org/3.3/library/functions.html#id](https://docs.python.org/3.3/library/functions.html#id) id()

[https://docs.python.org/3.3/library/functions.html#object](https://docs.python.org/3.3/library/functions.html#object) object()

[https://docs.python.org/3.3/library/functions.html#sorted](https://docs.python.org/3.3/library/functions.html#sorted) sorted()

[https://docs.python.org/3.3/library/functions.html#ascii](https://docs.python.org/3.3/library/functions.html#ascii) ascii()

[https://docs.python.org/3.3/library/functions.html#enumerate](https://docs.python.org/3.3/library/functions.html#enumerate)  
enumerate()

[https://docs.python.org/3.3/library/functions.html#input](https://docs.python.org/3.3/library/functions.html#input) input()

[https://docs.python.org/3.3/library/functions.html#oct](https://docs.python.org/3.3/library/functions.html#oct) oct()

[https://docs.python.org/3.3/library/functions.html#staticmethod](https://docs.python.org/3.3/library/functions.html#staticmethod)  
staticmethod()

[https://docs.python.org/3.3/library/functions.html#bin](https://docs.python.org/3.3/library/functions.html#bin) bin()

[https://docs.python.org/3.3/library/functions.html#eval](https://docs.python.org/3.3/library/functions.html#eval) eval()

[https://docs.python.org/3.3/library/functions.html#int](https://docs.python.org/3.3/library/functions.html#int) int()

[https://docs.python.org/3.3/library/functions.html#open](https://docs.python.org/3.3/library/functions.html#open) open()

[https://docs.python.org/3.3/library/functions.html#func-str](https://docs.python.org/3.3/library/functions.html#func-str) str()

[https://docs.python.org/3.3/library/functions.html#bool](https://docs.python.org/3.3/library/functions.html#bool) bool()

[https://docs.python.org/3.3/library/functions.html#exec](https://docs.python.org/3.3/library/functions.html#exec) exec()

[https://docs.python.org/3.3/library/functions.html#isinstance](https://docs.python.org/3.3/library/functions.html#isinstance)  
isinstance()

[https://docs.python.org/3.3/library/functions.html#ord](https://docs.python.org/3.3/library/functions.html#ord) ord()

[https://docs.python.org/3.3/library/functions.html#sum](https://docs.python.org/3.3/library/functions.html#sum) sum()

[https://docs.python.org/3.3/library/functions.html#bytearray](https://docs.python.org/3.3/library/functions.html#bytearray)  
bytearray()

[https://docs.python.org/3.3/library/functions.html#filter](https://docs.python.org/3.3/library/functions.html#filter) filter()

[https://docs.python.org/3.3/library/functions.html#issubclass](https://docs.python.org/3.3/library/functions.html#issubclass)  
issubclass()

[https://docs.python.org/3.3/library/functions.html#pow](https://docs.python.org/3.3/library/functions.html#pow) pow()

[https://docs.python.org/3.3/library/functions.html#super](https://docs.python.org/3.3/library/functions.html#super) super()

[https://docs.python.org/3.3/library/functions.html#bytes](https://docs.python.org/3.3/library/functions.html#bytes) bytes()

[https://docs.python.org/3.3/library/functions.html#float](https://docs.python.org/3.3/library/functions.html#float) float()

[https://docs.python.org/3.3/library/functions.html#iter](https://docs.python.org/3.3/library/functions.html#iter) iter()

[https://docs.python.org/3.3/library/functions.html#print](https://docs.python.org/3.3/library/functions.html#print) print()

[https://docs.python.org/3.3/library/functions.html#func-tuple](https://docs.python.org/3.3/library/functions.html#func-tuple) tuple()

[https://docs.python.org/3.3/library/functions.html#callable](https://docs.python.org/3.3/library/functions.html#callable)  
callable()

[https://docs.python.org/3.3/library/functions.html#format](https://docs.python.org/3.3/library/functions.html#format) format()

[https://docs.python.org/3.3/library/functions.html#len](https://docs.python.org/3.3/library/functions.html#len) len()

[https://docs.python.org/3.3/library/functions.html#property](https://docs.python.org/3.3/library/functions.html#property)  
property()

[https://docs.python.org/3.3/library/functions.html#type](https://docs.python.org/3.3/library/functions.html#type) type()

[https://docs.python.org/3.3/library/functions.html#chr](https://docs.python.org/3.3/library/functions.html#chr) chr()

[https://docs.python.org/3.3/library/functions.html#func-frozenset](https://docs.python.org/3.3/library/functions.html#func-frozenset)  
frozenset()

[https://docs.python.org/3.3/library/functions.html#func-list](https://docs.python.org/3.3/library/functions.html#func-list) list()

[https://docs.python.org/3.3/library/functions.html#func-range](https://docs.python.org/3.3/library/functions.html#func-range) range()

[https://docs.python.org/3.3/library/functions.html#vars](https://docs.python.org/3.3/library/functions.html#vars) vars()

[https://docs.python.org/3.3/library/functions.html#classmethod](https://docs.python.org/3.3/library/functions.html#classmethod)  
classmethod()

[https://docs.python.org/3.3/library/functions.html#getattr](https://docs.python.org/3.3/library/functions.html#getattr) getattr()

[https://docs.python.org/3.3/library/functions.html#locals](https://docs.python.org/3.3/library/functions.html#locals) locals()

[https://docs.python.org/3.3/library/functions.html#repr](https://docs.python.org/3.3/library/functions.html#repr) repr()

[https://docs.python.org/3.3/library/functions.html#zip](https://docs.python.org/3.3/library/functions.html#zip) zip()

[https://docs.python.org/3.3/library/functions.html#compile](https://docs.python.org/3.3/library/functions.html#compile) compile()

[https://docs.python.org/3.3/library/functions.html#globals](https://docs.python.org/3.3/library/functions.html#globals) globals()

[https://docs.python.org/3.3/library/functions.html#map](https://docs.python.org/3.3/library/functions.html#map) map()

[https://docs.python.org/3.3/library/functions.html#reversed](https://docs.python.org/3.3/library/functions.html#reversed)  
reversed()

[https://docs.python.org/3.3/library/functions.html#\_\_import\_\_](https://docs.python.org/3.3/library/functions.html# __import__ )  
**import** ()

[https://docs.python.org/3.3/library/functions.html#complex](https://docs.python.org/3.3/library/functions.html#complex) complex()

[https://docs.python.org/3.3/library/functions.html#hasattr](https://docs.python.org/3.3/library/functions.html#hasattr) hasattr()

[https://docs.python.org/3.3/library/functions.html#max](https://docs.python.org/3.3/library/functions.html#max) max()

[https://docs.python.org/3.3/library/functions.html#round](https://docs.python.org/3.3/library/functions.html#round) round()

[https://docs.python.org/3.3/library/functions.html#delattr](https://docs.python.org/3.3/library/functions.html#delattr) delattr()

[https://docs.python.org/3.3/library/functions.html#hash](https://docs.python.org/3.3/library/functions.html#hash) hash()

[https://docs.python.org/3.3/library/functions.html#func-memoryview](https://docs.python.org/3.3/library/functions.html#func-memoryview)  
memoryview()

[https://docs.python.org/3.3/library/functions.html#func-set](https://docs.python.org/3.3/library/functions.html#func-set) set()

Somewhere in the documentation, it would be really useful to have a list  
of reserved words and function names we can’t use, or even better some  
checking of the XML to warn people. It ought to be clear from the  
context that a user is not attempting to call a python function in  
describing a variable name.

It is probably also the case that any function in any library that is  
imported is also not usable.

Mike

From: removed\_email\_address@domain.invalid [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of  
Tom R.  
Sent: 22 November 2014 17:08  
To: Mike W.  
Cc: GNURadio D.ion List  
Subject: Re: [Discuss-gnuradio] Problems with Gnuradio-Companion

On Sat, Nov 22, 2014 at 11:08 AM, Mike W. \<removed\_email\_address@domain.invalid  
[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) \> wrote:

Thanks to Sebastian for his help.

This appears to be a bug? Well maybe my bug. My input parameter was  
intended as an identification number and not unreasonably I called it  
“id”. Apparently I can’t call the parameter “id”. I can call it “ix” and  
grc will find it. What on earth?

Mike

$ ipython

In [1]: help(id)

Help on built-in function id in module **builtin** :

id(…)

```
id(object) -> integer

Return the identity of an object. This is guaranteed to be unique 

```

among

```
simultaneously existing objects. (Hint: it's the object's memory 

```

address.)

GRC runs in Python. It outputs Python code. You tried to use a reserved  
Python keyword.

Tom
