Ticket #10122 (new defect)

Opened 3 years ago

Last modified 3 years ago

Random doctests in random_matrix helpers

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

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

comment:1 follow-up: ↓ 2 Changed 3 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 3 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 3 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

Note: See TracTickets for help on using tickets.