Metadata-Version: 2.4
Name: colour-match-sdl
Version: 0.1.9
Summary: Colour matching and SDL simulation utilities for IvoryOS demos.
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Provides-Extra: full
Requires-Dist: matplotlib; extra == "full"
Requires-Dist: plotly; extra == "full"
Requires-Dist: opencv-python==4.10.0.84; extra == "full"
Requires-Dist: colormath==3.0.0; extra == "full"
Dynamic: license-file

# Colour match SDL


## Description
Colour matching and SDL (Self-Driving Laboratory) simulation utilities for IvoryOS demos. This repository provides a simulated platform to run Bayesian Optimization for color matching, interfacing with simulated instruments.

## Installation
First, ensure you have Python >= 3.10. Create a new virtual environment, then you can install the package and its dependencies:

```commandline
# Install core dependencies
pip install -e .

# Or install with full dependencies (recommended for running all demos)
pip install -e .[full]
```
Alternatively, if installing purely from the requirements file:
```commandline
pip install -r requirements.txt
```
The versions in `requirements.txt` are frozen reference versions for this repository. 

### IvoryOS
[ivoryos](https://pypi.org/project/ivoryos/) is required to run the IvoryOS demos and is included in `requirements.txt`,
but it is not a dependency of the package, so `pip install -e .` / `.[full]` won't install it. In that case, install it separately:
```commandline
pip install ivoryos
```

## Usage
Order to go through the scripts

In the scripts folder
1. [instruments.py](scripts/instruments.py)
2. [multiposition_vici_valve.py](scripts/multiposition_vici_valve.py)
3. [demo_prepare_stock_solution_complete.py](scripts/demo_prepare_stock_solution_complete.py)
4. [demo_prepare_stock_solution_with_analyze.py](scripts/demo_prepare_stock_solution_with_analyze.py)
5. [demo_data_visualization_matplotlib.py](scripts/demo_data_visualization_matplotlib.py)
6. [demo_data_visualization_plotly.py](scripts/demo_data_visualization_plotly.py)
7. [demo_bayesian_optimization.py](scripts/demo_bayesian_optimization.py)
8. [demo_bayesian_optimization_matplotlib.py](scripts/demo_bayesian_optimization_matplotlib.py)
9. [demo_bayesian_optimization_plotly.py](scripts/demo_bayesian_optimization_plotly.py)

In the colour match folder
1. [bayesian_optimization_colour_match.py](colour_match/bayesian_optimization_colour_match.py)

In the ivoryOS demo basic sdl folder
1. [ivoryos_basic_sdl/sdl.py](ivoryos_basic_sdl/sdl.py)
   * Explore the workflow designer then load and run 
     * [create_stock_solution_and_analyze.json](ivoryos_basic_sdl/create_stock_solution_and_analyze.json)

In the ivoryOS colour match sdl folder
1. [ivorysos_colour_match_sdl/sdl.py](ivorysos_colour_match_sdl/sdl.py)
   * Explore the workflow designer then load and run 
     * [colour_match_ryb_sunset_orange.json](ivorysos_colour_match_sdl/colour_match_ryb_sunset_orange.json)
     * [colour_match_ryb_grey_blue.json](ivorysos_colour_match_sdl/colour_match_ryb_grey_blue.json)
     * [colour_match_rybgp_grey_blue.json](ivorysos_colour_match_sdl/colour_match_rybgp_grey_blue.json)

In the examples folder
* Module 1 & 2: [sdl_sim_app.py](examples/sdl_sim_app.py)
* Module 3 & 4: [color_match_app.py](examples/color_match_app.py)
* Module 1 & 2 in 3D (Beaver's Bench): [sdl_sim_3d_app.py](examples/sdl_sim_3d_app.py) on ivoryOS,
  [sdl_sim_3d_edge_app.py](examples/sdl_sim_3d_edge_app.py) on ivoryos-next

## 3D Deck Simulation
[sdl_sim_3d/](sdl_sim_3d/) is the same simulation as the 2D `sdl_sim_web` panel, drawn as the real
UR3e bench: every call to the simulated instruments above (`robotic_arm.pick_up_vial_from_tray(3)`,
`capping_station.uncap_vial()`, …) is played as the arm's real moves from the deck's location file
(home, the safe point, the approach point above the target, straight down, gripper, back out), next
to a log that reads like the ArmManager code. It runs three ways from the same build:

* **ivoryOS**: `ivoryos.run(__name__, blueprint_plugins=sdl_sim_3d.plugin.web_viz_3d_bp)`
* **ivoryos-next**: `ivoryos_edge.run(__name__, plugins=[sdl_sim_3d.next_plugin.plugin])`
* **standalone (sandbox)**: `python -m http.server -d sdl_sim_3d/static`, no Python deck at all; the
  simulator runs in the page with a button per method and the stock-solution demo.

Use it instead of the 2D panel, not beside it: both listen to the same simulator, and only the one
configured last receives its events. The page's source and what is estimated versus taken from the
location file are in [sdl_sim_3d/frontend/README.md](sdl_sim_3d/frontend/README.md); rebuild it with
`npm run build` there and commit `sdl_sim_3d/static`. The hackathon showcase of the same page lives at
[github.com/ivoryzh/beavers-bench](https://github.com/ivoryzh/beavers-bench); this repository is the source.


## Authors and acknowledgment
Rebekah Greenwood, Veronica Lai, Wenyu Zhang, Erin Lindenberg, and Jason E. Hein
