[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Union of two graphs keeping attributes
From: |
Tamas Nepusz |
Subject: |
Re: [igraph] Union of two graphs keeping attributes |
Date: |
Mon, 10 Jun 2013 14:56:33 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 |
> Is it possible to insert into next igraph? Should I go ahead and send a
> pull request on github?
If you send me a patch or a pull request on Github, I will integrate it into
the next release (probably 0.7) if possible. Note that a pull request would
require a bit more work:
- add a docstring to the function in Epydoc format
- make it a method of the Graph class
- it should work with more than two graphs; note that Graph.union() allows
you to specify more than one graph and it would merge the graphs in the
arguments into the current graph
- add a test case in igraph/test/operators.py
If you can do these, that would be great. If you don't have time for it,
that's okay, just file a request in the issue tracker on Github and I will
do it sooner or later.
> How would you call it? An option on Graph.compose()? It's not a real
> union, it's more the reverse of a decompose() operation.
I would simply override the current Graph.union() implementation; it could
have a keyword argument named "keep_attributes" with a default value of
False (for sake of compatibility). Setting it to True could invoke your
solution, while setting it to False could invoke the original implementation.
Cheers,
Tamas