Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#5936 closed enhancement (fixed)

[with patch, positive review] result of graph query should be iterable -- make more pythonic

Reported by: was Owned by: rlm
Priority: major Milestone: sage-4.0.1
Component: graph theory Keywords:
Cc: Merged in: 4.0.1.alpha0
Authors: Emily Kirkman Reviewers: Robert Miller
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

Currently we have this:

sage: Q = GraphQuery(
       display_cols=['graph6','num_vertices','degree_sequence'],
       num_edges=['<=',5],min_degree=1)
sage: for G in Q: print G

outputs

Traceback (click to the left for traceback)
...
TypeError: 'GraphQuery' object is not iterable

Why not have it Q.iter() return an iterator over Q.get_graphs_list(), which would easily work?

Attachments (1)

trac5936_graphdatabase.patch (3.5 KB) - added by rlm 12 years ago.
Referee edit of Emily's patch

Download all attachments as: .zip

Change History (5)

comment:1 Changed 12 years ago by ekirkman

  • Summary changed from result of graph query should be iterable -- make more pythonic to [with patch, needs review] result of graph query should be iterable -- make more pythonic

Patch covers docstring updates (see #5935) and adds an iterator for GraphQuery?.

comment:2 Changed 12 years ago by rlm

  • Summary changed from [with patch, needs review] result of graph query should be iterable -- make more pythonic to [with patch, positive review] result of graph query should be iterable -- make more pythonic

Changed 12 years ago by rlm

Referee edit of Emily's patch

comment:3 Changed 12 years ago by mhansen

  • Resolution set to fixed
  • Status changed from new to closed

Merged in 4.0.1.alpha0.

comment:4 Changed 12 years ago by mhansen

  • Authors set to Emily Kirkman
  • Merged in set to 4.0.1.alpha0
  • Reviewers set to Robert Miller
Note: See TracTickets for help on using tickets.