ivoryos 1.2.0b1__py3-none-any.whl → 1.2.1__py3-none-any.whl

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.

Files changed (69) hide show
  1. ivoryos/__init__.py +22 -1
  2. ivoryos/config.py +1 -0
  3. ivoryos/routes/auth/auth.py +3 -1
  4. ivoryos/routes/data/data.py +2 -0
  5. ivoryos/routes/design/design.py +4 -4
  6. ivoryos/routes/library/library.py +4 -4
  7. ivoryos/utils/script_runner.py +1 -1
  8. ivoryos/utils/utils.py +2 -1
  9. ivoryos/version.py +1 -1
  10. {ivoryos-1.2.0b1.dist-info → ivoryos-1.2.1.dist-info}/METADATA +52 -31
  11. ivoryos-1.2.1.dist-info/RECORD +51 -0
  12. ivoryos/routes/api/api.py +0 -56
  13. ivoryos/routes/auth/templates/login.html +0 -25
  14. ivoryos/routes/auth/templates/signup.html +0 -32
  15. ivoryos/routes/control/templates/controllers.html +0 -166
  16. ivoryos/routes/control/templates/controllers_new.html +0 -112
  17. ivoryos/routes/data/templates/components/step_card.html +0 -13
  18. ivoryos/routes/data/templates/workflow_database.html +0 -109
  19. ivoryos/routes/data/templates/workflow_view.html +0 -130
  20. ivoryos/routes/design/templates/components/action_form.html +0 -53
  21. ivoryos/routes/design/templates/components/actions_panel.html +0 -25
  22. ivoryos/routes/design/templates/components/autofill_toggle.html +0 -10
  23. ivoryos/routes/design/templates/components/canvas.html +0 -5
  24. ivoryos/routes/design/templates/components/canvas_footer.html +0 -9
  25. ivoryos/routes/design/templates/components/canvas_header.html +0 -75
  26. ivoryos/routes/design/templates/components/canvas_main.html +0 -34
  27. ivoryos/routes/design/templates/components/deck_selector.html +0 -10
  28. ivoryos/routes/design/templates/components/edit_action_form.html +0 -38
  29. ivoryos/routes/design/templates/components/instruments_panel.html +0 -66
  30. ivoryos/routes/design/templates/components/modals/drop_modal.html +0 -17
  31. ivoryos/routes/design/templates/components/modals/json_modal.html +0 -22
  32. ivoryos/routes/design/templates/components/modals/new_script_modal.html +0 -17
  33. ivoryos/routes/design/templates/components/modals/rename_modal.html +0 -23
  34. ivoryos/routes/design/templates/components/modals/saveas_modal.html +0 -27
  35. ivoryos/routes/design/templates/components/modals.html +0 -6
  36. ivoryos/routes/design/templates/components/python_code_overlay.html +0 -39
  37. ivoryos/routes/design/templates/components/sidebar.html +0 -15
  38. ivoryos/routes/design/templates/components/text_to_code_panel.html +0 -20
  39. ivoryos/routes/design/templates/experiment_builder.html +0 -41
  40. ivoryos/routes/execute/templates/components/error_modal.html +0 -20
  41. ivoryos/routes/execute/templates/components/logging_panel.html +0 -31
  42. ivoryos/routes/execute/templates/components/progress_panel.html +0 -27
  43. ivoryos/routes/execute/templates/components/run_panel.html +0 -9
  44. ivoryos/routes/execute/templates/components/run_tabs.html +0 -17
  45. ivoryos/routes/execute/templates/components/tab_bayesian.html +0 -399
  46. ivoryos/routes/execute/templates/components/tab_configuration.html +0 -98
  47. ivoryos/routes/execute/templates/components/tab_repeat.html +0 -14
  48. ivoryos/routes/execute/templates/experiment_run.html +0 -294
  49. ivoryos/routes/library/templates/library.html +0 -91
  50. ivoryos/routes/main/templates/help.html +0 -141
  51. ivoryos/routes/main/templates/home.html +0 -103
  52. ivoryos/static/favicon.ico +0 -0
  53. ivoryos/static/gui_annotation/Slide1.png +0 -0
  54. ivoryos/static/gui_annotation/Slide2.PNG +0 -0
  55. ivoryos/static/js/action_handlers.js +0 -213
  56. ivoryos/static/js/db_delete.js +0 -23
  57. ivoryos/static/js/overlay.js +0 -12
  58. ivoryos/static/js/script_metadata.js +0 -39
  59. ivoryos/static/js/socket_handler.js +0 -125
  60. ivoryos/static/js/sortable_card.js +0 -24
  61. ivoryos/static/js/sortable_design.js +0 -138
  62. ivoryos/static/js/ui_state.js +0 -113
  63. ivoryos/static/logo.webp +0 -0
  64. ivoryos/static/style.css +0 -211
  65. ivoryos/templates/base.html +0 -157
  66. ivoryos-1.2.0b1.dist-info/RECORD +0 -105
  67. {ivoryos-1.2.0b1.dist-info → ivoryos-1.2.1.dist-info}/LICENSE +0 -0
  68. {ivoryos-1.2.0b1.dist-info → ivoryos-1.2.1.dist-info}/WHEEL +0 -0
  69. {ivoryos-1.2.0b1.dist-info → ivoryos-1.2.1.dist-info}/top_level.txt +0 -0
