Opened 9 months ago

Closed 9 months ago

#32559 closed enhancement (fixed)

Use itertools.combinations instead of Combinations in HyperStarGraph generator

Reported by: dcoudert Owned by:
Priority: major Milestone: sage-9.5
Component: graph theory Keywords:
Cc: slelievre, chapoton, mhansen Merged in:
Authors: David Coudert Reviewers: Frédéric Chapoton
Report Upstream: N/A Work issues:
Branch: 9570d01 (Commits, GitHub, GitLab) Commit: 9570d010e586a079d25e18ef98ed611ceebcc13a
Dependencies: Stopgaps:

Status badges

Description (last modified by dcoudert)

Following #30483 we use itertools.combinations instead of Combinations in HyperStarGraph. On the way, we rewrite this generator in a more efficient way and check its input parameters.

Change History (8)

comment:1 Changed 9 months ago by dcoudert

  • Branch set to public/graphs/32559_hyperstar
  • Cc slelievre chapoton mhansen added
  • Commit set to 8460d20cef7af18f43af007a3dc5b4cd2bd9adb2
  • Description modified (diff)
  • Status changed from new to needs_review

New commits:

8460d20trac #32559: rewrite HyperStarGraph generator

comment:2 Changed 9 months ago by git

  • Commit changed from 8460d20cef7af18f43af007a3dc5b4cd2bd9adb2 to fe3db78686766e7a00751fff00e815392cf60561

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

fe3db78trac #32559: small details

comment:3 Changed 9 months ago by dcoudert

Green bot, please review.

Before

sage: %timeit g = graphs.HyperStarGraph(6,3)
215 µs ± 28 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)

With this ticket

sage: %timeit g = graphs.HyperStarGraph(6,3)
123 µs ± 3.08 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)

comment:4 Changed 9 months ago by chapoton

the new raise should be doctested.

comment:5 Changed 9 months ago by git

  • Commit changed from fe3db78686766e7a00751fff00e815392cf60561 to 9570d010e586a079d25e18ef98ed611ceebcc13a

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

5004990trac #32559: merged with 9.5.beta2
9570d01trac #32559: doctest input parameters

comment:6 Changed 9 months ago by dcoudert

Right, done.

comment:7 Changed 9 months ago by chapoton

  • Reviewers set to Frédéric Chapoton
  • Status changed from needs_review to positive_review

Merci. Un test aurait suffi.

comment:8 Changed 9 months ago by vbraun

  • Branch changed from public/graphs/32559_hyperstar to 9570d010e586a079d25e18ef98ed611ceebcc13a
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.