Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • graph-tool graph-tool
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 46
    • Issues 46
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Please use the issue tracker only to report bugs (i.e. errors in the library that need to be fixed) or feature requests.

For questions about how to compile, install or use the library, please use instead the mailing list at https://graph-tool.skewed.de/mailing
(If unsure, use the mailing list first.)



When opening new issues, please choose the BUG template from the drop-down menu, and fill out the required information.

  • Tiago Peixoto
  • graph-toolgraph-tool
  • Issues
  • #226

Closed
Open
Created May 30, 2015 by Joel Moberg@joelmo

Accessing property map when a filter is set

Should I be able to access a pmap when a filter is set, and if this shouldn't be possible maybe another exception can be thrown that explains why the map can't be accessed.

This is a example of what happens now:

from graph_tool.all import *
import numpy as np
g = collection.data['polbooks']
filt = g.new_vertex_property('bool', vals=np.random.binomial(1,0.5,size=g.num_vertices()))
g.set_vertex_filter(filt)
pm = g.vp['value']
pm.get_2d_array([0])
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-35-6b06f2e3077b> in <module>()
      5 g.set_vertex_filter(filt)
      6 pm = g.vp['value']
----> 7 pm.get_2d_array([0])

/home/joelmo/.nix-profile/lib/python2.7/site-packages/graph_tool/__init__.pyc in get_2d_array(self, pos)
    663             for v in iters:
    664                 for i in range(len(p)):
--> 665                     a[i][int(v)] = p[i][v]
    666             if len(a) == 1:
    667                 a = a[0]

IndexError: list assignment index out of range
Assignee
Assign to
Time tracking