JuliaGraphs / Graphs.jl

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

Added types and note to `erdos_renyi` function #340

Closed henrik-wolf closed 5 months ago

henrik-wolf commented 5 months ago

I added typed-definitions to the docstring of erdos_renyi, as we differentiate the two different definitions of the Erdös-Rényi ensemble by dispatching on the type of the second argument.

As I spent some time with the strange edge case of erdos_renyi(n, 1) != erdos_renyi(n , 1.0) today this feels like a good idea.

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (f6f8db6) 97.28% compared to head (11fe08f) 97.28%. Report is 3 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #340 +/- ## ======================================= Coverage 97.28% 97.28% ======================================= Files 115 115 Lines 6789 6789 ======================================= Hits 6605 6605 Misses 184 184 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

gdalle commented 5 months ago

Some notes:

simonschoelly commented 5 months ago
* DocStringExtensions.jl might be a good tool in the future to automatically generate typed signatures in the docstrings and avoid this uncertainty

Afaik it is not always recommended to put the type signature in the doc string. This is anyways a special case, because Integer as subtype of a Real leads to a different behavior - something that I don't think is very desirable.