Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
graph-tool
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
40
Issues
40
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tiago Peixoto
graph-tool
Commits
8bd9024a
Commit
8bd9024a
authored
May 31, 2015
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix PropertyMap.set/get_2d_array() for "string"-valued property maps with filtered graphs
This closes
#226
parent
b681cbc3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
src/graph_tool/__init__.py
src/graph_tool/__init__.py
+17
-6
No files found.
src/graph_tool/__init__.py
View file @
8bd9024a
...
...
@@ -651,10 +651,18 @@ class PropertyMap(object):
else
:
p
=
[
self
]
g
=
self
.
get_graph
()
vfilt
=
g
.
get_vertex_filter
()
efilt
=
g
.
get_edge_filter
()
if
vfilt
[
0
]
is
not
None
:
g
=
GraphView
(
g
,
skip_vfilt
=
True
,
skip_efilt
=
True
)
if
self
.
key_type
()
==
"v"
:
N
=
g
.
num_vertices
()
idx
=
g
.
vertex_index
filt
=
vfilt
else
:
N
=
g
.
num_edges
()
N
=
g
.
max_edge_index
+
1
idx
=
g
.
edge_index
filt
=
efilt
a
=
[[
""
for
j
in
range
(
N
)]
for
i
in
range
(
len
(
p
))]
if
self
.
key_type
()
==
"v"
:
iters
=
g
.
vertices
()
...
...
@@ -662,10 +670,13 @@ class PropertyMap(object):
iters
=
g
.
edges
()
for
v
in
iters
:
for
i
in
range
(
len
(
p
)):
a
[
i
][
i
nt
(
v
)
]
=
p
[
i
][
v
]
a
[
i
][
i
dx
[
v
]
]
=
p
[
i
][
v
]
if
len
(
a
)
==
1
:
a
=
a
[
0
]
return
numpy
.
array
(
a
)
a
=
numpy
.
array
(
a
)
if
vfilt
[
0
]
is
not
None
:
a
=
a
[
filt
[
0
].
a
[:
a
.
shape
[
0
]]
==
(
not
filt
[
1
])]
return
a
try
:
return
numpy
.
array
(
self
.
fa
)
...
...
@@ -692,9 +703,9 @@ class PropertyMap(object):
if
self
.
key_type
()
==
"v"
:
iters
=
g
.
vertices
()
else
:
iters
=
g
.
edges
(
)
for
i
,
v
in
enumerate
(
iters
):
self
[
v
]
=
a
[
i
]
iters
=
sorted
(
g
.
edges
(),
key
=
lambda
e
:
g
.
edge_index
[
e
]
)
for
j
,
v
in
enumerate
(
iters
):
self
[
v
]
=
a
[
j
]
return
val
=
self
.
value_type
()[
7
:
-
1
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment