ivoryos 0.1.7__tar.gz → 0.1.9__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.

Files changed (51) hide show
  1. {ivoryos-0.1.7/ivoryos.egg-info → ivoryos-0.1.9}/PKG-INFO +4 -1
  2. {ivoryos-0.1.7 → ivoryos-0.1.9}/README.md +3 -0
  3. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/__init__.py +1 -1
  4. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/routes/control/templates/control/controllers.html +1 -1
  5. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/routes/database/database.py +0 -9
  6. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/routes/design/design.py +22 -1
  7. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/routes/design/templates/design/experiment_builder.html +5 -2
  8. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/templates/base.html +1 -1
  9. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/utils/db_models.py +21 -3
  10. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/utils/form.py +4 -3
  11. {ivoryos-0.1.7 → ivoryos-0.1.9/ivoryos.egg-info}/PKG-INFO +4 -1
  12. {ivoryos-0.1.7 → ivoryos-0.1.9}/setup.py +1 -1
  13. {ivoryos-0.1.7 → ivoryos-0.1.9}/LICENSE +0 -0
  14. {ivoryos-0.1.7 → ivoryos-0.1.9}/MANIFEST.in +0 -0
  15. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/config.py +0 -0
  16. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/routes/__init__.py +0 -0
  17. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/routes/auth/__init__.py +0 -0
  18. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/routes/auth/auth.py +0 -0
  19. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/routes/auth/templates/auth/login.html +0 -0
  20. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/routes/auth/templates/auth/signup.html +0 -0
  21. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/routes/control/__init__.py +0 -0
  22. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/routes/control/control.py +0 -0
  23. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/routes/control/templates/control/controllers_home.html +0 -0
  24. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/routes/control/templates/control/controllers_new.html +0 -0
  25. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/routes/database/__init__.py +0 -0
  26. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/routes/database/templates/database/experiment_database.html +0 -0
  27. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/routes/design/__init__.py +0 -0
  28. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/routes/design/templates/design/experiment_run.html +0 -0
  29. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/routes/main/__init__.py +0 -0
  30. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/routes/main/main.py +0 -0
  31. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/routes/main/templates/main/help.html +0 -0
  32. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/routes/main/templates/main/home.html +0 -0
  33. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/static/favicon.ico +0 -0
  34. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/static/gui_annotation/Slide1.png +0 -0
  35. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/static/gui_annotation/Slide2.PNG +0 -0
  36. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/static/js/overlay.js +0 -0
  37. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/static/js/socket_handler.js +0 -0
  38. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/static/js/sortable_card.js +0 -0
  39. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/static/js/sortable_design.js +0 -0
  40. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/static/logo.webp +0 -0
  41. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/static/style.css +0 -0
  42. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/utils/__init__.py +0 -0
  43. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/utils/global_config.py +0 -0
  44. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/utils/llm_agent.py +0 -0
  45. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/utils/script_runner.py +0 -0
  46. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos/utils/utils.py +0 -0
  47. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos.egg-info/SOURCES.txt +0 -0
  48. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos.egg-info/dependency_links.txt +0 -0
  49. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos.egg-info/requires.txt +0 -0
  50. {ivoryos-0.1.7 → ivoryos-0.1.9}/ivoryos.egg-info/top_level.txt +0 -0
  51. {ivoryos-0.1.7 → ivoryos-0.1.9}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ivoryos
3
- Version: 0.1.7
3
+ Version: 0.1.9
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
@@ -137,6 +137,9 @@ ivoryos.run(__name__)
137
137
  ### Deck function and web form
