-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from DAGWorks-Inc/initial-prototypes
V0
- Loading branch information
Showing
83 changed files
with
5,368 additions
and
9 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Triggers the workflow on push events to the main branch | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
- name: Install dependencies | ||
run: | | ||
pip install -e ".[documentation]" | ||
- name: Sphinx build | ||
run: | | ||
sphinx-build docs _build | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
# if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/initial-prototypes' }} | ||
with: | ||
publish_branch: gh-pages | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: _build/ | ||
force_orphan: true |
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 |
---|---|---|
|
@@ -5,13 +5,20 @@ name: Build Burr | |
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
branches: | ||
- main # Triggers the workflow on push events to the main branch | ||
pull_request: | ||
branches: [ "main" ] | ||
# Triggers the workflow on pull request events for any branch | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
build: | ||
|
||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
- uses: pre-commit/[email protected] | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
|
@@ -26,7 +33,7 @@ jobs: | |
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install -e . | ||
- name: Run test | ||
python -m pip install -e ".[tests]" | ||
- name: Run tests | ||
run: | | ||
python test.py | ||
python -m pytest tests |
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,32 @@ | ||
# pre-commit hooks require a user to have installed `pre-commit`: | ||
# $ brew install pre-commit | ||
# Then install the hooks within the repo: | ||
# $ cd /PATH/TO/REPO | ||
# $ pre-commit install | ||
|
||
repos: | ||
- repo: https://github.com/ambv/black | ||
rev: 23.11.0 | ||
hooks: | ||
- id: black | ||
args: [--line-length=100] | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
# ensures files are either empty or end with a blank line | ||
- id: end-of-file-fixer | ||
# sorts requirements | ||
- id: requirements-txt-fixer | ||
# valid python file | ||
- id: check-ast | ||
# isort python package import sorting | ||
- repo: https://github.com/pycqa/isort | ||
rev: '5.12.0' | ||
hooks: | ||
- id: isort | ||
args: ["--profile", "black", "--line-length=100", "--known-local-folder", "tests", "-p", "hamilton"] | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 6.1.0 | ||
hooks: | ||
- id: flake8 |
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,23 @@ | ||
[style] | ||
based_on_style = google | ||
|
||
# max characters per line | ||
COLUMN_LIMIT = 100 | ||
|
||
# Put closing brackets on a separate line, dedented, if the bracketed expression can't fit in a single line | ||
DEDENT_CLOSING_BRACKETS = true | ||
|
||
# Place each dictionary entry onto its own line. | ||
EACH_DICT_ENTRY_ON_SEPARATE_LINE = true | ||
|
||
# Join short lines into one line. E.g., single line if statements. | ||
JOIN_MULTIPLE_LINES = true | ||
|
||
# Insert a blank line before a def or class immediately nested within another def or class | ||
BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF = true | ||
|
||
# Split before arguments if the argument list is terminated by a comma. | ||
SPLIT_ARGUMENTS_WHEN_COMMA_TERMINATED = true | ||
|
||
# If an argument / parameter list is going to be split, then split before the first argument | ||
SPLIT_BEFORE_FIRST_ARGUMENT = true |
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,21 @@ | ||
Copyright (c) 2023-2023 DAGWorks Inc. | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted | ||
(subject to the limitations in the disclaimer below) provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following | ||
disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following | ||
disclaimer in the documentation and/or other materials provided with the distribution. | ||
* Neither the name of Stitch Fix, DAGWorks, nor the names of its contributors may be used to endorse or promote products derived | ||
from this software without specific prior written permission. | ||
|
||
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY | ||
THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | ||
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
POSSIBILITY OF SUCH DAMAGE. |
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,2 +1,42 @@ | ||
# burr | ||
Make Hamilton go Burr... | ||
# Burr | ||
|
||
## What is Burr? | ||
|
||
Burr is a state machine for data/AI projects. You can (and should!) use it for anything where managing state can be hard. Hint: managing state | ||
is always hard! | ||
|
||
You can find the documentation [here](https://studious-spork-n8kznlw.pages.github.io/). | ||
## What can you do with Burr? | ||
|
||
Burr can be used for a variety of applications. Burr can build a state machine to orchestrate, express, and track: | ||
|
||
1. [A gpt-like chatbot](examples/gpt) | ||
2. [A machine learning pipeline](examples/ml_training) | ||
3. [A trading simulation](examples/simulation) | ||
|
||
And a lot more! | ||
|
||
Using hooks and other integrations you can (a) integrate with any of your favorite vendors (LLM observability, storage, etc...), and | ||
(b) build custom actions that delegate to your favorite libraries. | ||
|
||
Bur will *not* tell you how to build your models, how to query APIs, or how to manage your data. It will help you tie all these together | ||
in a way that scales with your needs and makes following the logic of your system easy. | ||
|
||
|
||
## Why the name Burr? | ||
|
||
Burr is named after Aaron Burr, founding father, third VP of the United States, and murderer/arch-nemesis of Alexander Hamilton. | ||
We imagine a world in which Burr and Hamilton lived in harmony and saw through their differences. We originally | ||
built Burr as a _harness_ to handle state between executions of Hamilton DAGs, | ||
but realized that it has a wide array of applications and decided to release it. | ||
|
||
# Getting Started | ||
|
||
To get started, install from `pypi`, using your favorite package manager: | ||
|
||
``` | ||
pip install burr | ||
``` | ||
|
||
Next, see the documentation for [getting started](https://studious-spork-n8kznlw.pages.github.io/getting_started/simple-example.html), and follow the example. | ||
Then read through some of the concepts and write your own application! |
Empty file.
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,16 @@ | ||
from burr.core.action import Action, Condition, Result, action, default, expr, when | ||
from burr.core.application import Application, ApplicationBuilder | ||
from burr.core.state import State | ||
|
||
__all__ = [ | ||
"action", | ||
"Action", | ||
"Application", | ||
"ApplicationBuilder", | ||
"Condition", | ||
"default", | ||
"expr", | ||
"Result", | ||
"State", | ||
"when", | ||
] |
Oops, something went wrong.