ivoryos 1.2.0b1__tar.gz → 1.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ivoryos might be problematic. Click here for more details.
- {ivoryos-1.2.0b1/ivoryos.egg-info → ivoryos-1.2.1}/PKG-INFO +52 -31
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/README.md +51 -30
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/__init__.py +22 -1
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/config.py +1 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/routes/auth/auth.py +3 -1
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/routes/data/data.py +2 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/routes/design/design.py +4 -4
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/routes/library/library.py +4 -4
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/utils/script_runner.py +1 -1
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/utils/utils.py +2 -1
- ivoryos-1.2.1/ivoryos/version.py +1 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1/ivoryos.egg-info}/PKG-INFO +52 -31
- ivoryos-1.2.1/ivoryos.egg-info/SOURCES.txt +54 -0
- ivoryos-1.2.0b1/MANIFEST.in +0 -8
- ivoryos-1.2.0b1/ivoryos/routes/api/api.py +0 -56
- ivoryos-1.2.0b1/ivoryos/routes/auth/templates/login.html +0 -25
- ivoryos-1.2.0b1/ivoryos/routes/auth/templates/signup.html +0 -32
- ivoryos-1.2.0b1/ivoryos/routes/control/templates/controllers.html +0 -166
- ivoryos-1.2.0b1/ivoryos/routes/control/templates/controllers_new.html +0 -112
- ivoryos-1.2.0b1/ivoryos/routes/data/templates/components/step_card.html +0 -13
- ivoryos-1.2.0b1/ivoryos/routes/data/templates/workflow_database.html +0 -109
- ivoryos-1.2.0b1/ivoryos/routes/data/templates/workflow_view.html +0 -130
- ivoryos-1.2.0b1/ivoryos/routes/design/templates/components/action_form.html +0 -53
- ivoryos-1.2.0b1/ivoryos/routes/design/templates/components/actions_panel.html +0 -25
- ivoryos-1.2.0b1/ivoryos/routes/design/templates/components/autofill_toggle.html +0 -10
- ivoryos-1.2.0b1/ivoryos/routes/design/templates/components/canvas.html +0 -5
- ivoryos-1.2.0b1/ivoryos/routes/design/templates/components/canvas_footer.html +0 -9
- ivoryos-1.2.0b1/ivoryos/routes/design/templates/components/canvas_header.html +0 -75
- ivoryos-1.2.0b1/ivoryos/routes/design/templates/components/canvas_main.html +0 -34
- ivoryos-1.2.0b1/ivoryos/routes/design/templates/components/deck_selector.html +0 -10
- ivoryos-1.2.0b1/ivoryos/routes/design/templates/components/edit_action_form.html +0 -38
- ivoryos-1.2.0b1/ivoryos/routes/design/templates/components/instruments_panel.html +0 -66
- ivoryos-1.2.0b1/ivoryos/routes/design/templates/components/modals/drop_modal.html +0 -17
- ivoryos-1.2.0b1/ivoryos/routes/design/templates/components/modals/json_modal.html +0 -22
- ivoryos-1.2.0b1/ivoryos/routes/design/templates/components/modals/new_script_modal.html +0 -17
- ivoryos-1.2.0b1/ivoryos/routes/design/templates/components/modals/rename_modal.html +0 -23
- ivoryos-1.2.0b1/ivoryos/routes/design/templates/components/modals/saveas_modal.html +0 -27
- ivoryos-1.2.0b1/ivoryos/routes/design/templates/components/modals.html +0 -6
- ivoryos-1.2.0b1/ivoryos/routes/design/templates/components/python_code_overlay.html +0 -39
- ivoryos-1.2.0b1/ivoryos/routes/design/templates/components/sidebar.html +0 -15
- ivoryos-1.2.0b1/ivoryos/routes/design/templates/components/text_to_code_panel.html +0 -20
- ivoryos-1.2.0b1/ivoryos/routes/design/templates/experiment_builder.html +0 -41
- ivoryos-1.2.0b1/ivoryos/routes/execute/templates/components/error_modal.html +0 -20
- ivoryos-1.2.0b1/ivoryos/routes/execute/templates/components/logging_panel.html +0 -31
- ivoryos-1.2.0b1/ivoryos/routes/execute/templates/components/progress_panel.html +0 -27
- ivoryos-1.2.0b1/ivoryos/routes/execute/templates/components/run_panel.html +0 -9
- ivoryos-1.2.0b1/ivoryos/routes/execute/templates/components/run_tabs.html +0 -17
- ivoryos-1.2.0b1/ivoryos/routes/execute/templates/components/tab_bayesian.html +0 -399
- ivoryos-1.2.0b1/ivoryos/routes/execute/templates/components/tab_configuration.html +0 -98
- ivoryos-1.2.0b1/ivoryos/routes/execute/templates/components/tab_repeat.html +0 -14
- ivoryos-1.2.0b1/ivoryos/routes/execute/templates/experiment_run.html +0 -294
- ivoryos-1.2.0b1/ivoryos/routes/library/templates/library.html +0 -91
- ivoryos-1.2.0b1/ivoryos/routes/main/templates/help.html +0 -141
- ivoryos-1.2.0b1/ivoryos/routes/main/templates/home.html +0 -103
- ivoryos-1.2.0b1/ivoryos/static/favicon.ico +0 -0
- ivoryos-1.2.0b1/ivoryos/static/gui_annotation/Slide1.png +0 -0
- ivoryos-1.2.0b1/ivoryos/static/gui_annotation/Slide2.PNG +0 -0
- ivoryos-1.2.0b1/ivoryos/static/js/action_handlers.js +0 -213
- ivoryos-1.2.0b1/ivoryos/static/js/db_delete.js +0 -23
- ivoryos-1.2.0b1/ivoryos/static/js/overlay.js +0 -12
- ivoryos-1.2.0b1/ivoryos/static/js/script_metadata.js +0 -39
- ivoryos-1.2.0b1/ivoryos/static/js/socket_handler.js +0 -125
- ivoryos-1.2.0b1/ivoryos/static/js/sortable_card.js +0 -24
- ivoryos-1.2.0b1/ivoryos/static/js/sortable_design.js +0 -138
- ivoryos-1.2.0b1/ivoryos/static/js/ui_state.js +0 -113
- ivoryos-1.2.0b1/ivoryos/static/logo.webp +0 -0
- ivoryos-1.2.0b1/ivoryos/static/style.css +0 -211
- ivoryos-1.2.0b1/ivoryos/templates/base.html +0 -157
- ivoryos-1.2.0b1/ivoryos/version.py +0 -1
- ivoryos-1.2.0b1/ivoryos.egg-info/SOURCES.txt +0 -109
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/LICENSE +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/routes/__init__.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/routes/auth/__init__.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/routes/control/__init__.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/routes/control/control.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/routes/control/control_file.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/routes/control/control_new_device.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/routes/control/utils.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/routes/data/__init__.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/routes/design/__init__.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/routes/design/design_file.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/routes/design/design_step.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/routes/execute/__init__.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/routes/execute/execute.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/routes/execute/execute_file.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/routes/library/__init__.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/routes/main/__init__.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/routes/main/main.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/socket_handlers.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/utils/__init__.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/utils/bo_campaign.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/utils/client_proxy.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/utils/db_models.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/utils/form.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/utils/global_config.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/utils/llm_agent.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/utils/py_to_json.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/utils/serilize.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos/utils/task_runner.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos.egg-info/dependency_links.txt +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos.egg-info/requires.txt +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/ivoryos.egg-info/top_level.txt +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/setup.cfg +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/setup.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/tests/__init__.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/tests/conftest.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/tests/integration/__init__.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/tests/integration/test_route_auth.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/tests/integration/test_route_control.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/tests/integration/test_route_database.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/tests/integration/test_route_design.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/tests/integration/test_route_main.py +0 -0
- {ivoryos-1.2.0b1 → ivoryos-1.2.1}/tests/integration/test_sockets.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ivoryos
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: an open-source Python package enabling Self-Driving Labs (SDLs) interoperability
|
|
5
5
|
Home-page: https://gitlab.com/heingroup/ivoryos
|
|
6
6
|
Author: Ivory Zhang
|
|
@@ -39,7 +39,7 @@ With the least modification of the current workflow, user can design, manage and
|
|
|
39
39
|
This software is developed and tested using Windows. This software and its dependencies are compatible across major platforms: Linux, macOS, and Windows. Some dependencies (Flask-SQLAlchemy) may require additional setup.
|
|
40
40
|
|
|
41
41
|
### Python Version
|
|
42
|
-
Python >=3.10 for best compatibility. Python >=3.7 without Ax.
|
|
42
|
+
Python >=3.10 for the best compatibility. Python >=3.7 without Ax.
|
|
43
43
|
### Python dependencies
|
|
44
44
|
This software is compatible with the latest versions of all dependencies.
|
|
45
45
|
- bcrypt~=4.0
|
|
@@ -50,7 +50,9 @@ This software is compatible with the latest versions of all dependencies.
|
|
|
50
50
|
- SQLAlchemy-Utils~=0.41
|
|
51
51
|
- Flask-WTF~=1.2
|
|
52
52
|
- python-dotenv==1.0.1
|
|
53
|
-
- ax-platform (optional
|
|
53
|
+
- ax-platform (optional 1.0 for Python>=3.10)
|
|
54
|
+
- baybe (optional)
|
|
55
|
+
|
|
54
56
|
|
|
55
57
|
## Installation
|
|
56
58
|
```bash
|
|
@@ -74,43 +76,60 @@ import ivoryos
|
|
|
74
76
|
ivoryos.run(__name__)
|
|
75
77
|
```
|
|
76
78
|
### Login
|
|
77
|
-
Create an account and login (local database)
|
|
79
|
+
Create an account and login (local database with bcrypt password)
|
|
78
80
|
### Features
|
|
79
|
-
- **Direct control**: direct function calling
|
|
80
|
-
- **
|
|
81
|
-
- **Design**: add function to canvas in _Design_ tab. click `Compile and Run` button to go to the execution page
|
|
82
|
-
- **Execution**: configure iteration methods and parameters in _Compile/Run_ tab.
|
|
83
|
-
- **
|
|
84
|
-
- **
|
|
81
|
+
- **Direct control**: direct function calling _Devices_ tab
|
|
82
|
+
- **Workflows**:
|
|
83
|
+
- **Design Editor**: drag/add function to canvas in _Design_ tab. click `Compile and Run` button to go to the execution configuration page
|
|
84
|
+
- **Execution Config**: configure iteration methods and parameters in _Compile/Run_ tab.
|
|
85
|
+
- **Design Library**: manage workflow scripts in _Library_ tab.
|
|
86
|
+
- **Workflow Data**: Execution records are in _Data_ tab.
|
|
85
87
|
|
|
86
88
|
[//]: # ()
|
|
87
89
|
|
|
88
90
|
[//]: # ()
|
|
89
91
|
|
|
90
92
|
|
|
91
|
-
### Additional settings
|
|
92
|
-
#### AI assistant
|
|
93
|
-
To streamline the experimental design on SDLs, we also integrate Large Language Models (LLMs) to interpret the inspected functions and generate code according to task descriptions.
|
|
93
|
+
### Additional settings
|
|
94
|
+
[//]: # (#### AI assistant)
|
|
94
95
|
|
|
95
|
-
|
|
96
|
-
1. Create a `.env` file for `OPENAI_API_KEY`
|
|
97
|
-
```
|
|
98
|
-
OPENAI_API_KEY="Your API Key"
|
|
99
|
-
```
|
|
100
|
-
2. In your SDL script, define model, you can use any GPT models.
|
|
96
|
+
[//]: # (To streamline the experimental design on SDLs, we also integrate Large Language Models (LLMs) to interpret the inspected functions and generate code according to task descriptions.)
|
|
101
97
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
```
|
|
98
|
+
[//]: # ()
|
|
99
|
+
[//]: # (#### Enable LLMs with [OpenAI API](https://github.com/openai/openai-python))
|
|
105
100
|
|
|
106
|
-
|
|
107
|
-
1. Download Ollama.
|
|
108
|
-
2. pull models from Ollama
|
|
109
|
-
3. In your SDL script, define LLM server and model, you can use any models available on Ollama.
|
|
101
|
+
[//]: # (1. Create a `.env` file for `OPENAI_API_KEY`)
|
|
110
102
|
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
|
|
103
|
+
[//]: # (```)
|
|
104
|
+
|
|
105
|
+
[//]: # (OPENAI_API_KEY="Your API Key")
|
|
106
|
+
|
|
107
|
+
[//]: # (```)
|
|
108
|
+
|
|
109
|
+
[//]: # (2. In your SDL script, define model, you can use any GPT models.)
|
|
110
|
+
|
|
111
|
+
[//]: # ()
|
|
112
|
+
[//]: # (```python)
|
|
113
|
+
|
|
114
|
+
[//]: # (ivoryos.run(__name__, model="gpt-3.5-turbo"))
|
|
115
|
+
|
|
116
|
+
[//]: # (```)
|
|
117
|
+
|
|
118
|
+
[//]: # ()
|
|
119
|
+
[//]: # (#### Enable local LLMs with [Ollama](https://ollama.com/))
|
|
120
|
+
|
|
121
|
+
[//]: # (1. Download Ollama.)
|
|
122
|
+
|
|
123
|
+
[//]: # (2. pull models from Ollama)
|
|
124
|
+
|
|
125
|
+
[//]: # (3. In your SDL script, define LLM server and model, you can use any models available on Ollama.)
|
|
126
|
+
|
|
127
|
+
[//]: # ()
|
|
128
|
+
[//]: # (```python)
|
|
129
|
+
|
|
130
|
+
[//]: # (ivoryos.run(__name__, llm_server="localhost", model="llama3.1"))
|
|
131
|
+
|
|
132
|
+
[//]: # (```)
|
|
114
133
|
|
|
115
134
|
#### Add additional logger(s)
|
|
116
135
|
```python
|
|
@@ -135,7 +154,7 @@ ivoryos.run(__name__)
|
|
|
135
154
|
|
|
136
155
|
* Running on all addresses (0.0.0.0)
|
|
137
156
|
* Running on http://127.0.0.1:8000
|
|
138
|
-
* Running on http://
|
|
157
|
+
* Running on http://0.0.0.0:8000
|
|
139
158
|
|
|
140
159
|
### Deck function and web form
|
|
141
160
|

|
|
@@ -163,6 +182,8 @@ When you run the application for the first time, it will automatically create th
|
|
|
163
182
|
- [x] dropdown input ✅
|
|
164
183
|
- [x] show line number option ✅
|
|
165
184
|
- [ ] snapshot version control
|
|
185
|
+
- [ ] optimizer-agnostic
|
|
186
|
+
- [ ] check batch-config file compatibility
|
|
166
187
|
|
|
167
188
|
## Citing
|
|
168
189
|
|
|
@@ -203,4 +224,4 @@ For an additional perspective related to the development of the tool, please see
|
|
|
203
224
|
## Authors and Acknowledgement
|
|
204
225
|
Ivory Zhang, Lucy Hao
|
|
205
226
|
|
|
206
|
-
Authors acknowledge
|
|
227
|
+
Authors acknowledge Telescope Innovations, Hein Lab members for their valuable suggestions and contributions.
|
|
@@ -28,7 +28,7 @@ With the least modification of the current workflow, user can design, manage and
|
|
|
28
28
|
This software is developed and tested using Windows. This software and its dependencies are compatible across major platforms: Linux, macOS, and Windows. Some dependencies (Flask-SQLAlchemy) may require additional setup.
|
|
29
29
|
|
|
30
30
|
### Python Version
|
|
31
|
-
Python >=3.10 for best compatibility. Python >=3.7 without Ax.
|
|
31
|
+
Python >=3.10 for the best compatibility. Python >=3.7 without Ax.
|
|
32
32
|
### Python dependencies
|
|
33
33
|
This software is compatible with the latest versions of all dependencies.
|
|
34
34
|
- bcrypt~=4.0
|
|
@@ -39,7 +39,9 @@ This software is compatible with the latest versions of all dependencies.
|
|
|
39
39
|
- SQLAlchemy-Utils~=0.41
|
|
40
40
|
- Flask-WTF~=1.2
|
|
41
41
|
- python-dotenv==1.0.1
|
|
42
|
-
- ax-platform (optional
|
|
42
|
+
- ax-platform (optional 1.0 for Python>=3.10)
|
|
43
|
+
- baybe (optional)
|
|
44
|
+
|
|
43
45
|
|
|
44
46
|
## Installation
|
|
45
47
|
```bash
|
|
@@ -63,43 +65,60 @@ import ivoryos
|
|
|
63
65
|
ivoryos.run(__name__)
|
|
64
66
|
```
|
|
65
67
|
### Login
|
|
66
|
-
Create an account and login (local database)
|
|
68
|
+
Create an account and login (local database with bcrypt password)
|
|
67
69
|
### Features
|
|
68
|
-
- **Direct control**: direct function calling
|
|
69
|
-
- **
|
|
70
|
-
- **Design**: add function to canvas in _Design_ tab. click `Compile and Run` button to go to the execution page
|
|
71
|
-
- **Execution**: configure iteration methods and parameters in _Compile/Run_ tab.
|
|
72
|
-
- **
|
|
73
|
-
- **
|
|
70
|
+
- **Direct control**: direct function calling _Devices_ tab
|
|
71
|
+
- **Workflows**:
|
|
72
|
+
- **Design Editor**: drag/add function to canvas in _Design_ tab. click `Compile and Run` button to go to the execution configuration page
|
|
73
|
+
- **Execution Config**: configure iteration methods and parameters in _Compile/Run_ tab.
|
|
74
|
+
- **Design Library**: manage workflow scripts in _Library_ tab.
|
|
75
|
+
- **Workflow Data**: Execution records are in _Data_ tab.
|
|
74
76
|
|
|
75
77
|
[//]: # ()
|
|
76
78
|
|
|
77
79
|
[//]: # ()
|
|
78
80
|
|
|
79
81
|
|
|
80
|
-
### Additional settings
|
|
81
|
-
#### AI assistant
|
|
82
|
-
To streamline the experimental design on SDLs, we also integrate Large Language Models (LLMs) to interpret the inspected functions and generate code according to task descriptions.
|
|
82
|
+
### Additional settings
|
|
83
|
+
[//]: # (#### AI assistant)
|
|
83
84
|
|
|
84
|
-
|
|
85
|
-
1. Create a `.env` file for `OPENAI_API_KEY`
|
|
86
|
-
```
|
|
87
|
-
OPENAI_API_KEY="Your API Key"
|
|
88
|
-
```
|
|
89
|
-
2. In your SDL script, define model, you can use any GPT models.
|
|
85
|
+
[//]: # (To streamline the experimental design on SDLs, we also integrate Large Language Models (LLMs) to interpret the inspected functions and generate code according to task descriptions.)
|
|
90
86
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
```
|
|
87
|
+
[//]: # ()
|
|
88
|
+
[//]: # (#### Enable LLMs with [OpenAI API](https://github.com/openai/openai-python))
|
|
94
89
|
|
|
95
|
-
|
|
96
|
-
1. Download Ollama.
|
|
97
|
-
2. pull models from Ollama
|
|
98
|
-
3. In your SDL script, define LLM server and model, you can use any models available on Ollama.
|
|
90
|
+
[//]: # (1. Create a `.env` file for `OPENAI_API_KEY`)
|
|
99
91
|
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
|
|
92
|
+
[//]: # (```)
|
|
93
|
+
|
|
94
|
+
[//]: # (OPENAI_API_KEY="Your API Key")
|
|
95
|
+
|
|
96
|
+
[//]: # (```)
|
|
97
|
+
|
|
98
|
+
[//]: # (2. In your SDL script, define model, you can use any GPT models.)
|
|
99
|
+
|
|
100
|
+
[//]: # ()
|
|
101
|
+
[//]: # (```python)
|
|
102
|
+
|
|
103
|
+
[//]: # (ivoryos.run(__name__, model="gpt-3.5-turbo"))
|
|
104
|
+
|
|
105
|
+
[//]: # (```)
|
|
106
|
+
|
|
107
|
+
[//]: # ()
|
|
108
|
+
[//]: # (#### Enable local LLMs with [Ollama](https://ollama.com/))
|
|
109
|
+
|
|
110
|
+
[//]: # (1. Download Ollama.)
|
|
111
|
+
|
|
112
|
+
[//]: # (2. pull models from Ollama)
|
|
113
|
+
|
|
114
|
+
[//]: # (3. In your SDL script, define LLM server and model, you can use any models available on Ollama.)
|
|
115
|
+
|
|
116
|
+
[//]: # ()
|
|
117
|
+
[//]: # (```python)
|
|
118
|
+
|
|
119
|
+
[//]: # (ivoryos.run(__name__, llm_server="localhost", model="llama3.1"))
|
|
120
|
+
|
|
121
|
+
[//]: # (```)
|
|
103
122
|
|
|
104
123
|
#### Add additional logger(s)
|
|
105
124
|
```python
|
|
@@ -124,7 +143,7 @@ ivoryos.run(__name__)
|
|
|
124
143
|
|
|
125
144
|
* Running on all addresses (0.0.0.0)
|
|
126
145
|
* Running on http://127.0.0.1:8000
|
|
127
|
-
* Running on http://
|
|
146
|
+
* Running on http://0.0.0.0:8000
|
|
128
147
|
|
|
129
148
|
### Deck function and web form
|
|
130
149
|

|
|
@@ -152,6 +171,8 @@ When you run the application for the first time, it will automatically create th
|
|
|
152
171
|
- [x] dropdown input ✅
|
|
153
172
|
- [x] show line number option ✅
|
|
154
173
|
- [ ] snapshot version control
|
|
174
|
+
- [ ] optimizer-agnostic
|
|
175
|
+
- [ ] check batch-config file compatibility
|
|
155
176
|
|
|
156
177
|
## Citing
|
|
157
178
|
|
|
@@ -192,4 +213,4 @@ For an additional perspective related to the development of the tool, please see
|
|
|
192
213
|
## Authors and Acknowledgement
|
|
193
214
|
Ivory Zhang, Lucy Hao
|
|
194
215
|
|
|
195
|
-
Authors acknowledge
|
|
216
|
+
Authors acknowledge Telescope Innovations, Hein Lab members for their valuable suggestions and contributions.
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import sys
|
|
3
|
+
import uuid
|
|
3
4
|
from typing import Union
|
|
4
5
|
|
|
5
|
-
from flask import Flask, redirect, url_for, g, Blueprint
|
|
6
|
+
from flask import Flask, redirect, url_for, g, Blueprint, session
|
|
7
|
+
from flask_login import AnonymousUserMixin
|
|
8
|
+
|
|
6
9
|
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
|
7
10
|
|
|
8
11
|
from ivoryos.config import Config, get_config
|
|
@@ -90,6 +93,23 @@ def create_app(config_class=None):
|
|
|
90
93
|
"""
|
|
91
94
|
g.logger = logger
|
|
92
95
|
g.socketio = socketio
|
|
96
|
+
session.permanent = False
|
|
97
|
+
# DEMO_MODE: Simulate logged-in user per session
|
|
98
|
+
if app.config.get("DEMO_MODE", False):
|
|
99
|
+
if "demo_user_id" not in session:
|
|
100
|
+
session["demo_user_id"] = f"demo_{str(uuid.uuid4())[:8]}"
|
|
101
|
+
|
|
102
|
+
class SessionDemoUser(AnonymousUserMixin):
|
|
103
|
+
@property
|
|
104
|
+
def is_authenticated(self):
|
|
105
|
+
return True
|
|
106
|
+
|
|
107
|
+
def get_id(self):
|
|
108
|
+
return session.get("demo_user_id")
|
|
109
|
+
|
|
110
|
+
login_manager.anonymous_user = SessionDemoUser
|
|
111
|
+
|
|
112
|
+
|
|
93
113
|
|
|
94
114
|
@app.route('/')
|
|
95
115
|
def redirect_to_prefix():
|
|
@@ -101,6 +121,7 @@ def create_app(config_class=None):
|
|
|
101
121
|
text = ' '.join(word for word in name.split('_'))
|
|
102
122
|
return text.capitalize()
|
|
103
123
|
|
|
124
|
+
# app.config.setdefault("DEMO_MODE", False)
|
|
104
125
|
return app
|
|
105
126
|
|
|
106
127
|
|
|
@@ -43,6 +43,7 @@ class TestingConfig(Config):
|
|
|
43
43
|
|
|
44
44
|
class DemoConfig(Config):
|
|
45
45
|
DEBUG = False
|
|
46
|
+
DEMO_MODE = True
|
|
46
47
|
SQLALCHEMY_DATABASE_URI = 'sqlite:///:memory:'
|
|
47
48
|
OUTPUT_FOLDER = os.path.join(os.path.abspath(os.curdir), '/tmp/ivoryos_data')
|
|
48
49
|
CSV_FOLDER = os.path.join(OUTPUT_FOLDER, 'config_csv/')
|
|
@@ -5,6 +5,7 @@ import bcrypt
|
|
|
5
5
|
from ivoryos.utils.db_models import Script, User, db
|
|
6
6
|
from ivoryos.utils.utils import post_script_file
|
|
7
7
|
login_manager = LoginManager()
|
|
8
|
+
# from flask import g
|
|
8
9
|
|
|
9
10
|
auth = Blueprint('auth', __name__, template_folder='templates')
|
|
10
11
|
|
|
@@ -37,7 +38,8 @@ def login():
|
|
|
37
38
|
# password.encode("utf-8")
|
|
38
39
|
# user = User(username, password.encode("utf-8"))
|
|
39
40
|
login_user(user)
|
|
40
|
-
|
|
41
|
+
# g.user = user
|
|
42
|
+
# session['user'] = username
|
|
41
43
|
script_file = Script(author=username)
|
|
42
44
|
session["script"] = script_file.as_dict()
|
|
43
45
|
session['hidden_functions'], session['card_order'], session['prompt'] = {}, {}, {}
|
|
@@ -10,6 +10,7 @@ data = Blueprint('data', __name__, template_folder='templates')
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
@data.route('/executions/records')
|
|
13
|
+
@login_required
|
|
13
14
|
def list_workflows():
|
|
14
15
|
"""
|
|
15
16
|
.. :quickref: Workflow Execution Database; list all workflow execution records
|
|
@@ -113,6 +114,7 @@ def delete_workflow_record(workflow_id: int):
|
|
|
113
114
|
|
|
114
115
|
|
|
115
116
|
@data.route('/files/execution-data/<string:filename>')
|
|
117
|
+
@login_required
|
|
116
118
|
def download_results(filename:str):
|
|
117
119
|
"""
|
|
118
120
|
.. :quickref: Workflow data; download a workflow data file (.CSV)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import os
|
|
2
2
|
|
|
3
3
|
from flask import Blueprint, redirect, url_for, flash, jsonify, request, render_template, session, current_app
|
|
4
|
-
from flask_login import login_required
|
|
4
|
+
from flask_login import login_required, current_user
|
|
5
5
|
|
|
6
6
|
from ivoryos.routes.library.library import publish
|
|
7
7
|
from ivoryos.utils import utils
|
|
@@ -64,7 +64,7 @@ def experiment_builder():
|
|
|
64
64
|
if deck and script.deck is None:
|
|
65
65
|
script.deck = os.path.splitext(os.path.basename(deck.__file__))[
|
|
66
66
|
0] if deck.__name__ == "__main__" else deck.__name__
|
|
67
|
-
|
|
67
|
+
utils.post_script_file(script)
|
|
68
68
|
pseudo_deck_name = session.get('pseudo_deck', '')
|
|
69
69
|
pseudo_deck_path = os.path.join(current_app.config["DUMMY_DECK"], pseudo_deck_name)
|
|
70
70
|
off_line = current_app.config["OFF_LINE"]
|
|
@@ -238,7 +238,7 @@ def clear_draft():
|
|
|
238
238
|
0] if deck.__name__ == "__main__" else deck.__name__
|
|
239
239
|
else:
|
|
240
240
|
deck_name = session.get("pseudo_deck", "")
|
|
241
|
-
script = Script(deck=deck_name, author=
|
|
241
|
+
script = Script(deck=deck_name, author=current_user.get_id())
|
|
242
242
|
utils.post_script_file(script)
|
|
243
243
|
exec_string = script.compile(current_app.config['SCRIPT_FOLDER'])
|
|
244
244
|
session['python_code'] = exec_string
|
|
@@ -265,7 +265,7 @@ def submit_script():
|
|
|
265
265
|
"""
|
|
266
266
|
deck = global_config.deck
|
|
267
267
|
deck_name = os.path.splitext(os.path.basename(deck.__file__))[0] if deck.__name__ == "__main__" else deck.__name__
|
|
268
|
-
script = Script(author=
|
|
268
|
+
script = Script(author=current_user.get_id(), deck=deck_name)
|
|
269
269
|
script_collection = request.get_json()
|
|
270
270
|
workflow_name = script_collection.pop("workflow_name")
|
|
271
271
|
script.python_script = script_collection
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from flask import Blueprint, redirect, url_for, flash, request, render_template, session, current_app, jsonify
|
|
2
|
-
from flask_login import login_required
|
|
2
|
+
from flask_login import login_required, current_user
|
|
3
3
|
|
|
4
4
|
from ivoryos.utils.db_models import Script, db, WorkflowRun, WorkflowStep
|
|
5
5
|
from ivoryos.utils.utils import get_script_file, post_script_file
|
|
@@ -66,14 +66,14 @@ def publish():
|
|
|
66
66
|
script = get_script_file()
|
|
67
67
|
|
|
68
68
|
if script.author is None:
|
|
69
|
-
script.author =
|
|
69
|
+
script.author = current_user.get_id()
|
|
70
70
|
if not script.name or not script.deck:
|
|
71
71
|
return {"success": False, "error": "Deck cannot be empty, try to re-submit deck configuration on the left panel"}
|
|
72
72
|
row = Script.query.get(script.name)
|
|
73
73
|
if row and row.status == "finalized":
|
|
74
74
|
return {"success": False, "error": "This is a protected script, use save as to rename."}
|
|
75
75
|
|
|
76
|
-
elif row and
|
|
76
|
+
elif row and current_user.get_id() != row.author:
|
|
77
77
|
return {"success": False, "error": "You are not the author, use save as to rename."}
|
|
78
78
|
else:
|
|
79
79
|
db.session.merge(script)
|
|
@@ -145,7 +145,7 @@ def save_as():
|
|
|
145
145
|
script = get_script_file()
|
|
146
146
|
script.save_as(run_name)
|
|
147
147
|
script.registered = register_workflow == "on"
|
|
148
|
-
script.author =
|
|
148
|
+
script.author = current_user.get_id()
|
|
149
149
|
post_script_file(script)
|
|
150
150
|
status = publish()
|
|
151
151
|
if request.accept_mimetypes.best_match(['application/json', 'text/html']) == 'application/json':
|
|
@@ -66,7 +66,7 @@ class ScriptRunner:
|
|
|
66
66
|
global deck
|
|
67
67
|
if deck is None:
|
|
68
68
|
deck = global_config.deck
|
|
69
|
-
print("history", history)
|
|
69
|
+
# print("history", history)
|
|
70
70
|
if self.current_app is None:
|
|
71
71
|
self.current_app = current_app
|
|
72
72
|
# time.sleep(1) # Optional: may help ensure deck readiness
|
|
@@ -11,6 +11,7 @@ from collections import Counter
|
|
|
11
11
|
|
|
12
12
|
import flask
|
|
13
13
|
from flask import session
|
|
14
|
+
from flask_login import current_user
|
|
14
15
|
from flask_socketio import SocketIO
|
|
15
16
|
|
|
16
17
|
from ivoryos.utils.db_models import Script
|
|
@@ -24,7 +25,7 @@ def get_script_file():
|
|
|
24
25
|
s.__dict__.update(**session_script)
|
|
25
26
|
return s
|
|
26
27
|
else:
|
|
27
|
-
return Script(author=
|
|
28
|
+
return Script(author=current_user.get_id(),)
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
def post_script_file(script, is_dict=False):
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.2.1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ivoryos
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: an open-source Python package enabling Self-Driving Labs (SDLs) interoperability
|
|
5
5
|
Home-page: https://gitlab.com/heingroup/ivoryos
|
|
6
6
|
Author: Ivory Zhang
|
|
@@ -39,7 +39,7 @@ With the least modification of the current workflow, user can design, manage and
|
|
|
39
39
|
This software is developed and tested using Windows. This software and its dependencies are compatible across major platforms: Linux, macOS, and Windows. Some dependencies (Flask-SQLAlchemy) may require additional setup.
|
|
40
40
|
|
|
41
41
|
### Python Version
|
|
42
|
-
Python >=3.10 for best compatibility. Python >=3.7 without Ax.
|
|
42
|
+
Python >=3.10 for the best compatibility. Python >=3.7 without Ax.
|
|
43
43
|
### Python dependencies
|
|
44
44
|
This software is compatible with the latest versions of all dependencies.
|
|
45
45
|
- bcrypt~=4.0
|
|
@@ -50,7 +50,9 @@ This software is compatible with the latest versions of all dependencies.
|
|
|
50
50
|
- SQLAlchemy-Utils~=0.41
|
|
51
51
|
- Flask-WTF~=1.2
|
|
52
52
|
- python-dotenv==1.0.1
|
|
53
|
-
- ax-platform (optional
|
|
53
|
+
- ax-platform (optional 1.0 for Python>=3.10)
|
|
54
|
+
- baybe (optional)
|
|
55
|
+
|
|
54
56
|
|
|
55
57
|
## Installation
|
|
56
58
|
```bash
|
|
@@ -74,43 +76,60 @@ import ivoryos
|
|
|
74
76
|
ivoryos.run(__name__)
|
|
75
77
|
```
|
|
76
78
|
### Login
|
|
77
|
-
Create an account and login (local database)
|
|
79
|
+
Create an account and login (local database with bcrypt password)
|
|
78
80
|
### Features
|
|
79
|
-
- **Direct control**: direct function calling
|
|
80
|
-
- **
|
|
81
|
-
- **Design**: add function to canvas in _Design_ tab. click `Compile and Run` button to go to the execution page
|
|
82
|
-
- **Execution**: configure iteration methods and parameters in _Compile/Run_ tab.
|
|
83
|
-
- **
|
|
84
|
-
- **
|
|
81
|
+
- **Direct control**: direct function calling _Devices_ tab
|
|
82
|
+
- **Workflows**:
|
|
83
|
+
- **Design Editor**: drag/add function to canvas in _Design_ tab. click `Compile and Run` button to go to the execution configuration page
|
|
84
|
+
- **Execution Config**: configure iteration methods and parameters in _Compile/Run_ tab.
|
|
85
|
+
- **Design Library**: manage workflow scripts in _Library_ tab.
|
|
86
|
+
- **Workflow Data**: Execution records are in _Data_ tab.
|
|
85
87
|
|
|
86
88
|
[//]: # ()
|
|
87
89
|
|
|
88
90
|
[//]: # ()
|
|
89
91
|
|
|
90
92
|
|
|
91
|
-
### Additional settings
|
|
92
|
-
#### AI assistant
|
|
93
|
-
To streamline the experimental design on SDLs, we also integrate Large Language Models (LLMs) to interpret the inspected functions and generate code according to task descriptions.
|
|
93
|
+
### Additional settings
|
|
94
|
+
[//]: # (#### AI assistant)
|
|
94
95
|
|
|
95
|
-
|
|
96
|
-
1. Create a `.env` file for `OPENAI_API_KEY`
|
|
97
|
-
```
|
|
98
|
-
OPENAI_API_KEY="Your API Key"
|
|
99
|
-
```
|
|
100
|
-
2. In your SDL script, define model, you can use any GPT models.
|
|
96
|
+
[//]: # (To streamline the experimental design on SDLs, we also integrate Large Language Models (LLMs) to interpret the inspected functions and generate code according to task descriptions.)
|
|
101
97
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
```
|
|
98
|
+
[//]: # ()
|
|
99
|
+
[//]: # (#### Enable LLMs with [OpenAI API](https://github.com/openai/openai-python))
|
|
105
100
|
|
|
106
|
-
|
|
107
|
-
1. Download Ollama.
|
|
108
|
-
2. pull models from Ollama
|
|
109
|
-
3. In your SDL script, define LLM server and model, you can use any models available on Ollama.
|
|
101
|
+
[//]: # (1. Create a `.env` file for `OPENAI_API_KEY`)
|
|
110
102
|
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
|
|
103
|
+
[//]: # (```)
|
|
104
|
+
|
|
105
|
+
[//]: # (OPENAI_API_KEY="Your API Key")
|
|
106
|
+
|
|
107
|
+
[//]: # (```)
|
|
108
|
+
|
|
109
|
+
[//]: # (2. In your SDL script, define model, you can use any GPT models.)
|
|
110
|
+
|
|
111
|
+
[//]: # ()
|
|
112
|
+
[//]: # (```python)
|
|
113
|
+
|
|
114
|
+
[//]: # (ivoryos.run(__name__, model="gpt-3.5-turbo"))
|
|
115
|
+
|
|
116
|
+
[//]: # (```)
|
|
117
|
+
|
|
118
|
+
[//]: # ()
|
|
119
|
+
[//]: # (#### Enable local LLMs with [Ollama](https://ollama.com/))
|
|
120
|
+
|
|
121
|
+
[//]: # (1. Download Ollama.)
|
|
122
|
+
|
|
123
|
+
[//]: # (2. pull models from Ollama)
|
|
124
|
+
|
|
125
|
+
[//]: # (3. In your SDL script, define LLM server and model, you can use any models available on Ollama.)
|
|
126
|
+
|
|
127
|
+
[//]: # ()
|
|
128
|
+
[//]: # (```python)
|
|
129
|
+
|
|
130
|
+
[//]: # (ivoryos.run(__name__, llm_server="localhost", model="llama3.1"))
|
|
131
|
+
|
|
132
|
+
[//]: # (```)
|
|
114
133
|
|
|
115
134
|
#### Add additional logger(s)
|
|
116
135
|
```python
|
|
@@ -135,7 +154,7 @@ ivoryos.run(__name__)
|
|
|
135
154
|
|
|
136
155
|
* Running on all addresses (0.0.0.0)
|
|
137
156
|
* Running on http://127.0.0.1:8000
|
|
138
|
-
* Running on http://
|
|
157
|
+
* Running on http://0.0.0.0:8000
|
|
139
158
|
|
|
140
159
|
### Deck function and web form
|
|
141
160
|

|
|
@@ -163,6 +182,8 @@ When you run the application for the first time, it will automatically create th
|
|
|
163
182
|
- [x] dropdown input ✅
|
|
164
183
|
- [x] show line number option ✅
|
|
165
184
|
- [ ] snapshot version control
|
|
185
|
+
- [ ] optimizer-agnostic
|
|
186
|
+
- [ ] check batch-config file compatibility
|
|
166
187
|
|
|
167
188
|
## Citing
|
|
168
189
|
|
|
@@ -203,4 +224,4 @@ For an additional perspective related to the development of the tool, please see
|
|
|
203
224
|
## Authors and Acknowledgement
|
|
204
225
|
Ivory Zhang, Lucy Hao
|
|
205
226
|
|
|
206
|
-
Authors acknowledge
|
|
227
|
+
Authors acknowledge Telescope Innovations, Hein Lab members for their valuable suggestions and contributions.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
setup.py
|
|
4
|
+
ivoryos/__init__.py
|
|
5
|
+
ivoryos/config.py
|
|
6
|
+
ivoryos/socket_handlers.py
|
|
7
|
+
ivoryos/version.py
|
|
8
|
+
ivoryos.egg-info/PKG-INFO
|
|
9
|
+
ivoryos.egg-info/SOURCES.txt
|
|
10
|
+
ivoryos.egg-info/dependency_links.txt
|
|
11
|
+
ivoryos.egg-info/requires.txt
|
|
12
|
+
ivoryos.egg-info/top_level.txt
|
|
13
|
+
ivoryos/routes/__init__.py
|
|
14
|
+
ivoryos/routes/auth/__init__.py
|
|
15
|
+
ivoryos/routes/auth/auth.py
|
|
16
|
+
ivoryos/routes/control/__init__.py
|
|
17
|
+
ivoryos/routes/control/control.py
|
|
18
|
+
ivoryos/routes/control/control_file.py
|
|
19
|
+
ivoryos/routes/control/control_new_device.py
|
|
20
|
+
ivoryos/routes/control/utils.py
|
|
21
|
+
ivoryos/routes/data/__init__.py
|
|
22
|
+
ivoryos/routes/data/data.py
|
|
23
|
+
ivoryos/routes/design/__init__.py
|
|
24
|
+
ivoryos/routes/design/design.py
|
|
25
|
+
ivoryos/routes/design/design_file.py
|
|
26
|
+
ivoryos/routes/design/design_step.py
|
|
27
|
+
ivoryos/routes/execute/__init__.py
|
|
28
|
+
ivoryos/routes/execute/execute.py
|
|
29
|
+
ivoryos/routes/execute/execute_file.py
|
|
30
|
+
ivoryos/routes/library/__init__.py
|
|
31
|
+
ivoryos/routes/library/library.py
|
|
32
|
+
ivoryos/routes/main/__init__.py
|
|
33
|
+
ivoryos/routes/main/main.py
|
|
34
|
+
ivoryos/utils/__init__.py
|
|
35
|
+
ivoryos/utils/bo_campaign.py
|
|
36
|
+
ivoryos/utils/client_proxy.py
|
|
37
|
+
ivoryos/utils/db_models.py
|
|
38
|
+
ivoryos/utils/form.py
|
|
39
|
+
ivoryos/utils/global_config.py
|
|
40
|
+
ivoryos/utils/llm_agent.py
|
|
41
|
+
ivoryos/utils/py_to_json.py
|
|
42
|
+
ivoryos/utils/script_runner.py
|
|
43
|
+
ivoryos/utils/serilize.py
|
|
44
|
+
ivoryos/utils/task_runner.py
|
|
45
|
+
ivoryos/utils/utils.py
|
|
46
|
+
tests/__init__.py
|
|
47
|
+
tests/conftest.py
|
|
48
|
+
tests/integration/__init__.py
|
|
49
|
+
tests/integration/test_route_auth.py
|
|
50
|
+
tests/integration/test_route_control.py
|
|
51
|
+
tests/integration/test_route_database.py
|
|
52
|
+
tests/integration/test_route_design.py
|
|
53
|
+
tests/integration/test_route_main.py
|
|
54
|
+
tests/integration/test_sockets.py
|