ivoryos/__init__.py CHANGED
@@ -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
 
ivoryos/config.py CHANGED
@@ -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
- session['user'] = username
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=session.get('username'))
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=session.get('user'), deck=deck_name)
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 = session.get('user')
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 session.get('user') != row.author:
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 = session.get('user')
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
ivoryos/utils/utils.py CHANGED
@@ -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=session.get('user'))
28
+ return Script(author=current_user.get_id(),)
28
29
 
29
30
 
30
31
  def post_script_file(script, is_dict=False):
ivoryos/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.2.0b1"
1
+ __version__ = "1.2.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ivoryos
3
- Version: 1.2.0b1
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
@@ -48,7 +48,7 @@ With the least modification of the current workflow, user can design, manage and
48
48
  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.
49
49
 
50
50
  ### Python Version
51
- Python >=3.10 for best compatibility. Python >=3.7 without Ax.
51
+ Python >=3.10 for the best compatibility. Python >=3.7 without Ax.
52
52
  ### Python dependencies
53
53
  This software is compatible with the latest versions of all dependencies.
54
54
  - bcrypt~=4.0
@@ -59,7 +59,9 @@ This software is compatible with the latest versions of all dependencies.
59
59
  - SQLAlchemy-Utils~=0.41
60
60
  - Flask-WTF~=1.2
61
61
  - python-dotenv==1.0.1
62
- - ax-platform (optional ~=0.4 for Python>=3.9)
62
+ - ax-platform (optional 1.0 for Python>=3.10)
63
+ - baybe (optional)
64
+
63
65
 
64
66
  ## Installation
65
67
  ```bash
@@ -83,43 +85,60 @@ import ivoryos
83
85
  ivoryos.run(__name__)
84
86
  ```
85
87
  ### Login
86
- Create an account and login (local database)
88
+ Create an account and login (local database with bcrypt password)
87
89
  ### Features
88
- - **Direct control**: direct function calling _Device_ tab
89
- - **Workflow design and iteration**:
90
- - **Design**: add function to canvas in _Design_ tab. click `Compile and Run` button to go to the execution page
91
- - **Execution**: configure iteration methods and parameters in _Compile/Run_ tab.
92
- - **Database**: manage workflows in _Library_ tab.
93
- - **Info page**: additional info in _About_ tab.
90
+ - **Direct control**: direct function calling _Devices_ tab
91
+ - **Workflows**:
92
+ - **Design Editor**: drag/add function to canvas in _Design_ tab. click `Compile and Run` button to go to the execution configuration page
93
+ - **Execution Config**: configure iteration methods and parameters in _Compile/Run_ tab.
94
+ - **Design Library**: manage workflow scripts in _Library_ tab.
95
+ - **Workflow Data**: Execution records are in _Data_ tab.
94
96
 
