Skip to content

DOC: np.random.random documentation refers only to np.random.random_sample #7512

Closed

Description

@keithbriggs

The documentation for numpy.random.random repeatedly refers to numpy.random.random_sample.

Activity

  1. changed the title [-]doc error at https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.random.html#numpy.random.random[/-] [+]DOC: np.random.random documentation refers only to np.random.random_sample[/+] on Aug 8, 2018
  2. streeck commented on Oct 31, 2018

    @streeck

    Hi @keithbriggs, I've submitted a PR for this, could you have a look and see if it's ok?

  3. keithbriggs commented on Nov 3, 2018

    @keithbriggs
    Author
  4. ron819 commented on Nov 15, 2018

    @ron819

    If someone going to pick this one up.
    Some comments are written in the previous PR:
    #12303

  5. bashtage commented on Apr 11, 2019

    @bashtage
    Contributor

    @mattip These legacy aliases should be dropped in randomgen. Both random and sample, and only random_sample should remain.

  6. mattip commented on Apr 12, 2019

    @mattip
    Member

    That sounds like a deprecation and so must undergo a deprecation cycle

  7. rgommers commented on Apr 12, 2019

    @rgommers
    Member

    That's not how it sounds to me. "randomgen" is brand new, so nothing needs deprecating there. And the existing API should not be touched as part of introducing randomgen.

  8. mattip commented on Apr 12, 2019

    @mattip
    Member

    "legacy aliases"

  9. rgommers commented on Apr 12, 2019

    @rgommers
    Member

    "in randomgen" (= new)

    It may be ambiguous. If the suggestion was really to deprecate np.random.random, then no - that's definitely a no-go. It's used way too widely, and there's very little to gain from such a deprecation.

  10. bashtage commented on Apr 12, 2019

    @bashtage
    Contributor
  11. rgommers commented on Apr 12, 2019

    @rgommers
    Member

    This bug report and discussion is about the functions in the numpy.random namespace though, not the legacy or new RandomGenerator.

    To address this problem, we should just fix the np.random.random docstring. Just:

    def random(...):
        """"
        This is an alias of `random_sample`. See the `random_sample` docstring for full documentation.
        """
        random_sample(...)
    

    We do this for other aliases as well.

  12. bashtage commented on Apr 12, 2019

    @bashtage
    Contributor

    @rgommers This was mostly to link to @mattip 's issue and to be sure that these legacy names don't make it into the new API.

  13. rgommers commented on Apr 12, 2019

    @rgommers
    Member

    and to be sure that these legacy names don't make it into the new API.

    Indeed, that would be good. New API = new chance to make things clean and consistent.

  14. bashtage commented on Apr 12, 2019

    @bashtage
    Contributor

    This is (or will be soon) fixed in #13163 using simple pass-throughs that explain these are aliases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions