Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is designed to fix both reading and writing of edge spells (and deprecated edge slices) on
.gexf
format graphs.The existing
add_spells
andadd_slices
methods are sufficiently generic in implementation to support serialization/deserialization of spells/slices for both nodes and edges and as such remain functionally unchanged. Parameter names for theadd_spells
andadd_slices
methods have been changed in several instances though, to reflect the handling of either nodes or edges. For example,def add_spells(self,node_element,node_data):
becomesdef add_spells(self,node_or_edge_element,node_or_edge_data):
.Calls to the relevant
add_spells
/add_slices
methods have been added during both deserialization of a.gexf
graph file's edges to networkx format (read) and during serialization of a networkx graph's edges to a.gexf
file format (write).Below is an example Gephi
.gexf
file some_file.gexf. I illustrate the difference in output between the current networkx implementation and the implementation with this fix applied, assuming that some_file.gexf is read in with networkx and written straight out again:some_file.gexf:
Reading
some_file.gexf
and immediately writing back out to some other file with existing networkx implementation (missing edge spells):Reading
some_file.gexf
and immediately writing back out to some other file with fixed networkx implementation (edge spells appear):Finally as a side note, there are some bugs with other aspects of
.gexf
serialization/deserialization. For example, the serialized output graphmode
attribute isstatic
. i.e. it is not honouring thedynamic
graph mode specified in the input file. This, and a few other issues are orthogonal to the fix under consideration though and I will create separate issues for them.