95
97
  [//]: # (![Discord]&#40;https://img.shields.io/discord/1313641159356059770&#41;)
96
98
 
97
99
  [//]: # (![PyPI - Downloads]&#40;https://img.shields.io/pypi/dm/ivoryos&#41;)
98
100
 
99
101
 
100
- ### Additional settings (not actively maintained)
101
- #### AI assistant
102
- 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.
102
+ ### Additional settings
103
+ [//]: # (#### AI assistant)
103
104
 
104
- #### Enable LLMs with [OpenAI API](https://github.com/openai/openai-python)
105
- 1. Create a `.env` file for `OPENAI_API_KEY`
106
- ```
107
- OPENAI_API_KEY="Your API Key"
108
- ```
109
- 2. In your SDL script, define model, you can use any GPT models.
105
+ [//]: # (To streamline the experimental design on SDLs, we also integrate Large Language Models &#40;LLMs&#41; to interpret the inspected functions and generate code according to task descriptions.)
110
106
 
111
- ```python
112
- ivoryos.run(__name__, model="gpt-3.5-turbo")
113
- ```
107
+ [//]: # ()
108
+ [//]: # (#### Enable LLMs with [OpenAI API]&#40;https://github.com/openai/openai-python&#41;)
114
109
 
115
- #### Enable local LLMs with [Ollama](https://ollama.com/)
116
- 1. Download Ollama.
117
- 2. pull models from Ollama
118
- 3. In your SDL script, define LLM server and model, you can use any models available on Ollama.
110
+ [//]: # (1. Create a `.env` file for `OPENAI_API_KEY`)
119
111
 
120
- ```python
121
- ivoryos.run(__name__, llm_server="localhost", model="llama3.1")
122
- ```
112
+ [//]: # (```)
113
+
114
+ [//]: # (OPENAI_API_KEY="Your API Key")
115
+
116
+ [//]: # (```)
117
+
118
+ [//]: # (2. In your SDL script, define model, you can use any GPT models.)
119
+
120
+ [//]: # ()
121
+ [//]: # (```python)
122
+
123
+ [//]: # (ivoryos.run&#40;__name__, model="gpt-3.5-turbo"&#41;)
124
+
125
+ [//]: # (```)
126
+
127
+ [//]: # ()
128
+ [//]: # (#### Enable local LLMs with [Ollama]&#40;https://ollama.com/&#41;)
129
+
130
+ [//]: # (1. Download Ollama.)
131
+
132
+ [//]: # (2. pull models from Ollama)
133
+
134
+ [//]: # (3. In your SDL script, define LLM server and model, you can use any models available on Ollama.)
135
+
136
+ [//]: # ()
137
+ [//]: # (```python)
138
+
139
+ [//]: # (ivoryos.run&#40;__name__, llm_server="localhost", model="llama3.1"&#41;)
140
+
141
+ [//]: # (```)
123
142
 
124
143
  #### Add additional logger(s)
125
144
  ```python
@@ -144,7 +163,7 @@ ivoryos.run(__name__)
144
163
 
145
164
  * Running on all addresses (0.0.0.0)
146
165
  * Running on http://127.0.0.1:8000
147
- * Running on http://xxx.xx.xx.xxx:8000
166
+ * Running on http://0.0.0.0:8000
148
167
 
149
168
  ### Deck function and web form
150
169
  ![](https://gitlab.com/heingroup/ivoryos/raw/main/docs/source/_static/demo.gif)
@@ -172,6 +191,8 @@ When you run the application for the first time, it will automatically create th
172
191
  - [x] dropdown input ✅
173
192
  - [x] show line number option ✅
174
193
  - [ ] snapshot version control
194
+ - [ ] optimizer-agnostic
195
+ - [ ] check batch-config file compatibility
175
196
 
176
197
  ## Citing
177
198
 
@@ -212,4 +233,4 @@ For an additional perspective related to the development of the tool, please see
212
233
  ## Authors and Acknowledgement
213
234
  Ivory Zhang, Lucy Hao
214
235
 
215
- Authors acknowledge all former and current Hein Lab members for their valuable suggestions.
236
+ Authors acknowledge Telescope Innovations, Hein Lab members for their valuable suggestions and contributions.
@@ -0,0 +1,51 @@
1
+ ivoryos/__init__.py,sha256=x4PnDTbhx1ZTugfuclGQ03GO3yidAfiUFU7vuGyKD8M,9830
2
+ ivoryos/config.py,sha256=y3RxNjiIola9tK7jg-mHM8EzLMwiLwOzoisXkDvj0gA,2174
3
+ ivoryos/socket_handlers.py,sha256=VWVWiIdm4jYAutwGu6R0t1nK5MuMyOCL0xAnFn06jWQ,1302
4
+ ivoryos/version.py,sha256=Mlm4Gvmb_6yQxwUbv2Ksc-BJFXLPg9H1Vt2iV7wXrA4,22
5
+ ivoryos/routes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ ivoryos/routes/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ ivoryos/routes/auth/auth.py,sha256=CqoP9cM8BuXVGHGujX7-0sNAOdWILU9amyBrObOD6Ss,3283
8
+ ivoryos/routes/control/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
+ ivoryos/routes/control/control.py,sha256=Vmy3GRZz8EbKmV9qslR8gsaYaYzb5HQTpukp42HfMow,5236
10
+ ivoryos/routes/control/control_file.py,sha256=NIAzwhswvpl3u0mansy1ku-rPDybS5hVbmbnymOikWk,1548
11
+ ivoryos/routes/control/control_new_device.py,sha256=mfJKg5JAOagIpUKbp2b5nRwvd2V3bzT3M0zIhIsEaFM,5456
12
+ ivoryos/routes/control/utils.py,sha256=at11wA5HPAZN4BfMaymj1GKEvRTrqi4Wg6cTqUZJDjU,1155
13
+ ivoryos/routes/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ ivoryos/routes/data/data.py,sha256=AoqCaIAK0f9hstF1pxlJFeK_J-wKbMfXWGNDUbaBFFk,4218
15
+ ivoryos/routes/design/__init__.py,sha256=zS3HXKaw0ALL5n6t_W1rUz5Uj5_tTQ-Y1VMXyzewvR0,113
16
+ ivoryos/routes/design/design.py,sha256=F5X0Wa1sXSdolQ8w87wQBv6bN7jMwCnQ4jX8r4SkO24,17763
17
+ ivoryos/routes/design/design_file.py,sha256=m4yku8fkpLUs4XvLJBqR5V-kyaGKbGB6ZoRxGbjEU5Q,2140
18
+ ivoryos/routes/design/design_step.py,sha256=l8U3-FuXmap__sYm51AueKdbTaLCFaKjAz-j02b4g-E,5200
19
+ ivoryos/routes/execute/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
+ ivoryos/routes/execute/execute.py,sha256=hFnCvzO1OzR0XckCRzHfP_RZV70DtbH_p7kw1YhIe3o,12250
21
+ ivoryos/routes/execute/execute_file.py,sha256=TelWYV295p4ZPhkUDJSVxfYROfVaKodEmDPTS2plQHI,2816
22
+ ivoryos/routes/library/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
+ ivoryos/routes/library/library.py,sha256=ZruIoaa06GlqpvJ383PSDEFdlPJFl2E2YI0H8aK7Hc0,5477
24
+ ivoryos/routes/main/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
+ ivoryos/routes/main/main.py,sha256=1AcSouCocHWjlpEED-ECn5OFiu0-3u0N-0st5RtKCVY,952
26
+ ivoryos/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
+ ivoryos/utils/bo_campaign.py,sha256=Fil-zT7JexL_p9XqyWByjAk42XB1R9XUKN8CdV5bi6c,9714
28
+ ivoryos/utils/client_proxy.py,sha256=0OT2xTMkqh_2ybgCxMV_71ZVUThWwrsnAhTIBY5vDR8,2095
29
+ ivoryos/utils/db_models.py,sha256=baE4LJcSGUj10Tj6imfINXi4JQX_4oLv_kb9bd0rp-M,27920
30
+ ivoryos/utils/form.py,sha256=eIk1N77Ynxc4Omww5ZYlmpOIJfQPWto2qfiU6nzIIeQ,21755
31
+ ivoryos/utils/global_config.py,sha256=zNO9GYhGn7El3msWoxJIm3S4Mzb3VMh2i5ZEsVtvb2Q,2463
32
+ ivoryos/utils/llm_agent.py,sha256=-lVCkjPlpLues9sNTmaT7bT4sdhWvV2DiojNwzB2Lcw,6422
33
+ ivoryos/utils/py_to_json.py,sha256=fyqjaxDHPh-sahgT6IHSn34ktwf6y51_x1qvhbNlH-U,7314
34
+ ivoryos/utils/script_runner.py,sha256=g3_pLYcu6gF9sPjhW9WRlwMH7ScDpz_MqMJzxNayfyg,16725
35
+ ivoryos/utils/serilize.py,sha256=Ded3Vbicl4KYN8GJ_gY7HJMuInAeFZEPk5ZtuEtHPns,6933
36
+ ivoryos/utils/task_runner.py,sha256=cDIcmDaqYh0vXoYaL_kO877pluAo2tyfsHl9OgZqJJE,3029
37
+ ivoryos/utils/utils.py,sha256=-WiU0_brszB9yDsiQepf_7SzNgPTSpul2RSKDOY3pqo,13921
38
+ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
+ tests/conftest.py,sha256=u2sQ6U-Lghyl7et1Oz6J2E5VZ47VINKcjRM_2leAE2s,3627
40
+ tests/integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
+ tests/integration/test_route_auth.py,sha256=l3ZDqr0oiCWS3yYSXGK5yMP6qI2t7Sv5I9zoYTkiyQU,2754
42
+ tests/integration/test_route_control.py,sha256=YYIll84bTUEKiAxFiFSz6LF3fTldPNfCtHs0IR3mSdM,3935
43
+ tests/integration/test_route_database.py,sha256=mS026W_hEuCTMpSkdRWvM-f4MYykK_6nRDJ4K5a7QA0,2342
44
+ tests/integration/test_route_design.py,sha256=PJAvGRiCY6B53Pu1v5vPAVHHsuaqRmRKk2eesSNshLU,1157
45
+ tests/integration/test_route_main.py,sha256=bmuf8Y_9CRWhiLLf4up11ltEd5YCdsLx6I-o26VGDEw,1228
46
+ tests/integration/test_sockets.py,sha256=4ZyFyExm7a-DYzVqpzEONpWeb1a0IT68wyFaQu0rY_Y,925
47
+ ivoryos-1.2.1.dist-info/LICENSE,sha256=p2c8S8i-8YqMpZCJnadLz1-ofxnRMILzz6NCMIypRag,1084
48
+ ivoryos-1.2.1.dist-info/METADATA,sha256=AiQqfIiig_KOYF5ths0jGNMbax1YV44deM6wKwHwnAY,9247
49
+ ivoryos-1.2.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
50
+ ivoryos-1.2.1.dist-info/top_level.txt,sha256=mIOiZkdpSwxFJt1R5fsyOff8mNprXHq1nMGNKNULIyE,14
51
+ ivoryos-1.2.1.dist-info/RECORD,,
ivoryos/routes/api/api.py DELETED
@@ -1,56 +0,0 @@
1
- import os
2
- from flask import Blueprint, jsonify, request, current_app
3
-
4
- from ivoryos.routes.control.control import find_instrument_by_name
5
- from ivoryos.utils.form import create_form_from_module
6
- from ivoryos.utils.global_config import GlobalConfig
7
- from ivoryos.utils.db_models import Script, WorkflowRun, SingleStep, WorkflowStep
8
-
9
- from ivoryos.socket_handlers import abort_pending, abort_current, pause, retry, runner
10
- from ivoryos.utils.task_runner import TaskRunner
11
-
12
- api = Blueprint('api', __name__)
13
- global_config = GlobalConfig()
14
- task_runner = TaskRunner()
15
-
16
- #TODO: add authentication and authorization to the API endpoints
17
-
18
-
19
- @api.route("/control/", strict_slashes=False, methods=['GET'])
20
- @api.route("/control/<string:instrument>", methods=['POST'])
21
- def backend_control(instrument: str=None):
22
- """
23
- .. :quickref: Backend Control; backend control
24
-
25
- backend control through http requests
26
-
27
- .. http:get:: /api/control/
28
-
29
- :param instrument: instrument name
30
- :type instrument: str
31
-
32
- .. http:post:: /api/control/
33
-
34
- """
35
- if instrument:
36
- inst_object = find_instrument_by_name(instrument)
37
- forms = create_form_from_module(sdl_module=inst_object, autofill=False, design=False)
38
-
39
- if request.method == 'POST':
40
- method_name = request.form.get("hidden_name", None)
41
- form = forms.get(method_name, None)
42
- if form:
43
- kwargs = {field.name: field.data for field in form if field.name not in ['csrf_token', 'hidden_name']}
44
- wait = request.form.get("hidden_wait", "true") == "true"
45
- output = task_runner.run_single_step(component=instrument, method=method_name, kwargs=kwargs, wait=wait,
46
- current_app=current_app._get_current_object())
47
- return jsonify(output), 200
48
-
49
- snapshot = global_config.deck_snapshot.copy()
50
- # Iterate through each instrument in the snapshot
51
- for instrument_key, instrument_data in snapshot.items():
52
- # Iterate through each function associated with the current instrument
53
- for function_key, function_data in instrument_data.items():
54
- # Convert the function signature to a string representation
55
- function_data['signature'] = str(function_data['signature'])
56
- return jsonify(snapshot), 200
@@ -1,25 +0,0 @@
1
- {% extends 'base.html' %}
2
- {% block title %}IvoryOS | Login{% endblock %}
3
-
4
-
5
- {% block body %}
6
- <div class= "login">
7
- <div class="bg-white rounded shadow-sm flex-fill">
8
- <div class="p-4" style="align-items: center">
9
- <h5>Log in</h5>
10
- <form role="form" method='POST' name="login" action="{{ url_for('auth.login') }}">
11
- <div class="input-group mb-3">
12
- <label class="input-group-text" for="username">Username</label>
13
- <input class="form-control" type="text" id="username" name="username">
14
- </div>
15
- <div class="input-group mb-3">
16
- <label class="input-group-text" for="password">Password</label>
17
- <input class="form-control" type="password" id="password" name="password">
18
- </div>
19
- <button type="submit" class="btn btn-secondary" name="login" style="width: 100%;">login</button>
20
- </form>
21
- <p class="message">Not registered? <a href="{{ url_for('auth.signup') }}">Create a new account</a>
22
- </div>
23
- </div>
24
- </div>
25
- {% endblock %}
@@ -1,32 +0,0 @@
1
- {% extends 'base.html' %}
2
- {% block title %}IvoryOS | Signup{% endblock %}
3
-
4
-
5
- {% block body %}
6
- <div class= "login">
7
- <div class="bg-white rounded shadow-sm flex-fill">
8
- <div class="p-4" style="align: center">
9
- <h5>Create a new account</h5>
10
- <form role="form" method='POST' name="signup" action="{{ url_for('auth.signup') }}">
11
-
12
- <div class="input-group mb-3">
13
- <label class="input-group-text" for="username">Username</label>
14
- <input class="form-control" type="text" id="username" name="username" required>
15
- </div>
16
- <div class="input-group mb-3">
17
- <label class="input-group-text" for="password">Password</label>
18
- <input class="form-control" type="password" id="password" name="password" required>
19
- </div>
20
- {# <div class="input-group mb-3">#}
21
- {# <label class="input-group-text" for="confirm_password">Confirm Password</label>#}
22
- {# <input class="form-control" type="confirm_password" id="confirm_password" name="confirm_password">#}
23
- {# </div>#}
24
-
25
- <button type="submit" class="btn btn-secondary" name="login" style="width: 100%;">Sign up</button>
26
- </form>
27
- <p class="message" >Already registered? <a href="{{ url_for('auth.login') }}">Sign In</a></p>
28
- </div>
29
- </div>
30
- </div>
31
-
32
- {% endblock %}