Opened 11 years ago

Closed 6 years ago

#10122 closed defect (duplicate)

Random doctests in random_matrix helpers

Reported by: jason Owned by: jason, was
Priority: minor Milestone: sage-duplicate/invalid/wontfix
Component: linear algebra Keywords:
Cc: rbeezer, bwonderly Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

In #9754, #9802, #9720, #9803, and #9754, some of the doctests are now marked #random that should not be marked random (since the random seed is fixed when the doctests are tested).

Also, in #9754, "natural" is spelled "natrual".

Change History (7)

comment:1 follow-up: Changed 10 years ago by rbeezer

  • Cc bwonderly added

Hi Jason,

The randomness comes from the distributions in the GSL library. You can set the seed, on a per-distribution basis, at the time you initialize the distribution.

We could not see a way to do this in a doctest, but outside the routine being tested. So we *definitely* tried to do this, and *probably* couldn't find a way.

Any thoughts?

Rob

comment:2 in reply to: ↑ 1 Changed 10 years ago by jason

Replying to rbeezer:

Hi Jason,

The randomness comes from the distributions in the GSL library. You can set the seed, on a per-distribution basis, at the time you initialize the distribution.

We could not see a way to do this in a doctest, but outside the routine being tested. So we *definitely* tried to do this, and *probably* couldn't find a way.

I see that GSL is not one of the libraries interfaced in misc/randstate.pyx. At first glance, that would be the way to fix it (add GSL to one of the supported library seed-setting routines in that file).

I see that it's a more complicated issue though. Thanks for the explanation.

comment:3 Changed 10 years ago by rbeezer

I would have liked to have not marked these tests "random," so thanks for the confirmation that we didn't miss something.

It'd be nice to get all the randomness under one roof, and have things like this use the doctesting seed-setting. So I think it is worth leaving this ticket around (or make a new one that is more general and explicit). Which route do you think would be best?

Rob

comment:4 Changed 8 years ago by rbeezer

These tests ended up being marked # random in part from confusion related to #15089.

The random matrix routines can be made predictable (by setting the seed) with the patch on #15090.

I'd be inclined to come back to this one, if and when #15090 has a positive review.

comment:5 Changed 6 years ago by novoselt

  • Milestone set to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

#15887 removed a bunch of random comments.

comment:6 Changed 6 years ago by novoselt

  • Status changed from needs_review to positive_review

comment:7 Changed 6 years ago by vbraun

  • Resolution set to duplicate
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.