Opened 6 years ago

Closed 6 years ago

#21824 closed defect (fixed)

surprising behaviour of DegreeSequences(1)

Reported by: mantepse Owned by:
Priority: major Milestone: sage-7.5
Component: graph theory Keywords:
Cc: Merged in:
Authors: David Coudert Reviewers: Dima Pasechnik
Report Upstream: N/A Work issues:
Branch: 9b7a774 (Commits, GitHub, GitLab) Commit: 9b7a77486c804703ed5750c6a2f97737713e8315
Dependencies: Stopgaps:

Status badges

Description (last modified by dcoudert)

This patch resolves the following issue:

sage: [d for d in DegreeSequences(1)]
TypeError                                 Traceback (most recent call last)
<ipython-input-4-1ed3bfa4681c> in <module>()
----> 1 [d for d in DegreeSequences(Integer(1))]

/home/martin/sage-develop/src/sage/combinat/degree_sequences.pyx in sage.combinat.degree_sequences.DegreeSequences.__iter__ (/home/martin/sage-develop/src/build/cythonized/sage/combinat/degree_sequences.c:3014)()
    378         init(self._n)
--> 379         return iter(sequences)
    381     def __dealloc__():

TypeError: 'NoneType' object is not iterable
sage: [d for d in DegreeSequences(2)]
[[0, 0], [1, 1]]
sage: [d for d in DegreeSequences(3)]
[[0, 0, 0], [1, 1, 0], [2, 1, 1], [2, 2, 2]]
sage: [d for d in DegreeSequences(1)]
[[0, 0, 0], [1, 1, 0], [2, 1, 1], [2, 2, 2]]

Change History (6)

comment:1 Changed 6 years ago by dcoudert

  • Authors set to David Coudert
  • Branch set to u/dcoudert/degreeseq
  • Commit set to a218b0b2004ad7fffc3a26cf4244f1f8f9997513
  • Status changed from new to needs_review

Simple fix and required tests.

New commits:

a218b0btrac #21824: fix unexpected behaviors of DegreeSequences

comment:2 Changed 6 years ago by git

  • Commit changed from a218b0b2004ad7fffc3a26cf4244f1f8f9997513 to 9b7a77486c804703ed5750c6a2f97737713e8315

Branch pushed to git repo; I updated commit sha1. New commits:

e8d31a5trac #21824: Merged with 7.5.beta2
9b7a774trac #21824: merge with last 7.5.beta2

comment:3 Changed 6 years ago by dcoudert

  • Description modified (diff)

the second commit should have a different name like "simplification". Anyway, this patch is ready for review.


comment:4 Changed 6 years ago by dimpase

  • Reviewers set to Dima Pasechnik
  • Status changed from needs_review to positive_review

Looks good.

comment:5 Changed 6 years ago by dcoudert

Thank you.

comment:6 Changed 6 years ago by vbraun

  • Branch changed from u/dcoudert/degreeseq to 9b7a77486c804703ed5750c6a2f97737713e8315
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.