-
Notifications
You must be signed in to change notification settings - Fork 21
Render API docstrings in .py
files as html
#98
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
Merged
Merged
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
fa88942
Update .rst docs, remove empty ones, add a `dataframe_object.rst`
rgommers f20a39d
Fix type annotations so package is importable
rgommers 772c82f
Update `dataframe_object.rst` and use of autodoc
rgommers b91b6b8
A bunch more edits
rgommers c665192
Add a `_types.py` file for future use
rgommers c50bc0f
WIP: undo some type annotation changes that don't seem needed
rgommers 71a10c4
Update .gitignore for generated files
rgommers 3fe6b68
More changes, some autodoc warnings gone now
rgommers 51a6f0d
Extend docstrings of dunder methods, so autodoc table looks reasonable.
rgommers 7234265
More fixes - Sphinx build is clean now
rgommers 89d8ee5
Add groupby and column APIs to html docs, and add rst templates
rgommers 5f14390
Address review comments
rgommers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
*.swp | ||
_build | ||
__pycache__ | ||
spec/API_specification/generated/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.. _column-object: | ||
|
||
Column object | ||
============= | ||
|
||
A conforming implementation of the dataframe API standard must provide and | ||
support a column object having the following attributes and methods. | ||
|
||
------------------------------------------------- | ||
|
||
Methods | ||
------- | ||
TODO | ||
|
||
.. | ||
NOTE: please keep the methods in alphabetical order | ||
|
||
.. currentmodule:: dataframe_api | ||
|
||
.. autosummary:: | ||
:toctree: generated | ||
:template: property.rst | ||
|
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
""" | ||
Types for type annotations used in the dataframe API standard. | ||
|
||
The type variables should be replaced with the actual types for a given | ||
library, e.g., for Pandas TypeVar('DataFrame') would be replaced with pd.DataFrame. | ||
""" | ||
from __future__ import annotations | ||
|
||
from dataclasses import dataclass | ||
from typing import ( | ||
Any, | ||
List, | ||
Literal, | ||
Optional, | ||
Sequence, | ||
Tuple, | ||
TypeVar, | ||
Union, | ||
Protocol, | ||
) | ||
from enum import Enum | ||
|
||
array = TypeVar("array") | ||
Scalar = TypeVar("Scalar") | ||
device = TypeVar("device") | ||
dtype = TypeVar("dtype") | ||
SupportsDLPack = TypeVar("SupportsDLPack") | ||
SupportsBufferProtocol = TypeVar("SupportsBufferProtocol") | ||
PyCapsule = TypeVar("PyCapsule") | ||
# ellipsis cannot actually be imported from anywhere, so include a dummy here | ||
# to keep pyflakes happy. https://github.com/python/typeshed/issues/3556 | ||
ellipsis = TypeVar("ellipsis") | ||
|
||
_T_co = TypeVar("_T_co", covariant=True) | ||
|
||
|
||
class NestedSequence(Protocol[_T_co]): | ||
def __getitem__(self, key: int, /) -> Union[_T_co, NestedSequence[_T_co]]: | ||
... | ||
|
||
def __len__(self, /) -> int: | ||
... | ||
|
||
|
||
__all__ = [ | ||
"Any", | ||
"DataFrame", | ||
"List", | ||
"Literal", | ||
"NestedSequence", | ||
"Optional", | ||
"PyCapsule", | ||
"SupportsBufferProtocol", | ||
"SupportsDLPack", | ||
"Tuple", | ||
"Union", | ||
"Sequence", | ||
"array", | ||
"device", | ||
"dtype", | ||
"ellipsis", | ||
"Enum", | ||
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should column be capitalized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't do that on purpose. Maybe one thing to discuss in the context of constructors is whether the name matters (
Column
,DataFrame
, etc.). For array libraries we left this out on purpose, because it's never needed and existing libraries name these things differently. The same could apply here, unless you allow callingobject.__init__
as a constructor.