ivoryos 0.1.9__py3-none-any.whl → 0.1.10__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 (37) hide show
  1. ivoryos/__init__.py +118 -99
  2. ivoryos/config.py +47 -47
  3. ivoryos/routes/auth/auth.py +100 -65
  4. ivoryos/routes/auth/templates/auth/login.html +25 -25
  5. ivoryos/routes/auth/templates/auth/signup.html +32 -32
  6. ivoryos/routes/control/control.py +400 -272
  7. ivoryos/routes/control/templates/control/controllers.html +75 -75
  8. ivoryos/routes/control/templates/control/controllers_home.html +50 -50
  9. ivoryos/routes/control/templates/control/controllers_new.html +89 -89
  10. ivoryos/routes/database/database.py +188 -114
  11. ivoryos/routes/database/templates/database/experiment_database.html +72 -72
  12. ivoryos/routes/design/design.py +541 -416
  13. ivoryos/routes/design/templates/design/experiment_builder.html +415 -415
  14. ivoryos/routes/design/templates/design/experiment_run.html +325 -325
  15. ivoryos/routes/main/main.py +42 -25
  16. ivoryos/routes/main/templates/main/help.html +141 -141
  17. ivoryos/routes/main/templates/main/home.html +68 -68
  18. ivoryos/static/.DS_Store +0 -0
  19. ivoryos/static/js/overlay.js +12 -12
  20. ivoryos/static/js/socket_handler.js +34 -34
  21. ivoryos/static/js/sortable_card.js +24 -24
  22. ivoryos/static/js/sortable_design.js +36 -36
  23. ivoryos/static/style.css +201 -201
  24. ivoryos/templates/base.html +143 -143
  25. ivoryos/utils/db_models.py +518 -518
  26. ivoryos/utils/form.py +316 -316
  27. ivoryos/utils/global_config.py +67 -67
  28. ivoryos/utils/llm_agent.py +183 -183
  29. ivoryos/utils/script_runner.py +165 -164
  30. ivoryos/utils/utils.py +425 -422
  31. ivoryos/version.py +1 -0
  32. {ivoryos-0.1.9.dist-info → ivoryos-0.1.10.dist-info}/LICENSE +21 -21
  33. {ivoryos-0.1.9.dist-info → ivoryos-0.1.10.dist-info}/METADATA +170 -169
  34. ivoryos-0.1.10.dist-info/RECORD +47 -0
  35. {ivoryos-0.1.9.dist-info → ivoryos-0.1.10.dist-info}/WHEEL +1 -1
  36. ivoryos-0.1.9.dist-info/RECORD +0 -45
  37. {ivoryos-0.1.9.dist-info → ivoryos-0.1.10.dist-info}/top_level.txt +0 -0
