Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Lint

on:
pull_request:
push:
branches: [main]

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm

- run: pnpm install --frozen-lockfile
- run: pnpm run lint
- run: pnpm run format:check
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Test

on:
pull_request:
push:
branches: [main]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm

- run: pnpm install --frozen-lockfile
- run: pnpm run test
9 changes: 9 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"singleQuote": true,
"semi": false,
"printWidth": 80,
"trailingComma": "all",
"sortPackageJson": false,
"ignorePatterns": []
}
121 changes: 121 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": [],
"categories": {
"correctness": "off"
},
"env": {
"builtin": true
},
"ignorePatterns": ["dist"],
"overrides": [
{
"files": ["**/*.{ts,tsx}"],
"rules": {
"constructor-super": "off",
"for-direction": "error",
"getter-return": "off",
"no-async-promise-executor": "error",
"no-case-declarations": "error",
"no-class-assign": "off",
"no-compare-neg-zero": "error",
"no-cond-assign": "error",
"no-const-assign": "off",
"no-constant-binary-expression": "error",
"no-constant-condition": "error",
"no-control-regex": "error",
"no-debugger": "error",
"no-delete-var": "error",
"no-dupe-class-members": "off",
"no-dupe-else-if": "error",
"no-dupe-keys": "off",
"no-duplicate-case": "error",
"no-empty": "error",
"no-empty-character-class": "error",
"no-empty-pattern": "error",
"no-empty-static-block": "error",
"no-ex-assign": "error",
"no-extra-boolean-cast": "error",
"no-fallthrough": "error",
"no-func-assign": "off",
"no-global-assign": "error",
"no-import-assign": "off",
"no-invalid-regexp": "error",
"no-irregular-whitespace": "error",
"no-loss-of-precision": "error",
"no-misleading-character-class": "error",
"no-new-native-nonconstructor": "off",
"no-nonoctal-decimal-escape": "error",
"no-obj-calls": "off",
"no-prototype-builtins": "error",
"no-redeclare": "off",
"no-regex-spaces": "error",
"no-self-assign": "error",
"no-setter-return": "off",
"no-shadow-restricted-names": "error",
"no-sparse-arrays": "error",
"no-this-before-super": "off",
"no-unassigned-vars": "error",
"no-unexpected-multiline": "error",
"no-unreachable": "off",
"no-unsafe-finally": "error",
"no-unsafe-negation": "off",
"no-unsafe-optional-chaining": "error",
"no-unused-labels": "error",
"no-unused-private-class-members": "error",
"no-unused-vars": "error",
"no-useless-backreference": "error",
"no-useless-catch": "error",
"no-useless-escape": "error",
"no-with": "off",
"preserve-caught-error": "error",
"require-yield": "error",
"use-isnan": "error",
"valid-typeof": "error",
"no-var": "error",
"prefer-const": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"no-array-constructor": "error",
"no-unused-expressions": "error",
"typescript/ban-ts-comment": "error",
"typescript/no-duplicate-enum-values": "error",
"typescript/no-empty-object-type": "error",
"typescript/no-explicit-any": "error",
"typescript/no-extra-non-null-assertion": "error",
"typescript/no-misused-new": "error",
"typescript/no-namespace": "error",
"typescript/no-non-null-asserted-optional-chain": "error",
"typescript/no-require-imports": "error",
"typescript/no-this-alias": "error",
"typescript/no-unnecessary-type-constraint": "error",
"typescript/no-unsafe-declaration-merging": "error",
"typescript/no-unsafe-function-type": "error",
"typescript/no-wrapper-object-types": "error",
"typescript/prefer-as-const": "error",
"typescript/prefer-namespace-keyword": "error",
"typescript/triple-slash-reference": "error",
"react/rules-of-hooks": "error",
"react/exhaustive-deps": "warn",
"react/static-components": "error",
"react/use-memo": "error",
"react/preserve-manual-memoization": "error",
"react/incompatible-library": "warn",
"react/immutability": "error",
"react/globals": "error",
"react/refs": "error",
"react/set-state-in-effect": "error",
"react/error-boundaries": "error",
"react/purity": "error",
"react/set-state-in-render": "error",
"react/unsupported-syntax": "warn",
"react/only-export-components": "off"
},
"plugins": ["typescript", "react"],
"env": {
"es2022": true,
"browser": true
}
}
]
}
6 changes: 0 additions & 6 deletions .prettierrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion docs/Architecture.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Overall Architecture and Data Flow

This extension is designed to operate through the collaboration of three components: the **VSCode Extension Host (backend)**, **React Webview (frontend)**, and **Python Subprocess (simulation environment)**.
This extension is designed to operate through the collaboration of three components: the **VSCode Extension Host (backend)**, **React Webview (frontend)**, and **Python Subprocess (simulation environment)**.

```
[ VSCode Editor ] ➔ (Click the "Reanalyze" button)
Expand Down
8 changes: 4 additions & 4 deletions docs/Instllation.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@

# Setup Protocol Vizualizer

## 1. Prerequisites

The following are required to use the extension:

- **Python 3.8 or later** must be installed, and the `python3` command must be available in PATH
- The **`opentrons`** Python package must be installed
- The **`opentrons`** Python package must be installed

```bash
pip install opentrons
```

**Note:**
**Note:**
If you need to use Protocol Vizualizer with an OT-2, you will need to use opentrons==9.0.0 pacakge since opentrons 9.1.0+ is not compatible with OT-2.

```bash
pip install opentrons==9.0.0
```

## 2. Installation (from `.vsix`)
Download `protocol-viz-x.x.x.vsix` from GitHub Releases or another source, then install it in VSCode using one of the following methods.

Download `protocol-viz-x.x.x.vsix` from GitHub Releases or another source, then install it in VSCode using one of the following methods.

**Method A: From the Command Palette**

Expand Down
21 changes: 14 additions & 7 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A VSCode extension (prototype) for simulating Opentrons Python protocols directl
The following are required to use the extension:

- **Python 3.8 or later** must be installed, and the `python3` command must be available in PATH
- The **`opentrons`** Python package must be installed
- The **`opentrons`** Python package must be installed

```bash
pip install opentrons
Expand All @@ -24,6 +24,7 @@ pip install opentrons==9.0.0
If you want to use this extension with Flex and OT-2, you will need to create a virtual environment and install opentrons packages separately. Then switch an environment on VSCode's Python Interpreter via `Command Palette`.

### Create a Virtual Environments

The following uses `python3` to create virtual environments because it does not require to install any packages or software. You can use any virtual environment manager you prefer such as `conda` or `uv`.

```bash
Expand All @@ -38,42 +39,48 @@ source .OT2/bin/activate
pip install opentrons
```


---

## 2. Usage

1. Open an Opentrons protocol `.py` file in VSCode.
2. Start Protocol Visualizer. Currently, there are 3 ways to start it:
1. From the Command Palette (`Cmd+Shift+P` / `Ctrl+Shift+P`), run **`Opentrons: Open Protocol Visualizer`**.
2. Click the **beaker** icon in the status bar.
3. Set a new shortcut via Command Pallets `Open Keyboard Shortcuts` and start it with your custom shortcut.
3. When the Visualizer panel opens on the right side of the screen, and `If your protocol uses Runtime parameters`, Protocol Visualizer will generate UI inputs for these parameters.

3. From the Command Palette (`Cmd+Shift+P` / `Ctrl+Shift+P`), run **`Opentrons: Open Protocol Visualizer`**.
4. Click the **beaker** icon in the status bar.
5. Set a new shortcut via Command Pallets `Open Keyboard Shortcuts` and start it with your custom shortcut.
6. When the Visualizer panel opens on the right side of the screen, and `If your protocol uses Runtime parameters`, Protocol Visualizer will generate UI inputs for these parameters.

`Once the analysis is complete, you are ready to edit your protocol.`

### 2-1 Custom labware

This extension supports custom labware definitions. You need to place your custom labware definition files in the same directory as your protocol file.

### 2-2 Auto-analysis

Protocol Visualizer starts analysis automatically when you save changes to your protocol file.

### 2-3 Pop out button

This extension is using VSCode's Auxiliary Window, so you can pop out the Visualizer panel to a separate window. Also you can do the same thing with dragging the Protocol Visualizer tab to somewhere of your screen.

### 2-4 Runtime parameters

For Runtime parameters, you will need to click `Analyze` button to apply your changes to your protocol. `If you change a Runtime parameter, Protocol Visualizer will not change your protocol.`
Runtime parameters function creates a temporary protocol file that applyes your changes as a default parameter value for the analysis and it will be removed whne the visualization is done.

### 2-5 Step Jumper

The step jumper that is located under `Protocol Steps` allows you to jump to a specific step in your protocol. Input the step number and hit `Enter` to jump to that step.

---

## 3. Errors and bugs

If you encounter any errors or bugs, please report them to the #visualization-extension channel or Koji Kanao via DM/email.

---

## 4. License

MIT License © 2026 Koji Kanao
Loading
Loading