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

DOC: numpy.lib.npyio._read refers to read_from_filename, which does not exists. #23803

Closed
Carreau opened this issue May 24, 2023 · 3 comments · Fixed by #23854
Closed

DOC: numpy.lib.npyio._read refers to read_from_filename, which does not exists. #23803

Carreau opened this issue May 24, 2023 · 3 comments · Fixed by #23854

Comments

@Carreau
Copy link
Contributor

Carreau commented May 24, 2023

Issue with current documentation:

Those two examples are present:

    Examples
    --------
    First we create a file for the example.

    >>> s1 = '1.0,2.0,3.0\n4.0,5.0,6.0\n'
    >>> with open('example1.csv', 'w') as f:
    ...     f.write(s1)
    >>> a1 = read_from_filename('example1.csv')
    >>> a1
    array([[1., 2., 3.],
           [4., 5., 6.]])

    The second example has columns with different data types, so a
    one-dimensional array with a structured data type is returned.
    The tab character is used as the field delimiter.

    >>> s2 = '1.0\t10\talpha\n2.3\t25\tbeta\n4.5\t16\tgamma\n'
    >>> with open('example2.tsv', 'w') as f:
    ...     f.write(s2)
    >>> a2 = read_from_filename('example2.tsv', delimiter='\t')
    >>> a2
    array([(1. , 10, b'alpha'), (2.3, 25, b'beta'), (4.5, 16, b'gamma')],
          dtype=[('f0', '<f8'), ('f1', 'u1'), ('f2', 'S5')])

Both reference read_from_filename, which is nowhere to be found.
Maybe a rename at somepoint ?

Idea or request for content:

the function is called _read and seam to only be used in the same file in loadtxt and the imaginary_unit parameter seem to not be used in the sole call site.

If this is private, maybe move the example the the higher level function that use this one.

@ngoldbaum
Copy link
Member

ping @seberg who added the docstrings in 1e15b43. Just looking at the commit, maybe the _read function added in that commit was originally named read_from_filename?

@krishh16
Copy link

@Carreau I would love to work on this repository

@seberg
Copy link
Member

seberg commented May 25, 2023

@ngoldbaum yeah, I think that is correct. I would agree with removing the examples (and maybe making sure that loadtxt has it, but really all that it needs as docs might be to point to loadtxt and saying that its a helper for that)

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

Successfully merging a pull request may close this issue.

4 participants