Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in doc of sprandn #31283

Closed
DNF2 opened this issue Mar 7, 2019 · 2 comments · Fixed by #34257
Closed

Error in doc of sprandn #31283

DNF2 opened this issue Mar 7, 2019 · 2 comments · Fixed by #34257
Labels
domain:arrays:sparse Sparse arrays domain:docs This change adds or pertains to documentation good first issue Indicates a good issue for first-time contributors to Julia kind:bug Indicates an unexpected problem or unintended behavior

Comments

@DNF2
Copy link

DNF2 commented Mar 7, 2019

The documentation of sprand/sprandn appears to have an error in the section https://docs.julialang.org/en/v1/stdlib/SparseArrays/#Correspondence-of-dense-and-sparse-methods-1

The table here:
screenshot 2019-03-06 at 13 04 08
shows that sprandn takes a distribution as a final argument, but this is not the case.

The accompanying text also seems to indicate that this should work:

sprand(100, 100, 0.3, Uniform(-1,1))

while, in fact, you need

sprand(100, 100, 0.3, n->rand(Uniform(-1,1),n))

Also, the docstring of sprand gives the wrong impression:

Nonzero values are sampled from the distribution specified by rfn and have the type type.

@StefanKarpinski StefanKarpinski added kind:bug Indicates an unexpected problem or unintended behavior domain:docs This change adds or pertains to documentation domain:arrays:sparse Sparse arrays labels Mar 7, 2019
@ViralBShah
Copy link
Member

It would be great if you could submit a PR to the docs themselves.

@ViralBShah ViralBShah added the good first issue Indicates a good issue for first-time contributors to Julia label Jul 6, 2019
ViralBShah pushed a commit that referenced this issue Jan 4, 2020
@ViralBShah
Copy link
Member

Also, the docstring of sprand gives the wrong impression:

Nonzero values are sampled from the distribution specified by rfn and have the type type.

The docs no longer mention this and seem to be in sync with the code.

ViralBShah pushed a commit that referenced this issue Jan 10, 2020
KristofferC pushed a commit that referenced this issue Jan 15, 2020
(cherry picked from commit 717d548)
KristofferC pushed a commit that referenced this issue Jan 15, 2020
(cherry picked from commit 717d548)
KristofferC pushed a commit that referenced this issue Jan 17, 2020
(cherry picked from commit 717d548)
KristofferC pushed a commit that referenced this issue Feb 20, 2020
(cherry picked from commit 717d548)
KristofferC pushed a commit that referenced this issue Feb 20, 2020
(cherry picked from commit 717d548)
KristofferC pushed a commit that referenced this issue Feb 20, 2020
(cherry picked from commit 717d548)
KristofferC pushed a commit that referenced this issue Feb 22, 2020
(cherry picked from commit 717d548)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:arrays:sparse Sparse arrays domain:docs This change adds or pertains to documentation good first issue Indicates a good issue for first-time contributors to Julia kind:bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants