Skip to content

Commit

Permalink
Merge pull request #37 from krish-adi/migrate-to-react-flow
Browse files Browse the repository at this point in the history
migrate to version 1.0.0
  • Loading branch information
krish-adi authored Jan 6, 2025
2 parents 04ddebb + 2078502 commit 1d3dfb0
Show file tree
Hide file tree
Showing 155 changed files with 12,337 additions and 1,567 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Barfi Project
.ruff_cache

# General
.DS_Store
.AppleDouble
Expand Down Expand Up @@ -115,7 +118,7 @@ ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
Expand Down
1 change: 0 additions & 1 deletion .python-version

This file was deleted.

25 changes: 0 additions & 25 deletions .readthedocs.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"makefile.configureOnOpen": false
}
82 changes: 82 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

Release dates are in YYYY-MM-DD

## [1.0.0] - 2025-01-05

Following are major changes from v0. For using >= v1.0.0 your codebase needs to be adopted. Check for the latest documentation [here](https://barfi.ai/docs)

- `st_flow` is the new streamlit ui which replaces `st_barfi`. Refer to the new API to add interfaces and options [here](https://barfi.ai/docs/st_flow)
- All objects are typed as dataclasses and not as `dict`. This applies to `Block`, `FlowSchema`, `SchemaManager`, `ComputeEngine` and the return from `st_flow` which is `StreamlitFlowResponse`.
- `FlowSchema` is the object that now contains all the information about the schemasm the connections and blocks referred.
- `barfi.flow.block` now contains all the `Block` module scripts. Refer to the new API to add interfaces and options [here](https://barfi.ai/docs/block)
- `barfi.flow.schema` contains the `SchemaManager` which will be used to save, load, update, delete schemas.Refer to the new API to add interfaces and options [here](https://barfi.ai/docs/schema_manager)
- `barfi.flow.compute` contains the `ComputeEngine` which will be used to execute the `FlowSchema`. Refer to the new API to add interfaces and options [here](https://barfi.ai/docs/compute_engine)
- This version also introduces some types, and will henceforth the library will be typed. Refer to the types [here](https://barfi.ai/docs/types)
- The UI Flow Editor has now been migrated to use React instead of Vue. And, makes use of ReactFlow as the rendering component for the flows.

## [0.7.0] - 2022-08-30

- Add Block state to store data private to the block. Using block.get_state('key'), block.set_state('key').
- Block state also stores execution status and errors. Using block.get_state('info'), block.set_state('info'). Note: 'info' is a reserved key.
- When a block fails on its compute function, its descendants are skipped and the rest of the blocks are computed.
- Add delete schema function. (@zabrewer)

## [0.6.1] - 2022-07-25

- Fix base_blocks_list passed to the compute engine.

## [0.6.0] - 2022-07-19

- Add option to categories the Blocks with a category in a sub-menu in the context menu on right-click>add-node.

## [0.5.0] - 2022-03-19

- Add Block option.
- Add tests for Block option and update tests for interfaces.
- Add get, set for option to be used inside compute_engine and update compute_engine to handle option value from frontend

## [0.4.4] - 2022-03-16

- Change barfo.Block method references from `calculate` to `compute`

## [0.4.3] - 2022-03-15

- Change the frontend BlockEditor.vue to make use of listeners to make the unique names of the Blocks.

## [0.4.2] - 2022-02-27

- Change add_input and add_output for the Block. TO provide ease of linting and checks.
- Change the structure of the compute engine.
- Add unittest
- Add documentation and structure to the docs to be deployed to readthedocs.org

## [0.4.2] - 2022-02-27

- Change add_input and add_output for the Block. TO provide ease of linting and checks.
- Change the structure of the compute engine.
- Add unittest
- Add documentation and structure to the docs to be deployed to readthedocs.org

## [0.4.0] - 2022-02-27

- Implement compute engine checks
- Change menu for computation, load, save of schema

## [0.2.0] - 2022-02-13

- ComputeEnginge class, with execute method
- Client has Menu to Save and List schemas into a db.
- Functions for managing save/load schemas

## [0.1.0] - 2022-02-12

- Initial release.
- Contains Block-Builder class
- Contains the Compute engine function
- Contains the frontend-client to use as Streamlit component - st_barfi()
68 changes: 0 additions & 68 deletions CHANGELOG.md

This file was deleted.

38 changes: 38 additions & 0 deletions DEVELOPER
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Developer Notes

Following are the developer notes on getting started to contributing to the development of Barfi.

## Requirements

### Development Environment

- Clone this repo to a local folder.
- Python version is managed by [Pyenv](https://github.com/pyenv/pyenv): Base Python version currently is: `3.8.19`
- Python dependencies and packaging is done using [Poetry](https://python-poetry.org/).
- Frontend GUI environement is managed using [NVM](https://github.com/nvm-sh/nvm). Base Node version currently is: `v18.18.2`
- If you are using a Mac, get started by installing dependencies using [Homebrew](https://brew.sh/), and continue to the following:

- Install Pyenv and Python using: `brew install pyenv` -> `pyenv install 3.8.19`
- Find the location where `Python 3.8.19` install using -> `pyenv which python`
- Install Poetry and activate environement: `brew install poetry` -> `cd <barfi-git-repo>` -> `poetry env use <python-3.8.19-location>` -> `poetry install`
- Install NVM using [these instructions](https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating) and then Node using `nvm install 18.18.2` -> `nvm use 18.18.2`.
- Install ui depdendencies by: `cd ui-flow` -> `npm install`

## Quickstart for development

- To run the ui-flow in local development mode set `RELEASE = True` in `src/barfi/config.py`
- Open 2 terminals, one for starting the Python env and the other for the UI env.
- In terminal 1: `make serve-ui`
- In terminal 2: `make serve-barfi`

## Checklist for building and uploading new package

- [ ] Update Dcoumentation if required.
- [ ] Run tests using `make tests`
- [ ] Build the ui-flow: `cd build-ui`
- [ ] Check `RELEASE = True` is set in `src/barfi/config.py`
- [ ] Check linting and formatting: `make ruff`
- [ ] Bump version number as required in `pyproject.toml`
- [ ] Update CHANGELOG
- [ ] Build and upload package using `make build-upload`
- [ ] Commit the repository with the version number example: `v 1.0.0`
76 changes: 0 additions & 76 deletions Developer.md

This file was deleted.

Loading

0 comments on commit 1d3dfb0

Please sign in to comment.