Opened 11 years ago

Closed 11 years ago

#8331 closed defect (fixed)

BipartiteGraph constructor does not create partitions for dict inputs

Reported by: rhinton Owned by: rhinton
Priority: major Milestone: sage-4.3.4
Component: graph theory Keywords: BipartiteGraph
Cc: jason, rlm Merged in: sage-4.3.4.alpha0
Authors: Ryan Hinton Reviewers: Robert Miller
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

The BipartiteGraph? constructor does not create partitions for dict inputs.

sage: t1 = BipartiteGraph({'a': ['b'], 'b':['c']})
sage: t1.left
...
AttributeError: 'BipartiteGraph' object has no attribute 'left'

The problem comes in the constructor in the "other inputs" case. A Graph object is created, but not all the control paths find a bipartition.

Attachments (1)

trac_8331-bipartite-dict-initializer.patch (4.8 KB) - added by rhinton 11 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 11 years ago by rlm

another duplicate of part of #1941.

Changed 11 years ago by rhinton

comment:2 Changed 11 years ago by rhinton

  • Status changed from new to needs_review

The patch trac_8331-... fixes the bug, adds a doctest, and slightly improves the ReST markup for the constructor. (I am certainly not an expert.)

comment:3 Changed 11 years ago by rhinton

  • Owner changed from rlm to rhinton

comment:4 Changed 11 years ago by rlm

  • Reviewers set to Robert Miller
  • Status changed from needs_review to positive_review

Works for me :-)

comment:5 Changed 11 years ago by mvngu

  • Merged in set to sage-4.3.4.alpha0
  • Resolution set to fixed
  • Status changed from positive_review to closed

Ryan: remember to put a sensible commit message in your patch, together with the ticket number.

Note: See TracTickets for help on using tickets.