138
138
  ![](https://gitlab.com/heingroup/ivoryos/raw/main/docs/demo.gif)
139
139
 
140
+ ### Text-to-code demo
141
+ ![](https://gitlab.com/heingroup/ivoryos/raw/main/docs/text-to-code.gif)
142
+
140
143
  ### Directory structure
141
144
 
142
145
  When you run the application for the first time, it will automatically create the following folders and files in the same directory:
@@ -118,6 +118,9 @@ ivoryos.run(__name__)
118
118
  ### Deck function and web form
119
119
  ![](https://gitlab.com/heingroup/ivoryos/raw/main/docs/demo.gif)
120
120
 
121
+ ### Text-to-code demo
122
+ ![](https://gitlab.com/heingroup/ivoryos/raw/main/docs/text-to-code.gif)
123
+
121
124
  ### Directory structure
122
125
 
123
126
  When you run the application for the first time, it will automatically create the following folders and files in the same directory:
@@ -19,7 +19,7 @@ global_config = GlobalConfig()
19
19
 
20
20
 
21
21
  def create_app(config_class=None):
22
- url_prefix = os.getenv('URL_PREFIX', None)
22
+ url_prefix = os.getenv('URL_PREFIX', "/ivoryos")
23
23
  app = Flask(__name__, static_url_path=f'{url_prefix}/static', static_folder='static')
24
24
  app.config.from_object(config_class or 'config.get_config()')
25
25
 
@@ -37,7 +37,7 @@
37
37
  {% endfor %}
38
38
  </div>
39
39
  <div class="input-group mb-3">
40
- <button type="submit" name="{{ function }}" id="{{ function }}" class="form-control" style="background-color: #a5cece;">{{function}} </button>
40
+ <button type="submit" name="{{ function }}" id="{{ function }}" class="form-control" style="background-color: #a5cece;">{{format_name(function)}} </button>
41
41
  </div>
42
42
  </form>
43
43
  </div>
@@ -7,15 +7,6 @@ from ivoryos.utils.utils import get_script_file, post_script_file
7
7
  database = Blueprint('database', __name__, template_folder='templates/database')
8
8
 
9
9
 
10
- @database.route("/delete/<id>")
11
- @login_required
12
- def delete_action(id):
13
- back = request.referrer
14
- script = get_script_file()
15
- script.delete_action(id)
16
- post_script_file(script)
17
- return redirect(back)
18
-
19
10
 
20
11
  @database.route("/edit_workflow/<workflow_name>")
21
12
  @login_required
@@ -13,7 +13,7 @@ from werkzeug.utils import secure_filename
13
13
  from ivoryos.utils import utils
14
14
  from ivoryos.utils.global_config import GlobalConfig
15
15
  from ivoryos.utils.form import create_builtin_form, create_action_button, format_name, create_form_from_pseudo
16
- from ivoryos.utils.llm_agent import LlmAgent
16
+
17
17
  from ivoryos.utils.db_models import Script
18
18
  from ivoryos.utils.script_runner import ScriptRunner
19
19
 
@@ -165,6 +165,7 @@ def generate_code():
165
165
  model = current_app.config["LLM_MODEL"]
166
166
  server = current_app.config["LLM_SERVER"]
167
167
  module = current_app.config["MODULE"]
168
+ from ivoryos.utils.llm_agent import LlmAgent
168
169
  agent = LlmAgent(host=server, model=model, output_path=os.path.dirname(os.path.abspath(module)))
169
170
  except Exception as e:
170
171
  flash(e.__str__())
@@ -394,3 +395,23 @@ def edit_action(uuid):
394
395
  flash(e.__str__())
395
396
  session.pop('edit_action')
396
397
  return redirect(url_for('design.experiment_builder'))
398
+
399
+
400
+ @design.route("/delete/<id>", methods=['GET', 'POST'])
401
+ @login_required
402
+ def delete_action(id):
403
+ back = request.referrer
404
+ script = utils.get_script_file()
405
+ script.delete_action(id)
406
+ utils.post_script_file(script)
407
+ return redirect(back)
408
+
409
+
410
+ @design.route("/duplicate/<id>", methods=['GET', 'POST'])
411
+ @login_required
412
+ def duplicate_action(id):
413
+ back = request.referrer
414
+ script = utils.get_script_file()
415
+ script.duplicate_action(id)
416
+ utils.post_script_file(script)
417
+ return redirect(back)
@@ -301,8 +301,11 @@
301
301
  <ul class="reorder">
302
302
  {% for button in buttons %}
303
303
  <li id="{{ button['id'] }}" style="list-style-type: none;">
304
- <a href="{{ url_for('design.edit_action', uuid=button['uuid']) }}" type="button" class="btn btn-light" style="{{ button['style'] }}">{{ button['label'] }}</a>
305
- <a href="/delete/{{ button['id'] }}" type="button" class="btn btn-light"><span class="bi bi-trash"></span></a>
304
+ <a href="{{ url_for('design.edit_action', uuid=button['uuid']) }}" type="button" class="btn btn-light" style="{{ button['style'] }}">{{ button['label'] }}</a>
305
+ {% if not button["instrument"] in ["if","while"] %}
306
+ <a href="{{ url_for('design.duplicate_action', id=button['id']) }}" type="button" class="btn btn-light"><span class="bi bi-copy"></span></a>
307
+ {% endif %}
308
+ <a href="{{ url_for('design.delete_action', id=button['id']) }}" type="button" class="btn btn-light"><span class="bi bi-trash"></span></a>
306
309
  </li>
307
310
  {% endfor %}
308
311
  </ul>
@@ -6,7 +6,7 @@
6
6
  <title>{% block title %}{% endblock %}</title>
7
7
  {#bootstrap#}
8
8
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha2/dist/css/bootstrap.min.css" integrity="sha384-aFq/bzH65dt+w6FI2ooMVUpc+21e0SRygnTpmBvdBgSdnuTN7QbdgL+OapgHtvPp" crossorigin="anonymous">
9
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.3/font/bootstrap-icons.css">
9
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css">
10
10
  <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
11
11
  {#static#}
12
12
  <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
@@ -197,9 +197,10 @@ class Script(db.Model):
197
197
 
198
198
  def add_action(self, action: dict):
199
199
  current_len = len(self.currently_editing_script)
200
- action['id'] = current_len + 1
201
- action['uuid'] = uuid.uuid4().fields[-1]
202
- self.currently_editing_script.append(action)
200
+ action_to_add = action.copy()
201
+ action_to_add['id'] = current_len + 1
202
+ action_to_add['uuid'] = uuid.uuid4().fields[-1]
203
+ self.currently_editing_script.append(action_to_add)
203
204
  self.currently_editing_order.append(str(current_len + 1))
204
205
  self.update_time_stamp()
205
206
 
@@ -257,6 +258,23 @@ class Script(db.Model):
257
258
  self.sort_actions()
258
259
  self.update_time_stamp()
259
260
 
261
+ def duplicate_action(self, id: int):
262
+ action_to_duplicate = next((action for action in self.currently_editing_script if action['id'] == int(id)), None)
263
+ insert_id = action_to_duplicate.get("id")
264
+ self.add_action(action_to_duplicate)
265
+ # print(self.currently_editing_script)
266
+ if action_to_duplicate is not None:
267
+ # Update IDs for all subsequent actions
268
+ for action in self.currently_editing_script:
269
+ if action['id'] > insert_id:
270
+ action['id'] += 1
271
+ self.currently_editing_script[-1]['id'] = insert_id + 1
272
+ # Sort actions if necessary and update the time stamp
273
+ self.sort_actions()
274
+ self.update_time_stamp()
275
+ else:
276
+ raise ValueError("Action not found: Unable to duplicate the action with ID", id)
277
+
260
278
  def config(self, stype):
261
279
  """
262
280
  take the global script_dict
@@ -220,7 +220,8 @@ def create_form_for_method(method, method_name, autofill, script=None, design=Tr
220
220
  formatted_param_name = format_name(param.name)
221
221
  field_kwargs = {
222
222
  "label": formatted_param_name,
223
- "default": f'#{param.name}' if autofill else (param.default if param.default is not param.empty else ""),
223
+ "default": f'#{param.name}' if autofill else (param.default if param.default is not param.empty else None),
224
+ "validators": [InputRequired()] if param.default is param.empty else None,
224
225
  **({"script": script} if (autofill or design) else {})
225
226
  }
226
227
  field_class, placeholder_text = annotation_mapping.get(
@@ -255,7 +256,7 @@ def create_form_from_module(sdl_module, autofill: bool, script=None, design=True
255
256
  attr = getattr(sdl_module, attr_name)
256
257
  if inspect.ismethod(attr) and not attr_name.startswith('_'):
257
258
  form_class = create_add_form(attr, attr_name, autofill, script, design)
258
- method_forms[format_name(attr_name)] = form_class()
259
+ method_forms[attr_name] = form_class()
259
260
  return method_forms
260
261
 
261
262
 
@@ -312,4 +313,4 @@ def create_action_button(s: dict):
312
313
  arg_string = f"= {s['args']}"
313
314
 
314
315
  text = f"{prefix}{action_text} {arg_string}"
315
- return dict(label=text, style=style, uuid=s["uuid"], id=s["id"])
316
+ return dict(label=text, style=style, uuid=s["uuid"], id=s["id"], instrument=s['instrument'])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ivoryos
3
- Version: 0.1.7
3
+ Version: 0.1.9
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
@@ -137,6 +137,9 @@ ivoryos.run(__name__)
137
137
  ### Deck function and web form
138
138
  ![](https://gitlab.com/heingroup/ivoryos/raw/main/docs/demo.gif)
139
139
 
140
+ ### Text-to-code demo
141
+ ![](https://gitlab.com/heingroup/ivoryos/raw/main/docs/text-to-code.gif)
142
+
140
143
  ### Directory structure
141
144
 
142
145
  When you run the application for the first time, it will automatically create the following folders and files in the same directory:
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='ivoryos',
5
- version='0.1.7',
5
+ version='0.1.9',
6
6
  packages=find_packages(exclude=['example', 'example.*', 'docs', 'docs.*']),
7
7
  include_package_data=True,
8
8
  description='an open-source Python package enabling Self-Driving Labs (SDLs) interoperability',
File without changes
File without changes
File without changes
File without changes
File without changes