Skip to content

DOC: documenting cython class (eg Timestamp): "cyfunction is not a python function" #5218

Closed
@jorisvandenbossche

Description

@jorisvandenbossche

Follows from discussion in PR #5160.

When adding Timestamp in api.rst to document this class and its methods (as eg done in this commit jorisvandenbossche@3a8a41d), you get warnings when building the docs like for example:

WARNING: error while formatting arguments for pandas.Timestamp.to_period: 
<cyfunction Timestamp.to_period at 0x00000000057616C0> is not a Python 
function.

Timestamp is a python class in a cython file (so I suppose then it is a cython class). You get the warnings for all methods that are defined in this class (defined here https://github.com/pydata/pandas/blob/master/pandas/tslib.pyx#L130), but not for inherited functions of _Timestamp or datetime.

It seems that the generated docstring pages are built (so with the docstring rendered), but that Sphinx could not detect the signature.

Does somebody know how to let Sphinx handle cython classes/functions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions