Spaces:
Sleeping
Sleeping
Remove docs. "lynxkite.core" is now "lynxkite_core".
Browse files- .github/workflows/test.yaml +8 -19
- docs/assets/lynxkite-icon-white.png +0 -0
- docs/contributing.md +0 -56
- docs/guides/analytics.md +0 -82
- docs/guides/plugins.md +0 -283
- docs/guides/quickstart.md +0 -27
- docs/index.md +0 -5
- docs/license.md +0 -11
- docs/lynxkite-core.md +0 -6
- docs/lynxkite-graph-analytics.md +0 -6
- docs/reference/lynxkite-core/executors/one_by_one.md +0 -1
- docs/reference/lynxkite-core/executors/simple.md +0 -1
- docs/reference/lynxkite-core/ops.md +0 -1
- docs/reference/lynxkite-core/workspace.md +0 -1
- docs/reference/lynxkite-graph-analytics/core.md +0 -1
- docs/reference/lynxkite-graph-analytics/operations.md +0 -3
- docs/stylesheets/extra.css +0 -8
- examples/Cheminformatics/chembl_tools.py +1 -1
- examples/Cheminformatics/cheminfo_tools.py +1 -1
- examples/Cheminformatics/rcsb_api.py +1 -1
- lynxkite-bio/src/lynxkite_bio/bionemo_ops.py +1 -1
- lynxkite-bio/src/lynxkite_bio/k8s.py +5 -5
- lynxkite-bio/src/lynxkite_bio/llm.py +1 -1
- lynxkite-bio/src/lynxkite_bio/nims.py +1 -1
- lynxkite-bio/src/lynxkite_bio/rdkit.py +1 -1
- lynxkite-lynxscribe/src/lynxkite_lynxscribe/llm_ops.py +2 -2
- lynxkite-lynxscribe/src/lynxkite_lynxscribe/lynxscribe_ops.py +6 -6
- lynxkite-lynxscribe/tests/test_llm_ops.py +2 -2
- pyproject.toml +2 -2
- uv.lock +0 -0
.github/workflows/test.yaml
CHANGED
|
@@ -15,39 +15,26 @@ jobs:
|
|
| 15 |
- name: Set up Python
|
| 16 |
run: uv python install
|
| 17 |
|
| 18 |
-
# - name: Debug ty issue
|
| 19 |
-
# run: |
|
| 20 |
-
# uv pip install ty
|
| 21 |
-
# uv pip list
|
| 22 |
-
# uv run python -m ty check
|
| 23 |
-
|
| 24 |
- name: Install dependencies
|
| 25 |
run: |
|
| 26 |
eval `ssh-agent -s`
|
| 27 |
ssh-add - <<< '${{ secrets.LYNXSCRIBE_DEPLOY_KEY }}'
|
| 28 |
uv venv
|
| 29 |
. .venv/bin/activate
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
-e lynxkite-app/[dev] \
|
| 33 |
-
-e lynxkite-graph-analytics/[dev] \
|
| 34 |
-
-e lynxkite-bio \
|
| 35 |
-
-e lynxkite-lynxscribe/ \
|
| 36 |
-
-e lynxkite-pillow-example/
|
| 37 |
|
| 38 |
- name: Run pre-commits
|
| 39 |
run: |
|
| 40 |
-
|
| 41 |
-
uv run pre-commit run --all-files
|
| 42 |
|
| 43 |
- name: Run Python unittests
|
| 44 |
run: |
|
| 45 |
-
|
| 46 |
|
| 47 |
- name: Build the documentation
|
| 48 |
run: |
|
| 49 |
-
|
| 50 |
-
uv run mkdocs build
|
| 51 |
|
| 52 |
- uses: actions/setup-node@v4
|
| 53 |
with:
|
|
@@ -61,7 +48,9 @@ jobs:
|
|
| 61 |
|
| 62 |
- name: Run Playwright tests
|
| 63 |
run: |
|
| 64 |
-
|
|
|
|
|
|
|
| 65 |
|
| 66 |
- uses: actions/upload-artifact@v4
|
| 67 |
name: Upload playwright report
|
|
|
|
| 15 |
- name: Set up Python
|
| 16 |
run: uv python install
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
- name: Install dependencies
|
| 19 |
run: |
|
| 20 |
eval `ssh-agent -s`
|
| 21 |
ssh-add - <<< '${{ secrets.LYNXSCRIBE_DEPLOY_KEY }}'
|
| 22 |
uv venv
|
| 23 |
. .venv/bin/activate
|
| 24 |
+
echo PATH=$PATH >> $GITHUB_ENV
|
| 25 |
+
uv sync
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
- name: Run pre-commits
|
| 28 |
run: |
|
| 29 |
+
pre-commit run --all-files
|
|
|
|
| 30 |
|
| 31 |
- name: Run Python unittests
|
| 32 |
run: |
|
| 33 |
+
pytest
|
| 34 |
|
| 35 |
- name: Build the documentation
|
| 36 |
run: |
|
| 37 |
+
mkdocs build
|
|
|
|
| 38 |
|
| 39 |
- uses: actions/setup-node@v4
|
| 40 |
with:
|
|
|
|
| 48 |
|
| 49 |
- name: Run Playwright tests
|
| 50 |
run: |
|
| 51 |
+
cd lynxkite-app/web
|
| 52 |
+
npm run build
|
| 53 |
+
npm run test
|
| 54 |
|
| 55 |
- uses: actions/upload-artifact@v4
|
| 56 |
name: Upload playwright report
|
docs/assets/lynxkite-icon-white.png
DELETED
|
Binary file (3.19 kB)
|
|
|
docs/contributing.md
DELETED
|
@@ -1,56 +0,0 @@
|
|
| 1 |
-
# Contributing
|
| 2 |
-
|
| 3 |
-
The LynxKite 2000:MM repository lives at
|
| 4 |
-
[https://github.com/lynxkite/lynxkite-2000](https://github.com/lynxkite/lynxkite-2000). Bug reports, feature requests,
|
| 5 |
-
and pull requests are welcome!
|
| 6 |
-
|
| 7 |
-
## Project structure
|
| 8 |
-
|
| 9 |
-
- `lynxkite-core`: Core types and utilities. Depend on this lightweight package if you are writing LynxKite plugins.
|
| 10 |
-
- `lynxkite-app`: The LynxKite web application. Install some plugins then run this to use LynxKite.
|
| 11 |
-
- `lynxkite-graph-analytics`: Graph analytics plugin. The classical LynxKite experience!
|
| 12 |
-
- `lynxkite-pillow`: A simple example plugin.
|
| 13 |
-
- `lynxkite-lynxscribe`: A plugin for building and running LynxScribe applications.
|
| 14 |
-
- `lynxkite-bio`: Bioinformatics additions for LynxKite Graph Analytics.
|
| 15 |
-
- `docs`: User-facing documentation. It's shared between all packages.
|
| 16 |
-
|
| 17 |
-
## Development setup
|
| 18 |
-
|
| 19 |
-
Install everything like this:
|
| 20 |
-
|
| 21 |
-
```bash
|
| 22 |
-
uv venv
|
| 23 |
-
source .venv/bin/activate
|
| 24 |
-
uvx pre-commit install
|
| 25 |
-
uv sync
|
| 26 |
-
```
|
| 27 |
-
|
| 28 |
-
This also builds the frontend, hopefully very quickly. To run it:
|
| 29 |
-
|
| 30 |
-
```bash
|
| 31 |
-
cd examples
|
| 32 |
-
lynxkite
|
| 33 |
-
```
|
| 34 |
-
|
| 35 |
-
If you also want to make changes to the frontend with hot reloading:
|
| 36 |
-
|
| 37 |
-
```bash
|
| 38 |
-
cd lynxkite-app/web
|
| 39 |
-
npm run dev
|
| 40 |
-
```
|
| 41 |
-
|
| 42 |
-
## Executing tests
|
| 43 |
-
|
| 44 |
-
```bash
|
| 45 |
-
pytest # Runs all backend unit tests.
|
| 46 |
-
pytest lynxkite-core # Runs tests for one package.
|
| 47 |
-
cd lynxkite-app/web && npm run test # Runs frontend tests.
|
| 48 |
-
```
|
| 49 |
-
|
| 50 |
-
## Documentation
|
| 51 |
-
|
| 52 |
-
To work on the documentation:
|
| 53 |
-
|
| 54 |
-
```bash
|
| 55 |
-
mkdocs serve
|
| 56 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
docs/guides/analytics.md
DELETED
|
@@ -1,82 +0,0 @@
|
|
| 1 |
-
# Graph analytics & data science
|
| 2 |
-
|
| 3 |
-
Install LynxKite with the graph analytics package:
|
| 4 |
-
|
| 5 |
-
```bash
|
| 6 |
-
pip install lynxkite lynxkite-graph-analytics
|
| 7 |
-
```
|
| 8 |
-
|
| 9 |
-
Run LynxKite in your data directory:
|
| 10 |
-
|
| 11 |
-
```bash
|
| 12 |
-
cd lynxkite-data
|
| 13 |
-
lynxkite
|
| 14 |
-
```
|
| 15 |
-
|
| 16 |
-
LynxKite by default runs on port 8000, so you can access it in your browser at
|
| 17 |
-
[http://localhost:8000](http://localhost:8000).
|
| 18 |
-
To run it on a different port, set the `PORT` environment variable (e.g., `PORT=8080 lynxkite`).
|
| 19 |
-
|
| 20 |
-
## Using a CUDA GPU
|
| 21 |
-
|
| 22 |
-
To make full use of your GPU, install the `lynxkite-graph-analytics` package with GPU support.
|
| 23 |
-
|
| 24 |
-
```bash
|
| 25 |
-
pip install lynxkite 'lynxkite-graph-analytics[gpu]'
|
| 26 |
-
```
|
| 27 |
-
|
| 28 |
-
And start it with the cuGraph backend for NetworkX:
|
| 29 |
-
|
| 30 |
-
```bash
|
| 31 |
-
NX_CUGRAPH_AUTOCONFIG=true lynxkite
|
| 32 |
-
```
|
| 33 |
-
|
| 34 |
-
## Directory browser
|
| 35 |
-
|
| 36 |
-
When you open the LynxKite web interface, you arrive in the directory browser. You see
|
| 37 |
-
the files and directories in your data directory — if you just created it, it will be empty.
|
| 38 |
-
|
| 39 |
-
You can create workspaces, [code files](plugins.md), and folders in the directory browser.
|
| 40 |
-
|
| 41 |
-
## Workspaces
|
| 42 |
-
|
| 43 |
-
A LynxKite workspace is the place where you build a data science pipeline.
|
| 44 |
-
Pipelines are built from boxes, which have inputs and outputs that can be connected to each other.
|
| 45 |
-
|
| 46 |
-
To place a box, click anywhere in the workspace. This opens a search menu where you can
|
| 47 |
-
find the box you want to add.
|
| 48 |
-
|
| 49 |
-
## Importing your data
|
| 50 |
-
|
| 51 |
-
To import CSV, Parquet, JSON, and Excel files, you can simply drag and drop them into the LynxKite workspace.
|
| 52 |
-
This will upload the file to the server and add an "Import file" box to the workspace.
|
| 53 |
-
|
| 54 |
-
You can also create "Import file" boxes manually and type the path to the file.
|
| 55 |
-
You can either use an absolute path, or a relative path from the data directory.
|
| 56 |
-
(Where you started LynxKite.)
|
| 57 |
-
|
| 58 |
-
## Neural network design
|
| 59 |
-
|
| 60 |
-
The graph analytics package includes two environments, _"LynxKite Graph Analytics"_, and _"PyTorch model"_.
|
| 61 |
-
Use the dropdown in the top right corner to switch to the "PyTorch model" environment.
|
| 62 |
-
This environment allows you to define neural network architectures visually.
|
| 63 |
-
|
| 64 |
-
The important parts of a neural network definition are:
|
| 65 |
-
|
| 66 |
-
- **Inputs**: These boxes stand for the inputs. You will connect them to actual data in the workspace that
|
| 67 |
-
uses this model.
|
| 68 |
-
- **Layers**: The heart of the model. Use the _"Repeat"_ box looping back from the output of a layer to the
|
| 69 |
-
input of an earlier layer to repeat a set of layers.
|
| 70 |
-
- **Outputs**: These boxes mark the place in the data flow that holds the predictions of the model.
|
| 71 |
-
- **Loss**: Build the loss computation after the output box. This part is only used during training.
|
| 72 |
-
- **Optimizer**: The result of the loss computation goes into the optimizer. Training is partially configured
|
| 73 |
-
in the optimizer box, partially in the training box in the workspace that uses the model.
|
| 74 |
-
|
| 75 |
-
Once the model is defined, you can use it in other workspaces.
|
| 76 |
-
|
| 77 |
-
- Load it with the _"Define model"_ box.
|
| 78 |
-
- Train it with the _"Train model"_ box.
|
| 79 |
-
- Generate predictions with the _"Model inference"_ box.
|
| 80 |
-
|
| 81 |
-
See the [_Model definition_ and _Model use_ workspaces](https://github.com/lynxkite/lynxkite-2000/tree/main/examples)
|
| 82 |
-
for a practical example.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
docs/guides/plugins.md
DELETED
|
@@ -1,283 +0,0 @@
|
|
| 1 |
-
# Plugin development
|
| 2 |
-
|
| 3 |
-
Plugins can provide additional operations for an existing LynxKite environment,
|
| 4 |
-
and they can also provide new environments.
|
| 5 |
-
|
| 6 |
-
## Creating a new plugin
|
| 7 |
-
|
| 8 |
-
`.py` files inside the LynxKite data directory are automatically imported each time a
|
| 9 |
-
workspace is executed. You can create a new plugin by creating a new `.py` file in the
|
| 10 |
-
data directory. LynxKite even includes an integrated editor for this purpose.
|
| 11 |
-
Click **New code file** in the directory where you want to create the file.
|
| 12 |
-
|
| 13 |
-
Plugins in subdirectories of the data directory are imported when executing workspaces
|
| 14 |
-
within those directories. This allows you to create plugins that are only available
|
| 15 |
-
in specific workspaces.
|
| 16 |
-
|
| 17 |
-
You can also create and distribute plugins as Python packages. In this case the
|
| 18 |
-
module name must start with `lynxkite_` for it to be automatically imported on startup.
|
| 19 |
-
|
| 20 |
-
### Plugin dependencies
|
| 21 |
-
|
| 22 |
-
When creating a plugin as a "code file", you can create a `requirements.txt` file in the same
|
| 23 |
-
directory. This file will be used to install the dependencies of the plugin.
|
| 24 |
-
|
| 25 |
-
## Adding new operations
|
| 26 |
-
|
| 27 |
-
Any piece of Python code can easily be wrapped into a LynxKite operation.
|
| 28 |
-
Let's say we have some code that calculates the length of a string column in a Pandas DataFrame:
|
| 29 |
-
|
| 30 |
-
```python
|
| 31 |
-
df["length"] = df["my_column"].str.len()
|
| 32 |
-
```
|
| 33 |
-
|
| 34 |
-
We can turn it into a LynxKite operation using the
|
| 35 |
-
[`@op`](../reference/lynxkite-core/ops.md#lynxkite.core.ops.op) decorator:
|
| 36 |
-
|
| 37 |
-
```python
|
| 38 |
-
import pandas as pd
|
| 39 |
-
from lynxkite.core.ops import op
|
| 40 |
-
|
| 41 |
-
@op("LynxKite Graph Analytics", "Get column length")
|
| 42 |
-
def get_length(df: pd.DataFrame, *, column_name: str):
|
| 43 |
-
"""
|
| 44 |
-
Gets the length of a string column.
|
| 45 |
-
|
| 46 |
-
Args:
|
| 47 |
-
column_name: The name of the column to get the length of.
|
| 48 |
-
"""
|
| 49 |
-
df = df.copy()
|
| 50 |
-
df["length"] = df[column_name].str.len()
|
| 51 |
-
return df
|
| 52 |
-
```
|
| 53 |
-
|
| 54 |
-
Let's review the changes we made.
|
| 55 |
-
|
| 56 |
-
### The `@op` decorator
|
| 57 |
-
|
| 58 |
-
The [`@op`](../reference/lynxkite-core/ops.md#lynxkite.core.ops.op) decorator registers a
|
| 59 |
-
function as a LynxKite operation. The first argument is the name of the environment,
|
| 60 |
-
the last argument is the name of the operation. Between the two, you can list the hierarchy of
|
| 61 |
-
categories the operation belongs to. For example:
|
| 62 |
-
|
| 63 |
-
```python
|
| 64 |
-
@op("LynxKite Graph Analytics", "Machine learning", "Preprocessing", "Split train/test set")
|
| 65 |
-
```
|
| 66 |
-
|
| 67 |
-
When defining multiple operations, you can use
|
| 68 |
-
[`ops.op_registration`](../reference/lynxkite-core/ops.md#lynxkite.core.ops.op_registration)
|
| 69 |
-
for convenience:
|
| 70 |
-
```python
|
| 71 |
-
op = ops.op_registration("LynxKite Graph Analytics")
|
| 72 |
-
|
| 73 |
-
@op("An operation")
|
| 74 |
-
def my_op():
|
| 75 |
-
...
|
| 76 |
-
```
|
| 77 |
-
|
| 78 |
-
### The function signature
|
| 79 |
-
|
| 80 |
-
`*` in the list of function arguments marks the start of keyword-only arguments.
|
| 81 |
-
The arguments before `*` will become _inputs_ of the operation. The arguments after `*` will
|
| 82 |
-
be its _parameters_.
|
| 83 |
-
|
| 84 |
-
```python
|
| 85 |
-
# /--- inputs ---\ /- parameters -\
|
| 86 |
-
def get_length(df: pd.DataFrame, *, column_name: str):
|
| 87 |
-
```
|
| 88 |
-
|
| 89 |
-
LynxKite uses the type annotations of the function arguments to provide input validation,
|
| 90 |
-
conversion, and the right UI on the frontend.
|
| 91 |
-
|
| 92 |
-
The types supported for **inputs** are determined by the environment. For graph analytics,
|
| 93 |
-
the possibilities are:
|
| 94 |
-
|
| 95 |
-
- `pandas.DataFrame`
|
| 96 |
-
- `networkx.Graph`
|
| 97 |
-
- [`lynxkite_graph_analytics.Bundle`](../reference/lynxkite-graph-analytics/core.md#lynxkite_graph_analytics.core.Bundle)
|
| 98 |
-
|
| 99 |
-
The inputs of an operation are automatically converted to the right type, when possible.
|
| 100 |
-
|
| 101 |
-
To make an input optional, use an optional type, like `pd.DataFrame | None`.
|
| 102 |
-
|
| 103 |
-
The position of the input and output connectors can be controlled using the
|
| 104 |
-
[`@ops.input_position`](../reference/lynxkite-core/ops.md#lynxkite.core.ops.input_position) and
|
| 105 |
-
[`@ops.output_position`](../reference/lynxkite-core/ops.md#lynxkite.core.ops.output_position)
|
| 106 |
-
decorators. By default, inputs are on the left and outputs on the right.
|
| 107 |
-
|
| 108 |
-
All **parameters** are stored in LynxKite workspaces as strings. If a type annotation is provided,
|
| 109 |
-
LynxKite will convert the string to the right type and provide the right UI.
|
| 110 |
-
|
| 111 |
-
- `str`, `int`, `float` are presented as a text box and converted to the given type.
|
| 112 |
-
- `bool` is presented as a checkbox.
|
| 113 |
-
- [`lynxkite.core.ops.LongStr`](../reference/lynxkite-core/ops.md#lynxkite.core.ops.LongStr)
|
| 114 |
-
is presented as a text area.
|
| 115 |
-
- Enums are presented as a dropdown list.
|
| 116 |
-
- Pydantic models are presented as their JSON string representations. (Unless you add custom UI
|
| 117 |
-
for them.) They are converted to the model object when your function is called.
|
| 118 |
-
|
| 119 |
-
### Slow operations
|
| 120 |
-
|
| 121 |
-
If the function takes a significant amount of time to run, we must either:
|
| 122 |
-
|
| 123 |
-
- Write an asynchronous function.
|
| 124 |
-
- Pass `slow=True` to the `@op` decorator. LynxKite will run the function in a separate thread.
|
| 125 |
-
|
| 126 |
-
`slow=True` also causes the results of the operation to be cached on disk. As long as
|
| 127 |
-
its inputs don't change, the operation will not be run again. This is useful for both
|
| 128 |
-
synchronous and synchronous operations.
|
| 129 |
-
|
| 130 |
-
### Documentation
|
| 131 |
-
|
| 132 |
-
The docstring of the function is used as the operation's description. You can use
|
| 133 |
-
Google-style or Numpy-style docstrings.
|
| 134 |
-
(See [Griffe's documentation](https://mkdocstrings.github.io/griffe/reference/docstrings/).)
|
| 135 |
-
|
| 136 |
-
The docstring should be omitted for simple operations like the one above.
|
| 137 |
-
|
| 138 |
-
### Outputting results
|
| 139 |
-
|
| 140 |
-
The return value of the function is the output of the operation. It will be passed to the
|
| 141 |
-
next operation in the pipeline.
|
| 142 |
-
|
| 143 |
-
An operation can have multiple outputs. In this case, the return value must be a dictionary,
|
| 144 |
-
and the list of outputs must be declared in the `@op` decorator.
|
| 145 |
-
|
| 146 |
-
```python
|
| 147 |
-
@op("LynxKite Graph Analytics", "Train/test split", outputs=["train", "test"])
|
| 148 |
-
def test_split(df: pd.DataFrame, *, test_ratio=0.1):
|
| 149 |
-
test = df.sample(frac=test_ratio).reset_index()
|
| 150 |
-
train = df.drop(test.index).reset_index()
|
| 151 |
-
return {"train": train, "test": test}
|
| 152 |
-
```
|
| 153 |
-
|
| 154 |
-
### Displaying results
|
| 155 |
-
|
| 156 |
-
The outputs of the operation can be used by other operations. But we can also generate results
|
| 157 |
-
that are meant to be viewed by the user. The different options for this are controlled by the `view`
|
| 158 |
-
argument of the `@op` decorator.
|
| 159 |
-
|
| 160 |
-
The `view` argument can be one of the following:
|
| 161 |
-
|
| 162 |
-
- `matplotlib`: Just plot something with Matplotlib and it will be displayed in the UI.
|
| 163 |
-
|
| 164 |
-
```python
|
| 165 |
-
@op("LynxKite Graph Analytics", "Plot column histogram", view="matplotlib")
|
| 166 |
-
def plot(df: pd.DataFrame, *, column_name: str):
|
| 167 |
-
df[column_name].value_counts().sort_index().plot.bar()
|
| 168 |
-
```
|
| 169 |
-
|
| 170 |
-
- `visualization`: Draws a chart using [ECharts](https://echarts.apache.org/examples/en/index.html).
|
| 171 |
-
You need to return a dictionary with the chart configuration, which ECharts calls `option`.
|
| 172 |
-
|
| 173 |
-
```python
|
| 174 |
-
@op("View loss", view="visualization")
|
| 175 |
-
def view_loss(bundle: core.Bundle):
|
| 176 |
-
loss = bundle.dfs["training"].training_loss.tolist()
|
| 177 |
-
v = {
|
| 178 |
-
"title": {"text": "Training loss"},
|
| 179 |
-
"xAxis": {"type": "category"},
|
| 180 |
-
"yAxis": {"type": "value"},
|
| 181 |
-
"series": [{"data": loss, "type": "line"}],
|
| 182 |
-
}
|
| 183 |
-
return v
|
| 184 |
-
```
|
| 185 |
-
|
| 186 |
-
- `image`: Return an image as a
|
| 187 |
-
[data URL](https://developer.mozilla.org/en-US/docs/Web/URI/Reference/Schemes/data)
|
| 188 |
-
and it will be displayed.
|
| 189 |
-
- `molecule`: Return a molecule as a PDB or SDF string, or an `rdkit.Chem.Mol` object.
|
| 190 |
-
It will be displayed using [3Dmol.js](https://3Dmol.org/).
|
| 191 |
-
- `table_view`: Return
|
| 192 |
-
[`Bundle.to_dict()`](../reference/lynxkite-graph-analytics/core.md#lynxkite_graph_analytics.core.Bundle.to_dict).
|
| 193 |
-
|
| 194 |
-
## Adding new environments
|
| 195 |
-
|
| 196 |
-
A new environment means a completely new set of operations, and (optionally) a new
|
| 197 |
-
executor. There's nothing to be done for setting up a new environment. Just start
|
| 198 |
-
registering operations into it.
|
| 199 |
-
|
| 200 |
-
### No executor
|
| 201 |
-
|
| 202 |
-
By default, the new environment will have no executor. This can be useful!
|
| 203 |
-
|
| 204 |
-
LynxKite workspaces are stored as straightforward JSON files and updated on every modification.
|
| 205 |
-
You can use LynxKite for configuring workflows and have a separate system
|
| 206 |
-
read the JSON files.
|
| 207 |
-
|
| 208 |
-
Since the code of the operations is not executed in this case, you can create functions that do nothing.
|
| 209 |
-
Alternatively, you can use the
|
| 210 |
-
[`register_passive_op`](../reference/lynxkite-core/ops.md#lynxkite.core.ops.register_passive_op)
|
| 211 |
-
and
|
| 212 |
-
[`passive_op_registration`](../reference/lynxkite-core/ops.md#lynxkite.core.ops.passive_op_registration)
|
| 213 |
-
functions to easily whip up a set of operations:
|
| 214 |
-
|
| 215 |
-
```python
|
| 216 |
-
from lynxkite.core.ops import passive_op_registration, Parameter as P
|
| 217 |
-
|
| 218 |
-
op = passive_op_registration("My Environment")
|
| 219 |
-
op('Scrape documents', params=[P('url', '')])
|
| 220 |
-
op('Conversation logs')
|
| 221 |
-
op('Extract graph')
|
| 222 |
-
op('Compute embeddings', params=[P.options('method', ['LLM', 'graph', 'random']), P('dimensions', 1234)])
|
| 223 |
-
op('Vector DB', params=[P.options('backend', ['ANN', 'HNSW'])])
|
| 224 |
-
op('Chat UI', outputs=[])
|
| 225 |
-
op('Chat backend')
|
| 226 |
-
```
|
| 227 |
-
|
| 228 |
-
### Built-in executors
|
| 229 |
-
|
| 230 |
-
LynxKite comes with two built-in executors. You can register these for your environment
|
| 231 |
-
and you're good to go.
|
| 232 |
-
|
| 233 |
-
```python
|
| 234 |
-
from lynxkite.core.executors import simple
|
| 235 |
-
simple.register("My Environment")
|
| 236 |
-
```
|
| 237 |
-
|
| 238 |
-
The [`simple` executor](../reference/lynxkite-core/executors/simple.md)
|
| 239 |
-
runs each operation once, passing the output of the preceding operation
|
| 240 |
-
as the input to the next one. No tricks. You can use any types as inputs and outputs.
|
| 241 |
-
|
| 242 |
-
```python
|
| 243 |
-
from lynxkite.core.executors import one_by_one
|
| 244 |
-
one_by_one.register("My Environment")
|
| 245 |
-
```
|
| 246 |
-
|
| 247 |
-
The [`one_by_one` executor](../reference/lynxkite-core/executors/one_by_one.md)
|
| 248 |
-
expects that the code for operations is the code for transforming
|
| 249 |
-
a single element. If an operation returns an iterable, it will be split up
|
| 250 |
-
into its elements, and the next operation is called for each element.
|
| 251 |
-
|
| 252 |
-
Sometimes you need the full contents of an input. The `one_by_one` executor
|
| 253 |
-
lets you choose between the two modes by the orientation of the input connector.
|
| 254 |
-
If the input connector is horizontal (left or right), it takes single elements.
|
| 255 |
-
If the input connector is vertical (top or bottom), it takes an iterable of all the incoming data.
|
| 256 |
-
|
| 257 |
-
A unique advantage of this setup is that horizontal inputs can have loops across
|
| 258 |
-
horizontal inputs. Just make sure that loops eventually discard all elements, so you don't
|
| 259 |
-
end up with an infinite loop.
|
| 260 |
-
|
| 261 |
-
### Custom executors
|
| 262 |
-
|
| 263 |
-
A custom executor can be registered using
|
| 264 |
-
[`@ops.register_executor`](../reference/lynxkite-core/ops.md#lynxkite.core.ops.register_executor).
|
| 265 |
-
|
| 266 |
-
```python
|
| 267 |
-
@ops.register_executor(ENV)
|
| 268 |
-
async def execute(ws: workspace.Workspace):
|
| 269 |
-
catalog = ops.CATALOGS[ws.env]
|
| 270 |
-
...
|
| 271 |
-
```
|
| 272 |
-
|
| 273 |
-
The executor must be an asynchronous function that takes a
|
| 274 |
-
[`workspace.Workspace`](../reference/lynxkite-core/workspace.md#lynxkite.core.workspace.Workspace)
|
| 275 |
-
as an argument. The return value is ignored and it's up to you how you process the workspace.
|
| 276 |
-
|
| 277 |
-
To update the frontend as the executor processes the workspace, call
|
| 278 |
-
[`WorkspaceNode.publish_started`](../reference/lynxkite-core/workspace.md#lynxkite.core.workspace.WorkspaceNode.publish_started)
|
| 279 |
-
when starting to execute a node, and
|
| 280 |
-
[`WorkspaceNode.publish_result`](../reference/lynxkite-core/workspace.md#lynxkite.core.workspace.WorkspaceNode.publish_result)
|
| 281 |
-
to publish the results. Use
|
| 282 |
-
[`WorkspaceNode.publish_error`](../reference/lynxkite-core/workspace.md#lynxkite.core.workspace.WorkspaceNode.publish_error)
|
| 283 |
-
if the node failed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
docs/guides/quickstart.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
| 1 |
-
# Quickstart
|
| 2 |
-
|
| 3 |
-
Install the LynxKite application with `pip`:
|
| 4 |
-
```bash
|
| 5 |
-
pip install lynxkite
|
| 6 |
-
```
|
| 7 |
-
|
| 8 |
-
To be able to do anything useful, you also need to install one or more LynxKite environments.
|
| 9 |
-
If you want to work with data science and graph analytics, install the `lynxkite-graph-analytics` package:
|
| 10 |
-
```bash
|
| 11 |
-
pip install lynxkite-graph-analytics
|
| 12 |
-
```
|
| 13 |
-
|
| 14 |
-
Create a folder for storing your LynxKite projects:
|
| 15 |
-
```bash
|
| 16 |
-
mkdir ~/lynxkite_projects
|
| 17 |
-
```
|
| 18 |
-
|
| 19 |
-
You're ready to run LynxKite!
|
| 20 |
-
```bash
|
| 21 |
-
cd ~/lynxkite_projects
|
| 22 |
-
lynxkite
|
| 23 |
-
```
|
| 24 |
-
|
| 25 |
-
Open [http://localhost:8000/](http://localhost:8000/) in your browser.
|
| 26 |
-
|
| 27 |
-
Find example workspaces in the [`examples` folder](https://github.com/lynxkite/lynxkite-2000/tree/main/examples).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
docs/index.md
DELETED
|
@@ -1,5 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
title: Overview
|
| 3 |
-
---
|
| 4 |
-
|
| 5 |
-
--8<-- "README.md"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
docs/license.md
DELETED
|
@@ -1,11 +0,0 @@
|
|
| 1 |
-
# License
|
| 2 |
-
|
| 3 |
-
LynxKite 2000:MM is available under the GNU AGPLv3 license below.
|
| 4 |
-
|
| 5 |
-
Additionally, [Lynx Analytics](https://www.lynxanalytics.com/) offers a commercial license of LynxKite 2000:MM
|
| 6 |
-
that includes additional features and support. Get in touch if you are interested in life sciences tools
|
| 7 |
-
and cluster deployment!
|
| 8 |
-
|
| 9 |
-
```
|
| 10 |
-
--8<-- "LICENSE"
|
| 11 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
docs/lynxkite-core.md
DELETED
|
@@ -1,6 +0,0 @@
|
|
| 1 |
-
# LynxKite Core
|
| 2 |
-
|
| 3 |
-
LynxKite core is for writing LynxKite plugins.
|
| 4 |
-
It contains core types and utilities that can be used by all LynxKite plugins.
|
| 5 |
-
|
| 6 |
-
::: lynxkite.core.ops
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
docs/lynxkite-graph-analytics.md
DELETED
|
@@ -1,6 +0,0 @@
|
|
| 1 |
-
# LynxKite Graph Analytics
|
| 2 |
-
|
| 3 |
-
This is the classical LynxKite experience!
|
| 4 |
-
The graph analytics plugin is a collection of graph algorithms that can be run on a LynxKite graph.
|
| 5 |
-
|
| 6 |
-
::: lynxkite_graph_analytics.lynxkite_ops
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
docs/reference/lynxkite-core/executors/one_by_one.md
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
::: lynxkite.core.executors.one_by_one
|
|
|
|
|
|
docs/reference/lynxkite-core/executors/simple.md
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
::: lynxkite.core.executors.simple
|
|
|
|
|
|
docs/reference/lynxkite-core/ops.md
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
::: lynxkite.core.ops
|
|
|
|
|
|
docs/reference/lynxkite-core/workspace.md
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
::: lynxkite.core.workspace
|
|
|
|
|
|
docs/reference/lynxkite-graph-analytics/core.md
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
::: lynxkite_graph_analytics.core
|
|
|
|
|
|
docs/reference/lynxkite-graph-analytics/operations.md
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
::: lynxkite_graph_analytics.lynxkite_ops
|
| 2 |
-
::: lynxkite_graph_analytics.ml_ops
|
| 3 |
-
::: lynxkite_graph_analytics.networkx_ops
|
|
|
|
|
|
|
|
|
|
|
|
docs/stylesheets/extra.css
DELETED
|
@@ -1,8 +0,0 @@
|
|
| 1 |
-
[data-md-color-scheme="lynxkite"] {
|
| 2 |
-
--md-primary-fg-color: #39bcf9;
|
| 3 |
-
--md-primary-fg-color--light: #9fdef9;
|
| 4 |
-
--md-primary-fg-color--dark: #096f9a;
|
| 5 |
-
--md-accent-fg-color: #ff8800;
|
| 6 |
-
--md-accent-fg-color--dark: #b86200;
|
| 7 |
-
--md-accent-fg-color--light: #ffbc70;
|
| 8 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
examples/Cheminformatics/chembl_tools.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from
|
| 2 |
import pandas as pd
|
| 3 |
from chembl_webresource_client.new_client import new_client
|
| 4 |
from rdkit import Chem
|
|
|
|
| 1 |
+
from lynxkite_core.ops import op
|
| 2 |
import pandas as pd
|
| 3 |
from chembl_webresource_client.new_client import new_client
|
| 4 |
from rdkit import Chem
|
examples/Cheminformatics/cheminfo_tools.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import os
|
| 2 |
import pickle
|
| 3 |
-
from
|
| 4 |
from matplotlib import pyplot as plt
|
| 5 |
import pandas as pd
|
| 6 |
from rdkit.Chem.Draw import rdMolDraw2D
|
|
|
|
| 1 |
import os
|
| 2 |
import pickle
|
| 3 |
+
from lynxkite_core.ops import op
|
| 4 |
from matplotlib import pyplot as plt
|
| 5 |
import pandas as pd
|
| 6 |
from rdkit.Chem.Draw import rdMolDraw2D
|
examples/Cheminformatics/rcsb_api.py
CHANGED
|
@@ -4,7 +4,7 @@ import pypdb
|
|
| 4 |
import biotite.database.rcsb as rcsb
|
| 5 |
from MDAnalysis.analysis import rms
|
| 6 |
from opencadd.structure.superposition.engines.mda import MDAnalysisAligner
|
| 7 |
-
from
|
| 8 |
import os
|
| 9 |
import numpy as np
|
| 10 |
from Bio.PDB import PDBList, PDBParser, Superimposer
|
|
|
|
| 4 |
import biotite.database.rcsb as rcsb
|
| 5 |
from MDAnalysis.analysis import rms
|
| 6 |
from opencadd.structure.superposition.engines.mda import MDAnalysisAligner
|
| 7 |
+
from lynxkite_core.ops import op
|
| 8 |
import os
|
| 9 |
import numpy as np
|
| 10 |
from Bio.PDB import PDBList, PDBParser, Superimposer
|
lynxkite-bio/src/lynxkite_bio/bionemo_ops.py
CHANGED
|
@@ -6,7 +6,7 @@ The operations are quite specific for this example notebook:
|
|
| 6 |
https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/user-guide/examples/bionemo-geneformer/geneformer-celltype-classification.ipynb
|
| 7 |
"""
|
| 8 |
|
| 9 |
-
from
|
| 10 |
import requests
|
| 11 |
import tarfile
|
| 12 |
import os
|
|
|
|
| 6 |
https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/user-guide/examples/bionemo-geneformer/geneformer-celltype-classification.ipynb
|
| 7 |
"""
|
| 8 |
|
| 9 |
+
from lynxkite_core import ops
|
| 10 |
import requests
|
| 11 |
import tarfile
|
| 12 |
import os
|
lynxkite-bio/src/lynxkite_bio/k8s.py
CHANGED
|
@@ -201,11 +201,11 @@ def needs(
|
|
| 201 |
name: str,
|
| 202 |
image: str,
|
| 203 |
port: int,
|
| 204 |
-
args: list = None,
|
| 205 |
-
env: list = None,
|
| 206 |
-
forward_env: list = None,
|
| 207 |
-
health_probe: str = None,
|
| 208 |
-
storage_size: str = None,
|
| 209 |
storage_path: str = "/data",
|
| 210 |
namespace: str = "default",
|
| 211 |
):
|
|
|
|
| 201 |
name: str,
|
| 202 |
image: str,
|
| 203 |
port: int,
|
| 204 |
+
args: list | None = None,
|
| 205 |
+
env: list | None = None,
|
| 206 |
+
forward_env: list | None = None,
|
| 207 |
+
health_probe: str | None = None,
|
| 208 |
+
storage_size: str | None = None,
|
| 209 |
storage_path: str = "/data",
|
| 210 |
namespace: str = "default",
|
| 211 |
):
|
lynxkite-bio/src/lynxkite_bio/llm.py
CHANGED
|
@@ -7,7 +7,7 @@ requirements.
|
|
| 7 |
|
| 8 |
import openai
|
| 9 |
import pandas as pd
|
| 10 |
-
from
|
| 11 |
|
| 12 |
from . import k8s
|
| 13 |
|
|
|
|
| 7 |
|
| 8 |
import openai
|
| 9 |
import pandas as pd
|
| 10 |
+
from lynxkite_core import ops
|
| 11 |
|
| 12 |
from . import k8s
|
| 13 |
|
lynxkite-bio/src/lynxkite_bio/nims.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
"""Wrappers for BioNeMo NIMs."""
|
| 2 |
|
| 3 |
from lynxkite_graph_analytics import Bundle
|
| 4 |
-
from
|
| 5 |
import httpx
|
| 6 |
import io
|
| 7 |
import pandas as pd
|
|
|
|
| 1 |
"""Wrappers for BioNeMo NIMs."""
|
| 2 |
|
| 3 |
from lynxkite_graph_analytics import Bundle
|
| 4 |
+
from lynxkite_core import ops
|
| 5 |
import httpx
|
| 6 |
import io
|
| 7 |
import pandas as pd
|
lynxkite-bio/src/lynxkite_bio/rdkit.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
"""An expansion for `lynxkite-graph-analytics` that provides algorithms for biological applications."""
|
| 2 |
|
| 3 |
from lynxkite_graph_analytics import Bundle, RelationDefinition
|
| 4 |
-
from
|
| 5 |
import numpy as np
|
| 6 |
import pandas as pd
|
| 7 |
import rdkit.Chem
|
|
|
|
| 1 |
"""An expansion for `lynxkite-graph-analytics` that provides algorithms for biological applications."""
|
| 2 |
|
| 3 |
from lynxkite_graph_analytics import Bundle, RelationDefinition
|
| 4 |
+
from lynxkite_core import ops
|
| 5 |
import numpy as np
|
| 6 |
import pandas as pd
|
| 7 |
import rdkit.Chem
|
lynxkite-lynxscribe/src/lynxkite_lynxscribe/llm_ops.py
CHANGED
|
@@ -7,13 +7,13 @@ as an "agentic logic flow". It might just get deleted.
|
|
| 7 |
"""
|
| 8 |
|
| 9 |
import os
|
| 10 |
-
from
|
| 11 |
import enum
|
| 12 |
import jinja2
|
| 13 |
import json
|
| 14 |
import numpy as np
|
| 15 |
import pandas as pd
|
| 16 |
-
from
|
| 17 |
|
| 18 |
jinja = jinja2.Environment()
|
| 19 |
chroma_client = None
|
|
|
|
| 7 |
"""
|
| 8 |
|
| 9 |
import os
|
| 10 |
+
from lynxkite_core import ops
|
| 11 |
import enum
|
| 12 |
import jinja2
|
| 13 |
import json
|
| 14 |
import numpy as np
|
| 15 |
import pandas as pd
|
| 16 |
+
from lynxkite_core.executors import one_by_one
|
| 17 |
|
| 18 |
jinja = jinja2.Environment()
|
| 19 |
chroma_client = None
|
lynxkite-lynxscribe/src/lynxkite_lynxscribe/lynxscribe_ops.py
CHANGED
|
@@ -30,9 +30,9 @@ from lynxscribe.components.chat.api import ChatAPI
|
|
| 30 |
from lynxscribe.core.models.prompts import ChatCompletionPrompt, Message
|
| 31 |
from lynxscribe.components.rag.loaders import FAQTemplateLoader
|
| 32 |
|
| 33 |
-
from
|
| 34 |
import json
|
| 35 |
-
from
|
| 36 |
|
| 37 |
DEFAULT_NEGATIVE_ANSWER = "I'm sorry, but the data I've been trained on does not contain any information related to your question."
|
| 38 |
|
|
@@ -860,11 +860,11 @@ def view(input):
|
|
| 860 |
return v
|
| 861 |
|
| 862 |
|
| 863 |
-
async def get_chat_api(
|
| 864 |
-
from
|
| 865 |
|
| 866 |
cwd = pathlib.Path()
|
| 867 |
-
path = cwd / (
|
| 868 |
assert path.is_relative_to(cwd), f"Path '{path}' is invalid"
|
| 869 |
assert path.exists(), f"Workspace {path} does not exist"
|
| 870 |
ws = workspace.Workspace.load(path)
|
|
@@ -939,7 +939,7 @@ async def api_service_get(request):
|
|
| 939 |
|
| 940 |
|
| 941 |
def get_lynxscribe_workspaces() -> list[str]:
|
| 942 |
-
from
|
| 943 |
|
| 944 |
workspaces = []
|
| 945 |
for p in pathlib.Path().glob("**/*"):
|
|
|
|
| 30 |
from lynxscribe.core.models.prompts import ChatCompletionPrompt, Message
|
| 31 |
from lynxscribe.components.rag.loaders import FAQTemplateLoader
|
| 32 |
|
| 33 |
+
from lynxkite_core import ops
|
| 34 |
import json
|
| 35 |
+
from lynxkite_core.executors import one_by_one
|
| 36 |
|
| 37 |
DEFAULT_NEGATIVE_ANSWER = "I'm sorry, but the data I've been trained on does not contain any information related to your question."
|
| 38 |
|
|
|
|
| 860 |
return v
|
| 861 |
|
| 862 |
|
| 863 |
+
async def get_chat_api(ws_path: str):
|
| 864 |
+
from lynxkite_core import workspace
|
| 865 |
|
| 866 |
cwd = pathlib.Path()
|
| 867 |
+
path = cwd / (ws_path + ".lynxkite.json")
|
| 868 |
assert path.is_relative_to(cwd), f"Path '{path}' is invalid"
|
| 869 |
assert path.exists(), f"Workspace {path} does not exist"
|
| 870 |
ws = workspace.Workspace.load(path)
|
|
|
|
| 939 |
|
| 940 |
|
| 941 |
def get_lynxscribe_workspaces() -> list[str]:
|
| 942 |
+
from lynxkite_core import workspace
|
| 943 |
|
| 944 |
workspaces = []
|
| 945 |
for p in pathlib.Path().glob("**/*"):
|
lynxkite-lynxscribe/tests/test_llm_ops.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import unittest
|
| 2 |
from lynxkite_lynxscribe import llm_ops # noqa: F401
|
| 3 |
-
from
|
| 4 |
-
from
|
| 5 |
|
| 6 |
|
| 7 |
def make_node(id, op, type="basic", **params):
|
|
|
|
| 1 |
import unittest
|
| 2 |
from lynxkite_lynxscribe import llm_ops # noqa: F401
|
| 3 |
+
from lynxkite_core.executors import one_by_one
|
| 4 |
+
from lynxkite_core import ops, workspace
|
| 5 |
|
| 6 |
|
| 7 |
def make_node(id, op, type="basic", **params):
|
pyproject.toml
CHANGED
|
@@ -4,14 +4,14 @@ name = "lynxkite-enterprise-workspace"
|
|
| 4 |
version = "0.1.0"
|
| 5 |
requires-python = ">=3.12"
|
| 6 |
dependencies = [
|
| 7 |
-
"lynxkite", "lynxkite-core", "lynxkite-graph-analytics[gpu]", "lynxkite-pillow-example",
|
| 8 |
"lynxkite-bio",
|
| 9 |
"lynxkite-lynxscribe",
|
| 10 |
]
|
| 11 |
classifiers = ["Private :: Do Not Upload"]
|
| 12 |
|
| 13 |
[tool.uv.sources]
|
| 14 |
-
lynxkite = { git = "https://github.com/lynxkite/lynxkite-2000", subdirectory = "lynxkite-app" }
|
| 15 |
lynxkite-core = { git = "https://github.com/lynxkite/lynxkite-2000", subdirectory = "lynxkite-core" }
|
| 16 |
lynxkite-graph-analytics = { git = "https://github.com/lynxkite/lynxkite-2000", subdirectory = "lynxkite-graph-analytics" }
|
| 17 |
lynxkite-pillow-example = { git = "https://github.com/lynxkite/lynxkite-2000", subdirectory = "lynxkite-pillow-example" }
|
|
|
|
| 4 |
version = "0.1.0"
|
| 5 |
requires-python = ">=3.12"
|
| 6 |
dependencies = [
|
| 7 |
+
"lynxkite-app", "lynxkite-core", "lynxkite-graph-analytics[gpu]", "lynxkite-pillow-example",
|
| 8 |
"lynxkite-bio",
|
| 9 |
"lynxkite-lynxscribe",
|
| 10 |
]
|
| 11 |
classifiers = ["Private :: Do Not Upload"]
|
| 12 |
|
| 13 |
[tool.uv.sources]
|
| 14 |
+
lynxkite-app = { git = "https://github.com/lynxkite/lynxkite-2000", subdirectory = "lynxkite-app" }
|
| 15 |
lynxkite-core = { git = "https://github.com/lynxkite/lynxkite-2000", subdirectory = "lynxkite-core" }
|
| 16 |
lynxkite-graph-analytics = { git = "https://github.com/lynxkite/lynxkite-2000", subdirectory = "lynxkite-graph-analytics" }
|
| 17 |
lynxkite-pillow-example = { git = "https://github.com/lynxkite/lynxkite-2000", subdirectory = "lynxkite-pillow-example" }
|
uv.lock
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|