Skip to content

Commit

Permalink
fix: fixed graph-tool import for vector-valued vertex properties, closes
Browse files Browse the repository at this point in the history
  • Loading branch information
ntamas committed Dec 9, 2023
1 parent 5f386c0 commit 46fd675
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# igraph Python interface changelog

## [main]

### Fixed

- Fixed import of `graph-tool` graphs for vertex properties where each property
has a vector value.

## [0.11.3] - 2023-11-19

### Added
Expand Down
5 changes: 4 additions & 1 deletion src/igraph/io/libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,12 @@ def _construct_graph_from_graph_tool(cls, g):

# Node attributes
for key, val in g.vertex_properties.items():
# val.get_array() returns None for non-scalar types so use the slower
# way if this happens
prop = val.get_array()
arr = prop if prop is not None else val
for i in range(vcount):
graph.vs[i][key] = prop[i]
graph.vs[i][key] = arr[i]

# Edges and edge attributes
# NOTE: graph-tool is quite strongly typed, so each property is always
Expand Down

0 comments on commit 46fd675

Please sign in to comment.