pandas icon indicating copy to clipboard operation
pandas copied to clipboard

Missing source link

Open fbourgey opened this issue 1 year ago • 10 comments

  • [ ] closes #58351

The source link located at the upper right-hand side of DataFrame.index and DataFrame.columns is still missing. This may be because they do not have any code.

DataFrame.index and DataFrame.columns are properties.AxisProperty

I still merged the two Axes sections in the .rst file after discussing with @WillAyd

The same thing exists for Series.index

fbourgey avatar Aug 19 '24 16:08 fbourgey

/preview

WillAyd avatar Aug 19 '24 16:08 WillAyd

/preview

WillAyd avatar Aug 19 '24 19:08 WillAyd

Website preview of this PR available at: https://pandas.pydata.org/preview/pandas-dev/pandas/59549/

github-actions[bot] avatar Aug 19 '24 19:08 github-actions[bot]

From the preview link I don't think this did anything:

https://pandas.pydata.org/preview/pandas-dev/pandas/59549/docs/reference/api/pandas.DataFrame.index.html

May also just be because these items are class attributes and not properties.

I'm not entirely sure how the docs generate the source link - @mroeschke do you know what tool does that and/or how it works?

WillAyd avatar Aug 19 '24 19:08 WillAyd

They are generated via Sphinx through this extension I presume, but I've never played around with it https://www.sphinx-doc.org/en/master/usage/extensions/linkcode.html#confval-linkcode_resolve

mroeschke avatar Aug 19 '24 20:08 mroeschke

From the preview link I don't think this did anything:

https://pandas.pydata.org/preview/pandas-dev/pandas/59549/docs/reference/api/pandas.DataFrame.index.html

May also just be because these items are class attributes and not properties.

I'm not entirely sure how the docs generate the source link - @mroeschke do you know what tool does that and/or how it works?

This only added a "See also" section for pandas.DataFrame.columns.

fbourgey avatar Aug 19 '24 21:08 fbourgey

@WillAyd @mroeschke Ideally, do we want the source link to point to this or as Will said as DataFrame.columns has no code, there is no need to have a source link?

fbourgey avatar Aug 21 '24 14:08 fbourgey

There ideally should be a source link to your reference, but there might be some extra Sphinx code needed to find that reference

mroeschke avatar Aug 21 '24 17:08 mroeschke

It seems that Sphinx does not support .pyi files (see here and here and also here)

pandas.DataFrame.columns is a pandas._libs.properties.AxisProperty located here

The same thing exists for pandas.Interval for which the source link is missing as well. It is defined here

Should we close this issue then?

fbourgey avatar Aug 22 '24 14:08 fbourgey

Nonetheless, I slightly updated the pandas.DataFrame.columns doc (added a Return and See also section)

fbourgey avatar Aug 22 '24 15:08 fbourgey

Thanks @fbourgey

mroeschke avatar Sep 06 '24 18:09 mroeschke