-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: First pass at doc site for Python (#605)
This uses Sphinx and the [sphinx-book-theme](https://sphinx-book-theme.readthedocs.io/en/stable/) to create organized documentation of the available methods for creating and executing timestreams. Sphinx makes it easy to include syntax-highlighted examples from the documentation, as well as embedding the **rendered** notebook output of cells (embedding them in documentation we write) and even including notebooks as part of the documentation. With a few tweaks, we can make every notebook cell executable as well. See for instance https://jupyterbook.org/en/stable/interactive/thebe.html.
- Loading branch information
1 parent
98dec21
commit d31cb43
Showing
31 changed files
with
1,504 additions
and
139 deletions.
There are no files selected for viewing
This file contains 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 +1,4 @@ | ||
_build | ||
.jupyter_cache | ||
jupyter_execute | ||
source/reference/**/api |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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,5 @@ | ||
{{ objname | escape | underline}} | ||
|
||
.. currentmodule:: {{ module }} | ||
|
||
.. auto{{ objtype }}:: {{ objname }} |
This file contains 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,5 @@ | ||
{{ objname | escape | underline}} | ||
|
||
.. currentmodule:: {{ module }} | ||
|
||
.. auto{{ objtype }}:: {{ objname }} |
This file contains 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,5 @@ | ||
{{ objname | escape | underline}} | ||
|
||
.. currentmodule:: {{ module }} | ||
|
||
.. auto{{ objtype }}:: {{ objname }} |
This file contains 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 @@ | ||
# Concepts |
This file contains 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 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 @@ | ||
# Examples |
This file contains 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 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,33 @@ | ||
--- | ||
file_format: mystnb | ||
kernelspec: | ||
name: python3 | ||
display_name: Python 3 | ||
mystnb: | ||
execution_mode: cache | ||
--- | ||
|
||
# Quick Start | ||
|
||
```{todo} | ||
Write the quick start. | ||
``` | ||
|
||
```{code-cell} | ||
import sparrow_py as kt | ||
kt.init_session() | ||
content = "\n".join( | ||
[ | ||
"time,key,m,n", | ||
"1996-12-19T16:39:57-08:00,A,5,10", | ||
"1996-12-19T16:39:58-08:00,B,24,3", | ||
"1996-12-19T16:39:59-08:00,A,17,6", | ||
"1996-12-19T16:40:00-08:00,A,,9", | ||
"1996-12-19T16:40:01-08:00,A,12,", | ||
"1996-12-19T16:40:02-08:00,A,,", | ||
] | ||
) | ||
source = kt.sources.CsvSource("time", "key", content) | ||
source.run().to_pandas() | ||
``` |
This file contains 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,10 @@ | ||
# Results | ||
|
||
```{eval-rst} | ||
.. currentmodule:: sparrow_py | ||
.. autosummary:: | ||
:toctree: api/ | ||
Result | ||
``` |
This file contains 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,11 @@ | ||
# Sources | ||
|
||
```{eval-rst} | ||
.. currentmodule:: sparrow_py.sources | ||
.. autosummary:: | ||
:toctree: api/ | ||
ArrowSource | ||
CsvSource | ||
``` |
22 changes: 22 additions & 0 deletions
22
sparrow-py/docs/source/reference/timestream/aggregation.md
This file contains 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,22 @@ | ||
# Aggregation | ||
|
||
Timestream aggregations are: | ||
|
||
Cumulative: | ||
They reflect all values up to and including the current time. | ||
Grouped: | ||
They reflect the values for each entity separately. | ||
Windowed: | ||
They reflect the values within a specific [window](../windows.md). | ||
|
||
```{eval-rst} | ||
.. currentmodule:: sparrow_py | ||
.. autosummary:: | ||
:toctree: api/ | ||
Timestream.sum | ||
Timestream.first | ||
Timestream.last | ||
Timestream.collect | ||
``` |
This file contains 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,18 @@ | ||
# Arithmetic | ||
|
||
```{eval-rst} | ||
.. currentmodule:: sparrow_py | ||
.. autosummary:: | ||
:toctree: api/ | ||
Timestream.__add__ | ||
Timestream.__radd__ | ||
Timestream.__sub__ | ||
Timestream.__rsub__ | ||
Timestream.__mul__ | ||
Timestream.__rmul__ | ||
Timestream.__truediv__ | ||
Timestream.__rtruediv__ | ||
Timestream.neg | ||
``` |
This file contains 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,17 @@ | ||
# Comparison | ||
|
||
Comparison operations produce boolean Timestreams. | ||
|
||
```{eval-rst} | ||
.. currentmodule:: sparrow_py | ||
.. autosummary:: | ||
:toctree: api/ | ||
Timestream.eq | ||
Timestream.ne | ||
Timestream.__gt__ | ||
Timestream.__ge__ | ||
Timestream.__lt__ | ||
Timestream.__le__ | ||
``` |
This file contains 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,11 @@ | ||
# Execution | ||
|
||
```{eval-rst} | ||
.. currentmodule:: sparrow_py | ||
.. autosummary:: | ||
:toctree: api/ | ||
Timestream.preview | ||
Timestream.run | ||
``` |
This file contains 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,28 @@ | ||
# Timestream | ||
|
||
```{todo} | ||
- [ ] Expand the `Arg` type alias in timestreams accordingly. | ||
``` | ||
|
||
```{eval-rst} | ||
.. currentmodule:: sparrow_py | ||
.. autoclass:: Timestream | ||
:members: | ||
:noindex: | ||
:autosummary: | ||
:autosummary-nosignatures: | ||
``` | ||
|
||
```{toctree} | ||
:hidden: | ||
:maxdepth: 3 | ||
aggregation | ||
arithmetic | ||
comparison | ||
execution | ||
logical | ||
misc | ||
records | ||
``` |
This file contains 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,12 @@ | ||
# Logical | ||
|
||
```{eval-rst} | ||
.. currentmodule:: sparrow_py | ||
.. autosummary:: | ||
:toctree: api/ | ||
Timestream.and_ | ||
Timestream.or_ | ||
Timestream.not_ | ||
``` |
Oops, something went wrong.