Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
graph-tool
graph-tool
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 45
    • Issues 45
    • 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
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Tiago Peixoto
  • graph-toolgraph-tool
  • Merge Requests
  • !32

Merged
Opened Jul 10, 2020 by Jeff Trull@jaafarContributor

Ensure supplied position map for planar_layout is owned by view

  • 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
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Reference: count0/graph-tool!32
Source branch: bugfix/planar-layout-pos