@@ -1,75 +1,75 @@
1
- {% extends 'base.html' %}
2
- {% block title %}IvoryOS | Controller for {{instrument}}{% endblock %}
3
- {% block body %}
4
- <div id="overlay" class="overlay">
5
- <div>
6
- <h3 id="overlay-text"></h3>
7
- <div class="spinner-border" role="status"></div>
8
- </div>
9
- </div>
10
- <h1>{{instrument}} controller</h1>
11
- {% set hidden = session.get('hidden_functions', {}) %}
12
- <div class="grid-container" id="sortable-grid">
13
- {% for function, form in forms.items() %}
14
-
15
- {% set hidden_instrument = hidden.get(instrument, []) %}
16
- {% if function not in hidden_instrument %}
17
- <div class="card" id="{{function}}">
18
- <div class="bg-white rounded shadow-sm flex-fill">
19
- <a style="float: right" aria-label="Close" href="{{ url_for('control.hide_function', instrument=instrument, function=function) }}"><i class="bi bi-eye-slash-fill"></i></a>
20
- <div class="form-control" style="border: none">
21
- <form role="form" method='POST' name="{{function}}" id="{{function}}">
22
- <div class="form-group">
23
- {{ form.hidden_tag() }}
24
- {% for field in form %}
25
- {% if field.type not in ['CSRFTokenField', 'HiddenField'] %}
26
- <div class="input-group mb-3">
27
- <label class="input-group-text">{{ field.label.text }}</label>
28
- {% if field.type == "SubmitField" %}
29
- {{ field(class="btn btn-dark") }}
30
- {% elif field.type == "BooleanField" %}
31
- {{ field(class="form-check-input") }}
32
- {% else %}
33
- {{ field(class="form-control") }}
34
- {% endif %}
35
- </div>
36
- {% endif %}
37
- {% endfor %}
38
- </div>
39
- <div class="input-group mb-3">
40
- <button type="submit" name="{{ function }}" id="{{ function }}" class="form-control" style="background-color: #a5cece;">{{format_name(function)}} </button>
41
- </div>
42
- </form>
43
- </div>
44
- </div>
45
- </div>
46
- {% endif %}
47
- {% endfor %}
48
- </div>
49
- <div class="accordion accordion-flush" id="accordionActions" >
50
- <div class="accordion-item">
51
- <h4 class="accordion-header">
52
- <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#hidden">
53
- Hidden functions
54
- </button>
55
- </h4>
56
- </div>
57
- <div id="hidden" class="accordion-collapse collapse" data-bs-parent="#accordionActions">
58
- <div class="accordion-body">
59
- {% set hidden_instrument = hidden.get(instrument, []) %}
60
- {% for function in hidden_instrument %}
61
- <div>
62
- {{ function }} <a href="{{ url_for('control.remove_hidden', instrument=instrument, function=function) }}"><i class="bi bi-eye-fill"></i></a>
63
- </div>
64
- {% endfor %}
65
- </div>
66
- </div>
67
- </div>
68
-
69
- <script>
70
- const saveOrderUrl = `{{ url_for('control.save_order', instrument=instrument) }}`;
71
- const buttonIds = {{ session['card_order'][instrument] | tojson }};
72
- </script>
73
- <script src="{{ url_for('static', filename='js/sortable_card.js') }}"></script>
74
- <script src="{{ url_for('static', filename='js/overlay.js') }}"></script>
75
- {% endblock %}
1
+ {% extends 'base.html' %}
2
+ {% block title %}IvoryOS | Controller for {{instrument}}{% endblock %}
3
+ {% block body %}
4
+ <div id="overlay" class="overlay">
5
+ <div>
6
+ <h3 id="overlay-text"></h3>
7
+ <div class="spinner-border" role="status"></div>
8
+ </div>
9
+ </div>
10
+ <h1>{{instrument}} controller</h1>
11
+ {% set hidden = session.get('hidden_functions', {}) %}
12
+ <div class="grid-container" id="sortable-grid">
13
+ {% for function, form in forms.items() %}
14
+
15
+ {% set hidden_instrument = hidden.get(instrument, []) %}
16
+ {% if function not in hidden_instrument %}
17
+ <div class="card" id="{{function}}">
18
+ <div class="bg-white rounded shadow-sm flex-fill">
19
+ <a style="float: right" aria-label="Close" href="{{ url_for('control.hide_function', instrument=instrument, function=function) }}"><i class="bi bi-eye-slash-fill"></i></a>
20
+ <div class="form-control" style="border: none">
21
+ <form role="form" method='POST' name="{{function}}" id="{{function}}">
22
+ <div class="form-group">
23
+ {{ form.hidden_tag() }}
24
+ {% for field in form %}
25
+ {% if field.type not in ['CSRFTokenField', 'HiddenField'] %}
26
+ <div class="input-group mb-3">
27
+ <label class="input-group-text">{{ field.label.text }}</label>
28
+ {% if field.type == "SubmitField" %}
29
+ {{ field(class="btn btn-dark") }}
30
+ {% elif field.type == "BooleanField" %}
31
+ {{ field(class="form-check-input") }}
32
+ {% else %}
33
+ {{ field(class="form-control") }}
34
+ {% endif %}
35
+ </div>
36
+ {% endif %}
37
+ {% endfor %}
38
+ </div>
39
+ <div class="input-group mb-3">
40
+ <button type="submit" name="{{ function }}" id="{{ function }}" class="form-control" style="background-color: #a5cece;">{{format_name(function)}} </button>
41
+ </div>
42
+ </form>
43
+ </div>
44
+ </div>
45
+ </div>
46
+ {% endif %}
47
+ {% endfor %}
48
+ </div>
49
+ <div class="accordion accordion-flush" id="accordionActions" >
50
+ <div class="accordion-item">
51
+ <h4 class="accordion-header">
52
+ <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#hidden">
53
+ Hidden functions
54
+ </button>
55
+ </h4>
56
+ </div>
57
+ <div id="hidden" class="accordion-collapse collapse" data-bs-parent="#accordionActions">
58
+ <div class="accordion-body">
59
+ {% set hidden_instrument = hidden.get(instrument, []) %}
60
+ {% for function in hidden_instrument %}
61
+ <div>
62
+ {{ function }} <a href="{{ url_for('control.remove_hidden', instrument=instrument, function=function) }}"><i class="bi bi-eye-fill"></i></a>
63
+ </div>
64
+ {% endfor %}
65
+ </div>
66
+ </div>
67
+ </div>
68
+
69
+ <script>
70
+ const saveOrderUrl = `{{ url_for('control.save_order', instrument=instrument) }}`;
71
+ const buttonIds = {{ session['card_order'][instrument] | tojson }};
72
+ </script>
73
+ <script src="{{ url_for('static', filename='js/sortable_card.js') }}"></script>
74
+ <script src="{{ url_for('static', filename='js/overlay.js') }}"></script>
75
+ {% endblock %}
@@ -1,50 +1,50 @@
1
- {% extends 'base.html' %}
2
- {% block title %}IvoryOS | Devices{% endblock %}
3
- {% block body %}
4
- <div class="row">
5
- {% if defined_variables %}
6
- {% for instrument in defined_variables %}
7
- <div class="col-xl-3 col-lg-4 col-md-6 mb-4 ">
8
- <div class="bg-white rounded shadow-sm position-relative">
9
- {# {% if not deck %}#}
10
- {# <a href="{{ url_for('control.disconnect', instrument=instrument) }}" class="stretched-link controller-card" style="float: right;color: red; position: relative;">Disconnect <i class="bi bi-x-square"></i></a>#}
11
- <div class="p-4 controller-card">
12
- <h5 class=""><a href="{{ url_for('control.controllers', instrument=instrument) }}" class="text-dark stretched-link">{{instrument}}</a></h5>
13
- </div>
14
- {# {% else %}#}
15
- {# <div class="p-4 controller-card">#}
16
- {# <h5 class=""><a href="{{ url_for('control.controllers', instrument=instrument) }}" class="text-dark stretched-link">{{instrument}}</a></h5>#}
17
- {# </div>#}
18
- {# {% endif %}#}
19
- </div>
20
- </div>
21
- {% endfor %}
22
- {% if not deck %}
23
- <div class="col-xl-3 col-lg-4 col-md-6 mb-4 ">
24
- <div class="bg-white rounded shadow-sm position-relative">
25
- <div class="p-4 controller-card" >
26
- {% if deck %}
27
- {# todo disconnect for imported deck #}
28
- {# <h5> <a href="{{ url_for("disconnect") }}" class="stretched-link" style="color: orangered">Disconnect deck</a></h5>#}
29
- {% else %}
30
- <h5><a href="{{ url_for('control.new_controller') }}" style="color: orange" class="stretched-link">New connection</a></h5>
31
- {% endif %}
32
- </div>
33
- </div>
34
- </div>
35
- {% endif %}
36
- {% else %}
37
- <div class="col-xl-3 col-lg-4 col-md-6 mb-4 ">
38
- <div class="bg-white rounded shadow-sm position-relative">
39
- <div class="p-4 controller-card" >
40
- {% if deck %}
41
- <h5><a data-bs-toggle="modal" href="#importModal" class="stretched-link"><i class="bi bi-folder-plus"></i> Import deck </a></h5>
42
- {% else %}
43
- <h5><a href="{{ url_for('control.new_controller') }}" style="color: orange" class="stretched-link">New connection</a></h5>
44
- {% endif %}
45
- </div>
46
- </div>
47
- </div>
48
- {% endif %}
49
- </div>
50
- {% endblock %}
1
+ {% extends 'base.html' %}
2
+ {% block title %}IvoryOS | Devices{% endblock %}
3
+ {% block body %}
4
+ <div class="row">
5
+ {% if defined_variables %}
6
+ {% for instrument in defined_variables %}
7
+ <div class="col-xl-3 col-lg-4 col-md-6 mb-4 ">
8
+ <div class="bg-white rounded shadow-sm position-relative">
9
+ {# {% if not deck %}#}
10
+ {# <a href="{{ url_for('control.disconnect', instrument=instrument) }}" class="stretched-link controller-card" style="float: right;color: red; position: relative;">Disconnect <i class="bi bi-x-square"></i></a>#}
11
+ <div class="p-4 controller-card">
12
+ <h5 class=""><a href="{{ url_for('control.controllers', instrument=instrument) }}" class="text-dark stretched-link">{{instrument}}</a></h5>
13
+ </div>
14
+ {# {% else %}#}
15
+ {# <div class="p-4 controller-card">#}
16
+ {# <h5 class=""><a href="{{ url_for('control.controllers', instrument=instrument) }}" class="text-dark stretched-link">{{instrument}}</a></h5>#}
17
+ {# </div>#}
18
+ {# {% endif %}#}
19
+ </div>
20
+ </div>
21
+ {% endfor %}
22
+ {% if not deck %}
23
+ <div class="col-xl-3 col-lg-4 col-md-6 mb-4 ">
24
+ <div class="bg-white rounded shadow-sm position-relative">
25
+ <div class="p-4 controller-card" >
26
+ {% if deck %}
27
+ {# todo disconnect for imported deck #}
28
+ {# <h5> <a href="{{ url_for("disconnect") }}" class="stretched-link" style="color: orangered">Disconnect deck</a></h5>#}
29
+ {% else %}
30
+ <h5><a href="{{ url_for('control.new_controller') }}" style="color: orange" class="stretched-link">New connection</a></h5>
31
+ {% endif %}
32
+ </div>
33
+ </div>
34
+ </div>
35
+ {% endif %}
36
+ {% else %}
37
+ <div class="col-xl-3 col-lg-4 col-md-6 mb-4 ">
38
+ <div class="bg-white rounded shadow-sm position-relative">
39
+ <div class="p-4 controller-card" >
40
+ {% if deck %}
41
+ <h5><a data-bs-toggle="modal" href="#importModal" class="stretched-link"><i class="bi bi-folder-plus"></i> Import deck </a></h5>
42
+ {% else %}
43
+ <h5><a href="{{ url_for('control.new_controller') }}" style="color: orange" class="stretched-link">New connection</a></h5>
44
+ {% endif %}
45
+ </div>
46
+ </div>
47
+ </div>
48
+ {% endif %}
49
+ </div>
50
+ {% endblock %}
@@ -1,89 +1,89 @@
1
- {% extends 'base.html' %}
2
- {% block title %}IvoryOS | New devices{% endblock %}
3
-
4
- {% block body %}
5
- <div class="row">
6
- <div class="col-xl-4 col-lg-4 col-md-6 mb-4 ">
7
- <h5>Available Python API</h5>
8
- <hr>
9
- {% for instrument in api_variables %}
10
- <div class="bg-white rounded shadow-sm position-relative">
11
- <h5 class="p-3 controller-card">
12
- <a href="{{ url_for('control.new_controller', instrument=instrument) }}" class="text-dark stretched-link">{{instrument}}</a>
13
- </h5>
14
- </div>
15
- {% endfor %}
16
- <div class="bg-white rounded shadow-sm position-relative">
17
- <h5 class="p-3 controller-card">
18
- <a data-bs-toggle="modal" href="#importAPI" class="stretched-link"><i class="bi bi-folder-plus"></i> Import API</a>
19
- </h5>
20
- </div>
21
- </div>
22
- <div class="col-xl-5 col-lg-5 col-md-6 mb-4 ">
23
- {% if device %}
24
- <h5>Connecting</h5><hr>
25
- <form role="form" method='POST' name="init" action="{{ url_for('control.new_controller', instrument=instrument) }}">
26
- <div class="form-group">
27
- <div class="input-group mb-3">
28
- <span class="input-group-text" >Name this device</span>
29
- <input class="form-control" type="text" id="device_name" name="device_name" aria-labelledby="nameHelpBlock" placeholder="e.g. {{device.__name__}}_1" >
30
- <div id="nameHelpBlock" class="form-text">
31
- Name your instrument, avoid names that are defined on the right
32
- </div>
33
- </div>
34
- {% for arg in device.__init__.__annotations__ %}
35
- {% if not arg == "return" %}
36
- <div class="input-group mb-3">
37
- <span class="input-group-text" >{{arg}}</span>
38
- <input class="form-control" type="text" id="{{arg}}" name="{{arg}}"
39
- placeholder="{{device.__init__.__annotations__[arg].__name__}}"
40
- value="{{args.parameters[arg].default if not args.parameters[arg].default.__name__ == '_empty' else ''}}">
41
- {% if device.__init__.__annotations__[arg].__module__ is not in ["builtins", "typing"] %}
42
- <a role="button" href="{{ url_for('control.new_controller', instrument=device.__init__.__annotations__[arg].__name__) }}" class="btn btn-secondary">initialize {{device.__init__.__annotations__[arg].__name__}} first</a>
43
- {% endif %}
44
- </div>
45
- {% endif %}
46
- {% endfor %}
47
- <button type="submit" class="btn btn-dark">Connect</button>
48
- </div>
49
- </form>
50
- {% endif %}
51
- </div>
52
- <div class="col-xl-3 col-lg-3 col-md-6 mb-4">
53
- <h5>Defined Instruments</h5><hr>
54
- {% if defined_variables %}
55
- <ul class="list-group">
56
- {% for instrument in defined_variables %}
57
- <li class="list-group-item">{{instrument}}</li>
58
- {% endfor %}
59
- </ul>
60
- {% endif %}
61
- </div>
62
- </div>
63
-
64
-
65
- <div class="modal fade" id="importAPI" tabindex="-1" aria-labelledby="importModal" aria-hidden="true" >
66
- <div class="modal-dialog">
67
- <div class="modal-content">
68
- <div class="modal-header">
69
- <h1 class="modal-title fs-5" id="importModal">Import API by file path</h1>
70
- <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
71
- </div>
72
- <form method="POST" action="{{ url_for('control.import_api') }}" enctype="multipart/form-data">
73
- <div class="modal-body">
74
- <h5>input manually</h5>
75
- <div class="input-group mb-3">
76
- <label class="input-group-text" for="filepath">File Path:</label>
77
- <input type="text" class="form-control" name="filepath" id="filepath">
78
- </div>
79
- <div class="modal-footer">
80
- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"> Close </button>
81
- <button type="submit" class="btn btn-primary"> Save </button>
82
- </div>
83
- </div>
84
- </form>
85
- </div>
86
- </div>
87
- </div>
88
-
89
- {% endblock %}
1
+ {% extends 'base.html' %}
2
+ {% block title %}IvoryOS | New devices{% endblock %}
3
+
4
+ {% block body %}
5
+ <div class="row">
6
+ <div class="col-xl-4 col-lg-4 col-md-6 mb-4 ">
7
+ <h5>Available Python API</h5>
8
+ <hr>
9
+ {% for instrument in api_variables %}
10
+ <div class="bg-white rounded shadow-sm position-relative">
11
+ <h5 class="p-3 controller-card">
12
+ <a href="{{ url_for('control.new_controller', instrument=instrument) }}" class="text-dark stretched-link">{{instrument}}</a>
13
+ </h5>
14
+ </div>
15
+ {% endfor %}
16
+ <div class="bg-white rounded shadow-sm position-relative">
17
+ <h5 class="p-3 controller-card">
18
+ <a data-bs-toggle="modal" href="#importAPI" class="stretched-link"><i class="bi bi-folder-plus"></i> Import API</a>
19
+ </h5>
20
+ </div>
21
+ </div>
22
+ <div class="col-xl-5 col-lg-5 col-md-6 mb-4 ">
23
+ {% if device %}
24
+ <h5>Connecting</h5><hr>
25
+ <form role="form" method='POST' name="init" action="{{ url_for('control.new_controller', instrument=instrument) }}">
26
+ <div class="form-group">
27
+ <div class="input-group mb-3">
28
+ <span class="input-group-text" >Name this device</span>
29
+ <input class="form-control" type="text" id="device_name" name="device_name" aria-labelledby="nameHelpBlock" placeholder="e.g. {{device.__name__}}_1" >
30
+ <div id="nameHelpBlock" class="form-text">
31
+ Name your instrument, avoid names that are defined on the right
32
+ </div>
33
+ </div>
34
+ {% for arg in device.__init__.__annotations__ %}
35
+ {% if not arg == "return" %}
36
+ <div class="input-group mb-3">
37
+ <span class="input-group-text" >{{arg}}</span>
38
+ <input class="form-control" type="text" id="{{arg}}" name="{{arg}}"
39
+ placeholder="{{device.__init__.__annotations__[arg].__name__}}"
40
+ value="{{args.parameters[arg].default if not args.parameters[arg].default.__name__ == '_empty' else ''}}">
41
+ {% if device.__init__.__annotations__[arg].__module__ is not in ["builtins", "typing"] %}
42
+ <a role="button" href="{{ url_for('control.new_controller', instrument=device.__init__.__annotations__[arg].__name__) }}" class="btn btn-secondary">initialize {{device.__init__.__annotations__[arg].__name__}} first</a>
43
+ {% endif %}
44
+ </div>
45
+ {% endif %}
46
+ {% endfor %}
47
+ <button type="submit" class="btn btn-dark">Connect</button>
48
+ </div>
49
+ </form>
50
+ {% endif %}
51
+ </div>
52
+ <div class="col-xl-3 col-lg-3 col-md-6 mb-4">
53
+ <h5>Defined Instruments</h5><hr>
54
+ {% if defined_variables %}
55
+ <ul class="list-group">
56
+ {% for instrument in defined_variables %}
57
+ <li class="list-group-item">{{instrument}}</li>
58
+ {% endfor %}
59
+ </ul>
60
+ {% endif %}
61
+ </div>
62
+ </div>
63
+
64
+
65
+ <div class="modal fade" id="importAPI" tabindex="-1" aria-labelledby="importModal" aria-hidden="true" >
66
+ <div class="modal-dialog">
67
+ <div class="modal-content">
68
+ <div class="modal-header">
69
+ <h1 class="modal-title fs-5" id="importModal">Import API by file path</h1>
70
+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
71
+ </div>
72
+ <form method="POST" action="{{ url_for('control.import_api') }}" enctype="multipart/form-data">
73
+ <div class="modal-body">
74
+ <h5>input manually</h5>
75
+ <div class="input-group mb-3">
76
+ <label class="input-group-text" for="filepath">File Path:</label>
77
+ <input type="text" class="form-control" name="filepath" id="filepath">
78
+ </div>
79
+ <div class="modal-footer">
80
+ <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"> Close </button>
81
+ <button type="submit" class="btn btn-primary"> Save </button>
82
+ </div>
83
+ </div>
84
+ </form>
85
+ </div>
86
+ </div>
87
+ </div>
88
+
89
+ {% endblock %}