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
48759a07
Commit
48759a07
authored
Jun 14, 2020
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PropertyMap.get/set_2d_array(): Improve docstring
parent
4bcfb3ba
Pipeline
#647
passed with stage
in 135 minutes and 36 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
src/graph_tool/__init__.py
src/graph_tool/__init__.py
+13
-8
No files found.
src/graph_tool/__init__.py
View file @
48759a07
...
...
@@ -568,10 +568,12 @@ class PropertyMap(object):
is identical to the :attr:`~PropertyMap.a` attribute."""
)
def
get_2d_array
(
self
,
pos
):
r
"""Return a two-dimensional array with a copy of the entries of the
vector-valued property map. The parameter ``pos`` must be a sequence of
integers which specifies the indexes of the property values which will
be used. """
r
"""Return a two-dimensional array of shape ``(M,N)``, where ``N`` is the number
of vertices or edges, and ``M`` is the size of each property vector,
with contains a copy of all entries of the vector-valued property map.
The parameter ``pos`` must be a sequence of integers which specifies the
indexes of the property values which will be copied.
"""
if
self
.
key_type
()
==
"g"
:
raise
ValueError
(
"Cannot create multidimensional array for graph property maps."
)
...
...
@@ -606,10 +608,13 @@ class PropertyMap(object):
return
a
def
set_2d_array
(
self
,
a
,
pos
=
None
):
r
"""Set the entries of the vector-valued property map from a
two-dimensional array ``a``. If given, the parameter ``pos`` must be a
sequence of integers which specifies the indexes of the property values
which will be set."""
r
"""Set the entries of the vector-valued property map from a two-dimensional
array ``a`` of shape ``(M,N)``, where ``N`` is the number of vertices or
edges, and ``M`` is the size of each property vector. If given, the
parameter ``pos`` must be a sequence of integers which specifies the
indexes of the property values which will be set (i.e. rows if the ``a``
matrix).
"""
if
self
.
key_type
()
==
"g"
:
raise
ValueError
(
"Cannot set multidimensional array for graph property maps."
)
...
...
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