-
Notifications
You must be signed in to change notification settings - Fork 72
Documentation Restructure #142
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
29 commits
Select commit
Hold shift + click to select a range
41bb295
:wastebasket: Remove all files from docs/wiki
pavithraes be67c62
:sparkles: Add initial restructured files and folders
pavithraes f0d021b
:broom: Lint and format docs
pavithraes 5a4a42e
:memo: Split How to Write Adpaters
pavithraes 1c920bb
:memo: Move graph_info from how-to to api-reference
pavithraes b4f4774
:memo: Remove release notes from sidebar
pavithraes 9573bd8
:broom: Fix Local-Development-Setup file extension
pavithraes d9c434a
:broom: Fix typo in TOC
pavithraes f919430
Apply suggestions from code review
pavithraes 229c5ff
:memo: update toc in stats node api ref
pavithraes 29e209b
:repeat: Merge main branch
pavithraes 27d2fbe
:memo: Update Home.md
pavithraes 4a78dd2
Rename a page, add some copy, fix code formatting
melissawm 5d4d865
Rename Glossary file and fix reference
melissawm 4ffc649
Fix reference to docs folder in footer
melissawm 8ba9c7e
Fix CSP capitalization and formatting for code display.
melissawm c770bc0
Add installation instructions with conda for Linux and Mac
melissawm 12827ae
Change typing notation for consistency, add note about notation
melissawm 64e0a65
Merge 'main' into pavithraes/docs-restructure
pavithraes 7573d10
Add more terms to the Glossary
pavithraes 9a14d23
Fix linting errors
pavithraes 599fff5
Update historical buffers examples
robambalu 5be0393
placate the mdformat gds
robambalu 205db20
:sparkles: Updates from code review
pavithraes ed4c93b
Remove Caching from sidebar
pavithraes 105681b
Update headings for base nodes and adapaters API references
pavithraes 5a5758d
Update the roadmap
pavithraes 1c444cf
Fix wording in roadmap
pavithraes 7894f05
Merge branch 'main' into pavithraes/docs-restructure
pavithraes 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 was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,62 +1,34 @@ | ||
| `csp` ("Composable Stream Processing") is a functional-like reactive | ||
| language that makes time-series stream processing simple to do. The | ||
| main reactive engine is a C++ based engine which has been exposed to | ||
| python ( other languages may optionally be extended in future versions | ||
| ). `csp` applications define a connected graph of components using a | ||
| declarative language (which is essentially python). Once a graph is | ||
| constructed it can be run using the C++ engine. Graphs are composed of | ||
| some number of "input" adapters, a set of connected calculation "nodes" | ||
| and at the end sent off to "output" adapters. Inputs as well as the | ||
| engine can be seamlessly run in simulation mode using historical input | ||
| adapters or in realtime mode using realtime input adapters. | ||
| <picture> | ||
| <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/Point72/csp/main/docs/img/csp-light.png"> | ||
| <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/Point72/csp/main/docs/img/csp-dark.png"> | ||
| <img alt="CSP logo mark - text will be black in light color mode and white in dark color mode." width="50%"/> | ||
| </picture> | ||
|
|
||
| # Contents | ||
| CSP (Composable Stream Processing) is a library for high-performance real-time event stream processing in Python. | ||
|
|
||
| - [0. Introduction](https://github.com/Point72/csp/wiki/0.-Introduction) | ||
| - [1. Generic Nodes (csp.baselib)](<https://github.com/Point72/csp/wiki/1.-Generic-Nodes-(csp.baselib)>) | ||
| - [2. Math Nodes (csp.math)](<https://github.com/Point72/csp/wiki/2.-Math-Nodes-(csp.math)>) | ||
| - [3. Statistics Nodes (csp.stats)](<https://github.com/Point72/csp/wiki/3.-Statistics-Nodes-(csp.stats)>) | ||
| - [4. Random Time Series Generation](<https://github.com/Point72/csp/wiki/4.-Random-Time-Series-Generation-(csp.random)>) | ||
| - [5. Adapters](https://github.com/Point72/csp/wiki/5.-Adapters) | ||
| - [6. Dynamic Graphs](https://github.com/Point72/csp/wiki/6.-Dynamic-Graphs) | ||
| - [7. csp.Struct](https://github.com/Point72/csp/wiki/7.-csp.Struct) | ||
| - [8. Profiler](https://github.com/Point72/csp/wiki/8.-Profiler) | ||
| - [9. Caching](https://github.com/Point72/csp/wiki/9.-Caching) | ||
| ## Key Features | ||
|
|
||
| # Installation | ||
| - **Powerful C++ Engine:** Execute the graph using CSP's C++ Graph Processing Engine | ||
| - **Simulation (i.e., offline) mode:** Test workflows on historical data and quickly move to real-time data in deployment | ||
| - **Infrastructure-agnostic:** Connect to any data format or storage database, using built-in (Parquet, Kafka, etc.) or custom adapters | ||
| - **Highly-customizable:** Write your own input and output adapters for any data/storage formats, and real-time adapters for specific workflows | ||
| - **PyData interoperability:** Use your favorite libraries from the Scientific Python Ecosystem for numerical and statistical computations | ||
| - **Functional/declarative style:** Write concise and composable code for stream processing by building graphs in Python | ||
|
|
||
| We ship binary wheels to install `csp` on MacOS and Linux via `pip`: | ||
| <!-- ## Applications --> | ||
|
|
||
| ```bash | ||
| pip install csp | ||
| ``` | ||
| ## Get Started | ||
|
|
||
| Other platforms will need to see the instructions to [build `csp` from | ||
| source](https://github.com/Point72/csp/wiki/98.-Building-From-Source). | ||
| - Tutorials: Go through the introductory tutorials to learn the basics of CSP | ||
| - Examples: Check out various features and use cases | ||
|
|
||
| We plan to create conda packages on conda-forge and ship binaries for Windows in | ||
| the near future. | ||
| Tip: Find relevant docs with GitHub’s search function, use `repo:Point72/csp type:wiki <search terms>` to search the documentation Wiki Pages. | ||
|
|
||
| # Contributing | ||
| ## Community | ||
|
|
||
| Contributions are welcome on this project. We distribute under the terms of the [Apache 2.0 license](https://github.com/Point72/csp/blob/main/LICENSE). | ||
| - Developer guide: Learn to build and develop CSP locally | ||
| - Roadmap: Read what’s the development team is excited about | ||
|
|
||
| For **bug reports** or **small feature requests**, please open an issue on our [issues page](https://github.com/Point72/csp/issues). | ||
| ## License | ||
|
|
||
| For **questions** or to discuss **larger changes or features**, please use our [discussions page](https://github.com/Point72/csp/discussions). | ||
|
|
||
| For **contributions**, please see our [developer documentation](https://github.com/Point72/csp/wiki/99.-Developer). We have `help wanted` and `good first issue` tags on our issues page, so these are a great place to start. | ||
|
|
||
| For **documentation updates**, make PRs that update the pages in `/docs/wiki`. The documentation is pushed to the GitHub wiki automatically through a GitHub workflow. Note that direct updates to this wiki will be overwritten. | ||
|
|
||
| # Roadmap | ||
|
|
||
| We do not have a formal roadmap, but we're happy to discuss features, improvements, new adapters, etc, in our [discussions area](https://github.com/Point72/csp/discussions). Here are some high level items we hope to accomplish in the next few months: | ||
|
|
||
| - Support `clang` compiler ([#33](https://github.com/Point72/csp/issues/33)) | ||
| - Redis Pub/Sub Adapter with [Redis-plus-plus](https://github.com/sewenew/redis-plus-plus) ([#61](https://github.com/Point72/csp/issues/61)) | ||
| - C++-based websocket adapter | ||
| - Slack Adapter with [python-slack-sdk](https://github.com/slackapi/python-slack-sdk) ([#17](https://github.com/Point72/csp/issues/17)) | ||
| - `csp-gateway`: Application development framework, built with [FastAPI](https://fastapi.tiangolo.com) and [Perspective](https://github.com/finos/perspective). This is a library we have built internally at Point72 on top of `csp` that we hope to open source later in 2024. It allows for easier construction of modular `csp` applications, along with a pluggable REST/WebSocket API and interactive UI. | ||
| - Interactive graph viewer, both standalone and viewable in Jupyter (with something like [ipydagred3](https://github.com/timkpaine/ipydagred3)) | ||
| - Sympy integration via [`lambdify`](https://docs.sympy.org/latest/modules/utilities/lambdify.html) ([#59](https://github.com/Point72/csp/issues/59)) | ||
| CSP is licensed under the Apache 2.0 license. See the [LICENSE](https://github.com/Point72/csp/blob/main/LICENSE) file for details. | ||
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 @@ | ||
| _This wiki is autogenerated. To made updates, open a PR against the original source file in [`doc/wiki`](https://github.com/Point72/csp/tree/main/docs/wiki)._ | ||
melissawm marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
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,62 @@ | ||
| <!-- | ||
| This sidebar is displayed on the GitHub Wiki section instead of the default sidebar. | ||
| Notes for editors: | ||
| - Ensure links don't have the file extensions (i.e., `.md`) | ||
| - Do not use colons (':') in page titles, they don't render properly as links in the sidebar | ||
| - Use only the filenames in this page (without the filepath and file extension) | ||
| --> | ||
|
|
||
| **[Home](Home)** | ||
|
|
||
| **Get Started (Tutorials)** | ||
|
|
||
| - [Installation](Installation) | ||
| - [First steps](First-Steps) | ||
|
|
||
| <!-- Add more pages when ready --> | ||
|
|
||
| **Concepts** | ||
|
|
||
| - [CSP Node](CSP-Node) | ||
| - [CSP Graph](CSP-Graph) | ||
| - [Historical Data](Historical-Data) | ||
| - [Execution Modes](Execution-Modes) | ||
| - [Adapters](Adapters) | ||
| - [Caching](Caching) | ||
|
|
||
| **How-to guides** | ||
|
|
||
| - [Use Statistical Nodes](Use-Statistical-Nodes) | ||
| - Use Adapters (coming soon) | ||
| - [Add Cycles in Graphs](Add-Cycles-in-Graphs) | ||
| - [Create Dynamic Baskets](Create-Dynamic-Baskets) | ||
| - Write Adapters: | ||
| - [Write Historical Input Adapters](Write-Historical-Input-Adapters) | ||
| - [Write Realtime Input Adapters](Write-Realtime-Input-Adapters) | ||
| - [Write Output Adapters](Write-Output-Adapters) | ||
| - [Profile CSP Code](Profile-CSP-Code) | ||
|
|
||
| **References** | ||
|
|
||
| - API Reference | ||
| - [Base Nodes API](Base-Nodes-API) | ||
| - [Base Adapters API](Base-Adapters-API) | ||
| - [Math and Logic Nodes API](Math-and-Logic-Nodes-API) | ||
| - [Statistical Nodes API](Statistical-Nodes-API) | ||
| - [Functional Methods API](Functional-Methods-API) | ||
| - [Adapters (Kafka, Parquet, DBReader) API](Input-Output-Adapters-API) | ||
| - [Random Time Series Generators API](Random-Time-Series-Generators-API) | ||
| - [`csp.Struct` API](csp.Struct-API) | ||
| - [`csp.dynamic` API](csp.dynamic-API) | ||
| - [`csp.profiler` API](csp.profiler-API) | ||
| - [Examples](Examples) | ||
| - [Glossary of Terms](Glosarry) | ||
|
|
||
| **Developer Guide** | ||
|
|
||
| - [Contributing](Contribute) | ||
| - [Development Setup](Local-Development-Setup) | ||
| - [Build CSP from Source](Build-CSP-from-Source) | ||
| - [GitHub Conventions (for maintainers)](GitHub-Conventions) | ||
| - [Release Process (for maintainers)](Release-Process) | ||
| - [Roadmap](Roadmap) |
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,110 @@ | ||
| `csp.baselib` defines some generally useful adapters, which are also imported directly into the csp namespace when importing csp. | ||
|
|
||
| These are all graph-time constructs. | ||
|
|
||
| ## Table of Contents | ||
|
|
||
| - [Table of Contents](#table-of-contents) | ||
| - [`timer`](#timer) | ||
| - [`const`](#const) | ||
| - [`curve`](#curve) | ||
| - [`add_graph_output`](#add_graph_output) | ||
| - [`feedback`](#feedback) | ||
|
|
||
| ## `timer` | ||
|
|
||
| ```python | ||
| csp.timer( | ||
| interval: timedelta, | ||
| value: '~T' = True, | ||
| allow_deviation: bool = False | ||
| ) | ||
| ``` | ||
|
|
||
| This will create a repeating timer edge that will tick on the given `timedelta` with the given value (value defaults to `True`, returning a `ts[bool]`) | ||
|
|
||
| Args: | ||
|
|
||
| - **`interval`**: how often to tick value | ||
| - **`value`**: the actual value that will tick every interval (defaults to the value `True`) | ||
| - **`allow_deviation`**: When running in realtime the engine will ensure timers execute exactly when they requested on their intervals. | ||
| If your engine begins to lag, timers will still execute at the expected time "in the past" as the engine catches up | ||
| (imagine having a `csp.timer` fire every 1/2 second but the engine becomes delayed for 1 second. | ||
| By default the half seconds will still execute until time catches up to wallclock). | ||
| When `allow_deviation` is `True`, and the engine is in realtime mode, subsequent timers will always be scheduled from the current wallclock + interval, | ||
| so they won't end up lagging behind at the expensive of the timer skewing. | ||
|
|
||
| ## `const` | ||
|
|
||
| ```python | ||
| csp.const( | ||
| value: '~T', | ||
| delay: timedelta = timedelta() | ||
| ) | ||
| ``` | ||
|
|
||
| This will create an edge that ticks one time with the value provided. | ||
| By default this will tick at the start of the engine, delta can be provided to delay the tick | ||
|
|
||
| ## `curve` | ||
|
|
||
| ```python | ||
| csp.curve( | ||
| typ: 'T', | ||
| data: typing.Union[list, tuple] | ||
| ) | ||
| ``` | ||
|
|
||
| This allows you to convert a list of non-csp data into a ticking edge in csp | ||
|
|
||
| Args: | ||
|
|
||
| - **`typ`**: is the type of the value of the data of this edge | ||
| - **`data`**: is either a list of tuples of `(datetime, value)`, or a tuple of two equal-length numpy ndarrays, the first with datetimes and the second with values. | ||
| In either case, that will tick on the returned edge into the engine, and the data must be in time order. | ||
| Note that for the list of tuples case, you can also provide tuples of (timedelta, value) where timedelta will be the offset from the engine's start time. | ||
|
|
||
| ## `add_graph_output` | ||
|
|
||
| ```python | ||
| csp.add_graph_output( | ||
| key: object, | ||
| input: ts['T'], | ||
| tick_count: int = -1, | ||
| tick_history: timedelta = timedelta() | ||
| ) | ||
| ``` | ||
|
|
||
| This allows you to connect an edge as a "graph output". | ||
| All edges added as outputs will be returned to the caller from `csp.run` as a dictionary of `key: [(datetime, value)]` | ||
| (list of datetime, values that ticked on the edge) or if `csp.run` is passed `output_numpy=True`, as a dictionary of | ||
| `key: (array, array)` (tuple of two numpy arrays, one with datetimes and one with values). | ||
| See [Collecting Graph Outputs](https://github.com/Point72/csp/wiki/0.-Introduction#collecting-graph-outputs) | ||
|
|
||
| Args: | ||
|
|
||
| - **`key`**: key to return the results as from csp.run | ||
| - **`input`**: edge to connect | ||
| - **`tick_count`**: number of ticks to keep in the buffer (defaults to -1 - all ticks) | ||
| - **`tick_history`**: amount of ticks to keep by time window (defaults to keeping all history) | ||
|
|
||
| ## `feedback` | ||
|
|
||
| ```python | ||
| csp.feedback(typ) | ||
| ``` | ||
|
|
||
| `csp.feedback` is a construct that can be used to create artificial loops in the graph. | ||
| Use feedbacks in order to delay bind an input to a node in order to be able to create a loop | ||
| (think of writing a simulated exchange that takes orders in and needs to feed responses back to the originating node). | ||
|
|
||
| `csp.feedback` itself is not an edge, its a construct that allows you to access the delayed edge / bind a delayed input. | ||
|
|
||
| Args: | ||
|
|
||
| - **`typ`**: type of the edge's data to be bound | ||
|
|
||
| Methods: | ||
|
|
||
| - **`out()`**: call this method on the feedback object to get the edge which can be wired as an input | ||
| - **`bind(x: ts[object])`**: call this to bind an edge to the feedback |
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.
Uh oh!
There was an error while loading. Please reload this page.