Hi:

There is an ambiguity.  You get the same warning  if the two nodes are the
same.  In general, it is legitimate for a node in the mathematical object
defined as a network to have an edge that goes from itself to itself. (See
Trudeau.) For example, a network modeling the translation of DNA to
proteins would have this type of edge.  In my particular problem (which I
admit has little interest to most of the world) Spinoza legitimately
develops corollaries by a proposition referring to itself.  Most of the
users of igraph seem to be in the social sciences and my guess is that
communications between social units may include such a node.

Since only the user can know the logic of its network, it is her
responsibility to process self-referring nodes.  In my opinion (although I
can see the other side) the function should be agnostic. :) and return an
empty list whenever there isn't a set of edges that connect one node to
another.  There's an argument for throwing an error here, but for
occasional python users an empty list is more convenient.  In the
self-referential case the function would return [node node].  That would
eliminate the ambiguity and conform igraph to mathematical practice.

>From your response, I can see that there are other design considerations
which are connected to the C layer.

I'm sorry that this explanation is so long, but philosophers like to write.

Very best.

Herb

On Sat Jan 03 2015 at 2:25:16 PM Tamas Nepusz <[email protected]> wrote:

> > For the get_shortest_paths function it would be convenient if the
> function
> > returned an empty list if the path was not possible.  This would provide
> a
> > simpler way of handling this situation than the runtime warning message.
> > Suppressing this message seems complex to the new user of python.
> The warning comes from the C layer:
>
> https://github.com/igraph/igraph/blob/master/src/
> structural_properties.c#L740
>
> The Python interface simply turns every warning coming from the C layer
> into
> a proper Python warning and although I could make a special exception for
> this
> warning in the Python layer, I'm a bit reluctant to do that -- others might
> dislike some other warning coming from the C layer and then I would have
> to do
> the same for those warnings as well :) Is there any particular reason why
> this
> warning bothers you so much that you would like to silence it at all costs?
>
> An alternative solution would be to add a Boolean flag to the Python module
> that the user can use to disable the translation of warnings coming from
> the
> C layer into Python warnings; you could then say something like
> "igraph.warnings = False" from Python to turn these warnings off.
>
> All the best,
> T.
>
> _______________________________________________
> igraph-help mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>
_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to