JuliaGraphs / Graphs.jl

An optimized graphs package for the Julia programming language
http://juliagraphs.org/Graphs.jl/
Other
451 stars 87 forks source link

Fix source of randomness in doctests #341

Open gdalle opened 5 months ago

gdalle commented 5 months ago

For instance with StableRNGs

simonschoelly commented 5 months ago

One issue I see with StableRNG is that we then might have to put that also in the example code. Then users might think that they should always use StableRNG - but if there is a way to somehow hide that, then yes, we can use it.

simonschoelly commented 5 months ago

Another - ugly method - would be to have different docstrings for different Julia versions.

gdalle commented 5 months ago

Or to filter docstrings with regexes but that's a whole nother can of worms that I don't want to open. I think StableRNGs is the least worst option, but I agree it's less than ideal.

Doctests are very irregular in the code base anyway, and I don't think that many methods have them. Would it make sense to remove them and add tests instead?