Skip to content
GitLab
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 48
    • Issues 48
    • 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
  • Tiago Peixoto
  • graph-toolgraph-tool
  • Merge requests
  • !32

Ensure supplied position map for planar_layout is owned by view

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Jeff Trull requested to merge jaafar/graph-tool:bugfix/planar-layout-pos into master Jul 10, 2020
  • Overview 0
  • Commits 1
  • Pipelines 1
  • Changes 1

I found that if I tried using the pos argument to planar_layout I would get an error:

>>> import graph_tool.all as gt
>>> g = gt.lattice([10, 10])
>>> pos = g.new_vp("vector<double>") 
>>> posr = gt.planar_layout(g, pos=pos)
...
ValueError: Received property map for graph <Graph object, undirected, with 100 vertices and 294 edges, at 0x7f0f28470d50> (base: <Graph object, undirected, with 100 vertices and 294 edges, at 0x7f0f28470d50>), expected: <Graph object, undirected, with 100 vertices and 180 edges, at 0x7f0f43447950> (base: <Graph object, undirected, with 100 vertices and 180 edges, at 0x7f0f43447950>)

I believe the issue is that the planar_layout code operates on an undirected view, with properties removed, and the supplied pos is for the base graph. The supplied patch appears to fix the issue.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: bugfix/planar-layout-pos