ivoryos 1.0.9__py3-none-any.whl → 1.4.4__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.
- docs/source/conf.py +84 -0
- ivoryos/__init__.py +17 -207
- ivoryos/app.py +154 -0
- ivoryos/config.py +1 -0
- ivoryos/optimizer/ax_optimizer.py +191 -0
- ivoryos/optimizer/base_optimizer.py +84 -0
- ivoryos/optimizer/baybe_optimizer.py +193 -0
- ivoryos/optimizer/nimo_optimizer.py +173 -0
- ivoryos/optimizer/registry.py +11 -0
- ivoryos/routes/auth/auth.py +43 -14
- ivoryos/routes/auth/templates/change_password.html +32 -0
- ivoryos/routes/control/control.py +101 -366
- ivoryos/routes/control/control_file.py +33 -0
- ivoryos/routes/control/control_new_device.py +152 -0
- ivoryos/routes/control/templates/controllers.html +193 -0
- ivoryos/routes/control/templates/controllers_new.html +112 -0
- ivoryos/routes/control/utils.py +40 -0
- ivoryos/routes/data/data.py +197 -0
- ivoryos/routes/data/templates/components/step_card.html +78 -0
- ivoryos/routes/{database/templates/database → data/templates}/workflow_database.html +14 -8
- ivoryos/routes/data/templates/workflow_view.html +360 -0
- ivoryos/routes/design/__init__.py +4 -0
- ivoryos/routes/design/design.py +348 -657
- ivoryos/routes/design/design_file.py +68 -0
- ivoryos/routes/design/design_step.py +171 -0
- ivoryos/routes/design/templates/components/action_form.html +53 -0
- ivoryos/routes/design/templates/components/actions_panel.html +25 -0
- ivoryos/routes/design/templates/components/autofill_toggle.html +10 -0
- ivoryos/routes/design/templates/components/canvas.html +5 -0
- ivoryos/routes/design/templates/components/canvas_footer.html +9 -0
- ivoryos/routes/design/templates/components/canvas_header.html +75 -0
- ivoryos/routes/design/templates/components/canvas_main.html +39 -0
- ivoryos/routes/design/templates/components/deck_selector.html +10 -0
- ivoryos/routes/design/templates/components/edit_action_form.html +53 -0
- ivoryos/routes/design/templates/components/info_modal.html +318 -0
- ivoryos/routes/design/templates/components/instruments_panel.html +88 -0
- ivoryos/routes/design/templates/components/modals/drop_modal.html +17 -0
- ivoryos/routes/design/templates/components/modals/json_modal.html +22 -0
- ivoryos/routes/design/templates/components/modals/new_script_modal.html +17 -0
- ivoryos/routes/design/templates/components/modals/rename_modal.html +23 -0
- ivoryos/routes/design/templates/components/modals/saveas_modal.html +27 -0
- ivoryos/routes/design/templates/components/modals.html +6 -0
- ivoryos/routes/design/templates/components/python_code_overlay.html +56 -0
- ivoryos/routes/design/templates/components/sidebar.html +15 -0
- ivoryos/routes/design/templates/components/text_to_code_panel.html +20 -0
- ivoryos/routes/design/templates/experiment_builder.html +44 -0
- ivoryos/routes/execute/__init__.py +0 -0
- ivoryos/routes/execute/execute.py +377 -0
- ivoryos/routes/execute/execute_file.py +78 -0
- ivoryos/routes/execute/templates/components/error_modal.html +20 -0
- ivoryos/routes/execute/templates/components/logging_panel.html +56 -0
- ivoryos/routes/execute/templates/components/progress_panel.html +27 -0
- ivoryos/routes/execute/templates/components/run_panel.html +9 -0
- ivoryos/routes/execute/templates/components/run_tabs.html +60 -0
- ivoryos/routes/execute/templates/components/tab_bayesian.html +520 -0
- ivoryos/routes/execute/templates/components/tab_configuration.html +383 -0
- ivoryos/routes/execute/templates/components/tab_repeat.html +18 -0
- ivoryos/routes/execute/templates/experiment_run.html +30 -0
- ivoryos/routes/library/__init__.py +0 -0
- ivoryos/routes/library/library.py +157 -0
- ivoryos/routes/{database/templates/database/scripts_database.html → library/templates/library.html} +32 -23
- ivoryos/routes/main/main.py +31 -3
- ivoryos/routes/main/templates/{main/home.html → home.html} +4 -4
- ivoryos/server.py +180 -0
- ivoryos/socket_handlers.py +52 -0
- ivoryos/static/ivoryos_logo.png +0 -0
- ivoryos/static/js/action_handlers.js +384 -0
- ivoryos/static/js/db_delete.js +23 -0
- ivoryos/static/js/script_metadata.js +39 -0
- ivoryos/static/js/socket_handler.js +40 -5
- ivoryos/static/js/sortable_design.js +107 -56
- ivoryos/static/js/ui_state.js +114 -0
- ivoryos/templates/base.html +67 -8
- ivoryos/utils/bo_campaign.py +180 -3
- ivoryos/utils/client_proxy.py +267 -36
- ivoryos/utils/db_models.py +300 -65
- ivoryos/utils/decorators.py +34 -0
- ivoryos/utils/form.py +63 -29
- ivoryos/utils/global_config.py +34 -1
- ivoryos/utils/nest_script.py +314 -0
- ivoryos/utils/py_to_json.py +295 -0
- ivoryos/utils/script_runner.py +599 -165
- ivoryos/utils/serilize.py +201 -0
- ivoryos/utils/task_runner.py +71 -21
- ivoryos/utils/utils.py +50 -6
- ivoryos/version.py +1 -1
- ivoryos-1.4.4.dist-info/METADATA +263 -0
- ivoryos-1.4.4.dist-info/RECORD +119 -0
- {ivoryos-1.0.9.dist-info → ivoryos-1.4.4.dist-info}/WHEEL +1 -1
- {ivoryos-1.0.9.dist-info → ivoryos-1.4.4.dist-info}/top_level.txt +1 -0
- tests/unit/test_type_conversion.py +42 -0
- tests/unit/test_util.py +3 -0
- ivoryos/routes/control/templates/control/controllers.html +0 -78
- ivoryos/routes/control/templates/control/controllers_home.html +0 -55
- ivoryos/routes/control/templates/control/controllers_new.html +0 -89
- ivoryos/routes/database/database.py +0 -306
- ivoryos/routes/database/templates/database/step_card.html +0 -7
- ivoryos/routes/database/templates/database/workflow_view.html +0 -130
- ivoryos/routes/design/templates/design/experiment_builder.html +0 -521
- ivoryos/routes/design/templates/design/experiment_run.html +0 -558
- ivoryos-1.0.9.dist-info/METADATA +0 -218
- ivoryos-1.0.9.dist-info/RECORD +0 -61
- /ivoryos/routes/auth/templates/{auth/login.html → login.html} +0 -0
- /ivoryos/routes/auth/templates/{auth/signup.html → signup.html} +0 -0
- /ivoryos/routes/{database → data}/__init__.py +0 -0
- /ivoryos/routes/main/templates/{main/help.html → help.html} +0 -0
- {ivoryos-1.0.9.dist-info → ivoryos-1.4.4.dist-info/licenses}/LICENSE +0 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
{# Tips Button - Fixed Position #}
|
|
2
|
+
<button id="tipsButton" class="btn btn-info tips-button" data-bs-toggle="modal" data-bs-target="#tipsModal" title="View Workflow Tips">
|
|
3
|
+
<i class="bi bi-question-circle"></i>
|
|
4
|
+
</button>
|
|
5
|
+
{# Tips Modal #}
|
|
6
|
+
<div class="modal fade" id="tipsModal" tabindex="-1" aria-labelledby="tipsModalLabel" aria-hidden="true">
|
|
7
|
+
<div class="modal-dialog modal-lg">
|
|
8
|
+
<div class="modal-content">
|
|
9
|
+
<div class="modal-header bg-info text-white">
|
|
10
|
+
<h5 class="modal-title" id="tipsModalLabel">
|
|
11
|
+
<i class="bi bi-lightbulb"></i> Workflow Building Tips
|
|
12
|
+
</h5>
|
|
13
|
+
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="modal-body">
|
|
16
|
+
<div class="accordion" id="tipsAccordion">
|
|
17
|
+
{# Tip 1: Dynamic Variables #}
|
|
18
|
+
<div class="accordion-item">
|
|
19
|
+
<h2 class="accordion-header" id="headingOne">
|
|
20
|
+
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
|
|
21
|
+
<i class="bi bi-hash me-2"></i> Dynamic Variables
|
|
22
|
+
</button>
|
|
23
|
+
</h2>
|
|
24
|
+
<div id="collapseOne" class="accordion-collapse collapse show" aria-labelledby="headingOne" data-bs-parent="#tipsAccordion">
|
|
25
|
+
<div class="accordion-body">
|
|
26
|
+
<p><strong>Use <code>#name</code> to make variables dynamic</strong></p>
|
|
27
|
+
<p>When you want a parameter to be adjustable across multiple workflow runs, use <code>#</code> followed by the parameter name in place of the actual value.</p>
|
|
28
|
+
<div class="alert alert-success mb-0">
|
|
29
|
+
<strong>Example:</strong><br>
|
|
30
|
+
Instead of: <code>temperature = 300</code><br>
|
|
31
|
+
Use: <code>temperature = #temperature</code><br>
|
|
32
|
+
<small class="text-muted">This makes "temperature" a dynamic parameter that can be varied in parameter sweeps or optimization runs.</small>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
{# Tip 2: Repeat vs Dynamic #}
|
|
38
|
+
<div class="accordion-item">
|
|
39
|
+
<h2 class="accordion-header" id="headingTwo">
|
|
40
|
+
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
|
|
41
|
+
<i class="bi bi-arrow-repeat me-2"></i> Repeat vs Dynamic Parameters
|
|
42
|
+
</button>
|
|
43
|
+
</h2>
|
|
44
|
+
<div id="collapseTwo" class="accordion-collapse collapse" aria-labelledby="headingTwo" data-bs-parent="#tipsAccordion">
|
|
45
|
+
<div class="accordion-body">
|
|
46
|
+
<p><strong>Repeat is for static workflows only</strong></p>
|
|
47
|
+
<ul>
|
|
48
|
+
<li><strong>Static (Repeat):</strong> Runs the exact same workflow multiple times with identical parameters</li>
|
|
49
|
+
<li><strong>Dynamic (#name):</strong> Automatically triggers the <span class="badge bg-primary">Parameter Sweep</span> option, allowing you to vary parameters across runs</li>
|
|
50
|
+
</ul>
|
|
51
|
+
<div class="alert alert-info mb-0">
|
|
52
|
+
<i class="bi bi-info-circle"></i> Use repeat when you want statistical averaging of identical runs. Use dynamic parameters (e.g., <code>#temperature</code>) when you want to explore different parameter values.
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
{# Tip 3: Parameter Sweep #}
|
|
58
|
+
<div class="accordion-item">
|
|
59
|
+
<h2 class="accordion-header" id="headingThree">
|
|
60
|
+
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
|
|
61
|
+
<i class="bi bi-sliders me-2"></i> Parameter Sweep Mode
|
|
62
|
+
</button>
|
|
63
|
+
</h2>
|
|
64
|
+
<div id="collapseThree" class="accordion-collapse collapse" aria-labelledby="headingThree" data-bs-parent="#tipsAccordion">
|
|
65
|
+
<div class="accordion-body">
|
|
66
|
+
<p><strong>Automatically enabled when using dynamic parameters</strong></p>
|
|
67
|
+
<p>Parameter sweep allows you to systematically explore different combinations of parameter values.</p>
|
|
68
|
+
<div class="alert alert-warning">
|
|
69
|
+
<strong>Triggered by:</strong> Using <code>#name</code> syntax (e.g., <code>#temperature</code>) in your workflow
|
|
70
|
+
</div>
|
|
71
|
+
<p class="mb-0"><strong>Use cases:</strong> Sensitivity analysis, parameter optimization, design space exploration</p>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
{# Tip 4: Optimizer #}
|
|
76
|
+
<div class="accordion-item">
|
|
77
|
+
<h2 class="accordion-header" id="headingFour">
|
|
78
|
+
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseFour" aria-expanded="false" aria-controls="collapseFour">
|
|
79
|
+
<i class="bi bi-bullseye me-2"></i> Optimizer Mode
|
|
80
|
+
</button>
|
|
81
|
+
</h2>
|
|
82
|
+
<div id="collapseFour" class="accordion-collapse collapse" aria-labelledby="headingFour" data-bs-parent="#tipsAccordion">
|
|
83
|
+
<div class="accordion-body">
|
|
84
|
+
<p><strong>Enabled when you have both dynamic parameters AND output values</strong></p>
|
|
85
|
+
<p>The optimizer automatically finds the best parameter values to optimize your output metric.</p>
|
|
86
|
+
<div class="alert alert-success">
|
|
87
|
+
<strong>Requirements:</strong>
|
|
88
|
+
<ul class="mb-0">
|
|
89
|
+
<li>At least one dynamic parameter using <code>#name</code> syntax (input)</li>
|
|
90
|
+
<li>At least one output value with "Save value as" name (objective function)</li>
|
|
91
|
+
</ul>
|
|
92
|
+
</div>
|
|
93
|
+
<p class="mt-2 mb-0"><small class="text-muted"><i class="bi bi-info-circle"></i> Note: Parameter sweep option remains available even in optimizer mode</small></p>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
{# Tip 5: Output Values #}
|
|
98
|
+
<div class="accordion-item">
|
|
99
|
+
<h2 class="accordion-header" id="headingFive">
|
|
100
|
+
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseFive" aria-expanded="false" aria-controls="collapseFive">
|
|
101
|
+
<i class="bi bi-save me-2"></i> Saving Output Values
|
|
102
|
+
</button>
|
|
103
|
+
</h2>
|
|
104
|
+
<div id="collapseFive" class="accordion-collapse collapse" aria-labelledby="headingFive" data-bs-parent="#tipsAccordion">
|
|
105
|
+
<div class="accordion-body">
|
|
106
|
+
<p><strong>Use "Save value as" to capture important results</strong></p>
|
|
107
|
+
<p>When you want to track or optimize a result from your workflow, give it a meaningful name in the "Save value as" field.</p>
|
|
108
|
+
<div class="alert alert-info">
|
|
109
|
+
<strong>Naming conventions:</strong><br>
|
|
110
|
+
• Use descriptive names: <code>final_stress</code>, <code>total_energy</code>, <code>efficiency</code><br>
|
|
111
|
+
• Use underscores instead of spaces: <code>max_temperature</code> not <code>max temperature</code><br>
|
|
112
|
+
• Keep names concise but clear
|
|
113
|
+
</div>
|
|
114
|
+
<p class="mb-0"><small class="text-muted">Saved values become available for optimization and can be tracked across parameter sweeps.</small></p>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
{# Tip 6: Batch Mode #}
|
|
119
|
+
<div class="accordion-item">
|
|
120
|
+
<h2 class="accordion-header" id="headingSix">
|
|
121
|
+
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseSix" aria-expanded="false" aria-controls="collapseSix">
|
|
122
|
+
<i class="bi bi-collection me-2"></i> Batch Mode Actions
|
|
123
|
+
</button>
|
|
124
|
+
</h2>
|
|
125
|
+
<div id="collapseSix" class="accordion-collapse collapse" aria-labelledby="headingSix" data-bs-parent="#tipsAccordion">
|
|
126
|
+
<div class="accordion-body">
|
|
127
|
+
<p><strong>Mark steps as "Once per batch" to run them only once for multiple samples</strong></p>
|
|
128
|
+
<p>Some actions apply to all samples at once (batch actions), while others must run for each individual sample (per-sample actions).</p>
|
|
129
|
+
<div class="row">
|
|
130
|
+
<div class="col-md-6 mb-3">
|
|
131
|
+
<div class="card h-100">
|
|
132
|
+
<div class="card-header bg-light">
|
|
133
|
+
<strong>Workflow Steps</strong>
|
|
134
|
+
</div>
|
|
135
|
+
<div class="card-body">
|
|
136
|
+
<div class="workflow-left">
|
|
137
|
+
<div class="step-box regular">Add Liquid<br><small>per-sample</small></div>
|
|
138
|
+
<div class="arrow-down">↓</div>
|
|
139
|
+
<div class="step-box regular">Add Solid<br><small>per-sample</small></div>
|
|
140
|
+
<div class="arrow-down">↓</div>
|
|
141
|
+
<div class="step-box batch">Heat Sample<br><small>batch action</small></div>
|
|
142
|
+
<div class="arrow-down">↓</div>
|
|
143
|
+
<div class="step-box regular">Analyze Sample<br><small>per-sample</small></div>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
<div class="col-md-6 mb-3">
|
|
149
|
+
<div class="card h-100">
|
|
150
|
+
<div class="card-header bg-light">
|
|
151
|
+
<strong>Execution (n=3 samples)</strong>
|
|
152
|
+
</div>
|
|
153
|
+
<div class="card-body">
|
|
154
|
+
<div class="workflow-right">
|
|
155
|
+
<div class="sample-group">
|
|
156
|
+
<div class="step-box-small regular">Add Liquid S1</div>
|
|
157
|
+
<div class="step-box-small regular">Add Liquid S2</div>
|
|
158
|
+
<div class="step-box-small regular">Add Liquid S3</div>
|
|
159
|
+
</div>
|
|
160
|
+
<div class="arrow-down">↓</div>
|
|
161
|
+
<div class="sample-group">
|
|
162
|
+
<div class="step-box-small regular">Add Solid S1</div>
|
|
163
|
+
<div class="step-box-small regular">Add Solid S2</div>
|
|
164
|
+
<div class="step-box-small regular">Add Solid S3</div>
|
|
165
|
+
</div>
|
|
166
|
+
<div class="arrow-down">↓</div>
|
|
167
|
+
<div class="step-box batch">Heat All Samples</div>
|
|
168
|
+
<div class="arrow-down">↓</div>
|
|
169
|
+
<div class="sample-group">
|
|
170
|
+
<div class="step-box-small regular">Analyze S1</div>
|
|
171
|
+
<div class="step-box-small regular">Analyze S2</div>
|
|
172
|
+
<div class="step-box-small regular">Analyze S3</div>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
<div class="alert alert-warning mb-0">
|
|
180
|
+
<strong>Per-sample actions:</strong> Run individually for each sample (Add Liquid, Add Solid, Analyze)<br>
|
|
181
|
+
<strong>Batch actions:</strong> Run once for all samples together (Heat Sample)
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
{# Tip 7: Best Practices #}
|
|
187
|
+
<div class="accordion-item">
|
|
188
|
+
<h2 class="accordion-header" id="headingSeven">
|
|
189
|
+
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseSeven" aria-expanded="false" aria-controls="collapseSeven">
|
|
190
|
+
<i class="bi bi-star me-2"></i> Best Practices
|
|
191
|
+
</button>
|
|
192
|
+
</h2>
|
|
193
|
+
<div id="collapseSeven" class="accordion-collapse collapse" aria-labelledby="headingSeven" data-bs-parent="#tipsAccordion">
|
|
194
|
+
<div class="accordion-body">
|
|
195
|
+
<ul>
|
|
196
|
+
<li><strong>Name parameters clearly:</strong> Use descriptive names like <code>#mesh_size</code> instead of <code>#x</code></li>
|
|
197
|
+
<li><strong>Set reasonable ranges:</strong> Define min/max values that make physical sense for your problem</li>
|
|
198
|
+
<li><strong>Start simple:</strong> Begin with 1-2 parameters before adding more complexity</li>
|
|
199
|
+
<li><strong>Document outputs:</strong> Clearly label which outputs are optimization objectives</li>
|
|
200
|
+
<li><strong>Test first:</strong> Run a single workflow before launching sweeps or optimizations</li>
|
|
201
|
+
<li><strong>Use batch mode wisely:</strong> Mark setup steps as "once per batch" to avoid unnecessary repetition</li>
|
|
202
|
+
</ul>
|
|
203
|
+
</div>
|
|
204
|
+
</div>
|
|
205
|
+
</div>
|
|
206
|
+
</div>
|
|
207
|
+
</div>
|
|
208
|
+
<div class="modal-footer">
|
|
209
|
+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
<style>
|
|
214
|
+
/* Tips button styling */
|
|
215
|
+
.tips-button {
|
|
216
|
+
position: fixed;
|
|
217
|
+
bottom: 30px;
|
|
218
|
+
right: 30px;
|
|
219
|
+
width: 60px;
|
|
220
|
+
height: 60px;
|
|
221
|
+
border-radius: 50%;
|
|
222
|
+
font-size: 24px;
|
|
223
|
+
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|
224
|
+
z-index: 1000;
|
|
225
|
+
display: flex;
|
|
226
|
+
align-items: center;
|
|
227
|
+
justify-content: center;
|
|
228
|
+
transition: all 0.3s ease;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.tips-button:hover {
|
|
232
|
+
transform: scale(1.1);
|
|
233
|
+
box-shadow: 0 6px 20px rgba(0,0,0,0.2);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.tips-button i {
|
|
237
|
+
line-height: 1;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
.accordion-body code {
|
|
242
|
+
background-color: #f8f9fa;
|
|
243
|
+
padding: 2px 6px;
|
|
244
|
+
border-radius: 3px;
|
|
245
|
+
color: #d63384;
|
|
246
|
+
}
|
|
247
|
+
/* Batch mode visual styling */
|
|
248
|
+
.workflow-left {
|
|
249
|
+
display: flex;
|
|
250
|
+
flex-direction: column;
|
|
251
|
+
align-items: center;
|
|
252
|
+
gap: 10px;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.workflow-right {
|
|
256
|
+
display: flex;
|
|
257
|
+
flex-direction: column;
|
|
258
|
+
align-items: center;
|
|
259
|
+
gap: 10px;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.sample-group {
|
|
263
|
+
display: flex;
|
|
264
|
+
gap: 8px;
|
|
265
|
+
padding: 10px;
|
|
266
|
+
background: #f8f9fa;
|
|
267
|
+
border-radius: 6px;
|
|
268
|
+
border: 1px dashed #dee2e6;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.step-box {
|
|
272
|
+
padding: 12px 20px;
|
|
273
|
+
border-radius: 6px;
|
|
274
|
+
font-size: 0.85em;
|
|
275
|
+
text-align: center;
|
|
276
|
+
min-width: 120px;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.step-box.regular {
|
|
280
|
+
background: white;
|
|
281
|
+
border: 2px solid #dee2e6;
|
|
282
|
+
color: #495057;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.step-box.batch {
|
|
286
|
+
background: #e7f3ff;
|
|
287
|
+
border: 2px solid #0d6efd;
|
|
288
|
+
color: #0d6efd;
|
|
289
|
+
font-weight: 600;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.step-box-small {
|
|
293
|
+
padding: 8px 12px;
|
|
294
|
+
border-radius: 4px;
|
|
295
|
+
font-size: 0.75em;
|
|
296
|
+
text-align: center;
|
|
297
|
+
background: white;
|
|
298
|
+
border: 1px solid #dee2e6;
|
|
299
|
+
color: #495057;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.step-box-small.regular {
|
|
303
|
+
background: white;
|
|
304
|
+
border: 1px solid #dee2e6;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.arrow-down {
|
|
308
|
+
font-size: 1.5em;
|
|
309
|
+
color: #6c757d;
|
|
310
|
+
line-height: 1;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.arrow {
|
|
314
|
+
font-size: 1.2em;
|
|
315
|
+
color: #6c757d;
|
|
316
|
+
}
|
|
317
|
+
</style>
|
|
318
|
+
</div>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{# Operations panel component #}
|
|
2
|
+
<div style="margin-bottom: 4vh;"></div>
|
|
3
|
+
<div class="accordion accordion-flush">
|
|
4
|
+
<div class="accordion-item design-control">
|
|
5
|
+
<h5 class="accordion-header">
|
|
6
|
+
<button class="accordion-button" data-bs-toggle="collapse" data-bs-target="#flow" role="button" aria-expanded="false" aria-controls="collapseExample">
|
|
7
|
+
Flow control
|
|
8
|
+
</button>
|
|
9
|
+
</h5>
|
|
10
|
+
<div class="accordion-collapse collapse show" id="flow">
|
|
11
|
+
<ul class="list-group">
|
|
12
|
+
<button class="list-group-item list-group-item-action"
|
|
13
|
+
type="button"
|
|
14
|
+
name="device"
|
|
15
|
+
value="flow_control"
|
|
16
|
+
data-get-url="{{ url_for('design.get_operation_sidebar', instrument='flow_control') }}"
|
|
17
|
+
onclick="updateInstrumentPanel(this)">
|
|
18
|
+
Flow control
|
|
19
|
+
</button>
|
|
20
|
+
</ul>
|
|
21
|
+
</div>
|
|
22
|
+
<h5 class="accordion-header">
|
|
23
|
+
<button class="accordion-button" data-bs-toggle="collapse" data-bs-target="#deck" role="button" aria-expanded="false" aria-controls="collapseExample">
|
|
24
|
+
Instruments
|
|
25
|
+
</button>
|
|
26
|
+
</h5>
|
|
27
|
+
<div class="accordion-collapse collapse show" id="deck">
|
|
28
|
+
<ul class="list-group">
|
|
29
|
+
{% for instrument in defined_variables %}
|
|
30
|
+
<button class="list-group-item list-group-item-action"
|
|
31
|
+
type="button"
|
|
32
|
+
name="device"
|
|
33
|
+
value="{{instrument}}"
|
|
34
|
+
data-get-url="{{ url_for('design.get_operation_sidebar', instrument=instrument) }}"
|
|
35
|
+
onclick="updateInstrumentPanel(this)">
|
|
36
|
+
{{ instrument | format_name }}
|
|
37
|
+
</button>
|
|
38
|
+
{% endfor %}
|
|
39
|
+
</ul>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
{% if block_variables %}
|
|
43
|
+
<div class="accordion-item design-control">
|
|
44
|
+
<h5 class="accordion-header">
|
|
45
|
+
<button class="accordion-button" data-bs-toggle="collapse" data-bs-target="#block" role="button" aria-expanded="false" aria-controls="collapseExample">
|
|
46
|
+
Methods
|
|
47
|
+
</button>
|
|
48
|
+
</h5>
|
|
49
|
+
<div class="accordion-collapse collapse show" id="block">
|
|
50
|
+
<ul class="list-group">
|
|
51
|
+
{% for category in block_variables %}
|
|
52
|
+
<button class="list-group-item list-group-item-action"
|
|
53
|
+
type="button"
|
|
54
|
+
name="device"
|
|
55
|
+
value="{{category}}"
|
|
56
|
+
data-get-url="{{ url_for('design.get_operation_sidebar', instrument=category) }}"
|
|
57
|
+
onclick="updateInstrumentPanel(this)">
|
|
58
|
+
{{ category|format_name }}
|
|
59
|
+
</button>
|
|
60
|
+
{% endfor%}
|
|
61
|
+
</ul>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
{% endif %}
|
|
65
|
+
{% if local_variables %}
|
|
66
|
+
<div class="accordion-item design-control">
|
|
67
|
+
<h5 class="accordion-header">
|
|
68
|
+
<button class="accordion-button" data-bs-toggle="collapse" data-bs-target="#local" role="button" aria-expanded="false" aria-controls="collapseExample">
|
|
69
|
+
Temp instruments
|
|
70
|
+
</button>
|
|
71
|
+
</h5>
|
|
72
|
+
<div class="accordion-collapse collapse show" id="local">
|
|
73
|
+
<ul class="list-group">
|
|
74
|
+
{% for instrument in local_variables %}
|
|
75
|
+
<button class="list-group-item list-group-item-action"
|
|
76
|
+
type="button"
|
|
77
|
+
name="device"
|
|
78
|
+
value="{{instrument}}"
|
|
79
|
+
data-get-url="{{ url_for('design.get_operation_sidebar', instrument=instrument) }}"
|
|
80
|
+
onclick="updateInstrumentPanel(this)">
|
|
81
|
+
{{instrument}}
|
|
82
|
+
</button>
|
|
83
|
+
{% endfor%}
|
|
84
|
+
</ul>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
{% endif %}
|
|
88
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<div class="modal fade" id="dropModal" tabindex="-1" role="dialog">
|
|
2
|
+
<div class="modal-dialog" role="document">
|
|
3
|
+
<div class="modal-content">
|
|
4
|
+
<div class="modal-header">
|
|
5
|
+
<h5 class="modal-title" id="dropModalLabel">Configure Action</h5>
|
|
6
|
+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="modal-body">
|
|
9
|
+
<p>Drop Position ID: <strong id="modalDropTarget"></strong></p>
|
|
10
|
+
<div id="modalFormFields"></div>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="modal-footer">
|
|
13
|
+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{# JSON import modal component #}
|
|
2
|
+
<div class="modal fade" id="jsonModal" tabindex="-1" aria-labelledby="jsonModal" aria-hidden="true" >
|
|
3
|
+
<div class="modal-dialog">
|
|
4
|
+
<div class="modal-content">
|
|
5
|
+
<div class="modal-header">
|
|
6
|
+
<h1 class="modal-title fs-5" id="jsonModal">Import from JSON</h1>
|
|
7
|
+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
8
|
+
</div>
|
|
9
|
+
<form method="POST" action="{{ url_for('design.design_files.load_json') }}" enctype="multipart/form-data">
|
|
10
|
+
<div class="modal-body">
|
|
11
|
+
<div class="input-group mb-3">
|
|
12
|
+
<input class="form-control" type="file" name="file" required="required">
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="modal-footer">
|
|
16
|
+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"> Close </button>
|
|
17
|
+
<button type="submit" class="btn btn-primary"> Upload </button>
|
|
18
|
+
</div>
|
|
19
|
+
</form>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{# New script modal component #}
|
|
2
|
+
<div class="modal fade" id="newScriptModal" tabindex="-1" aria-labelledby="newScriptModalLabel" aria-hidden="true">
|
|
3
|
+
<div class="modal-dialog">
|
|
4
|
+
<div class="modal-content">
|
|
5
|
+
<div class="modal-header">
|
|
6
|
+
<h1 class="modal-title fs-5" id="newScriptModalLabel">Save your current editing!</h1>
|
|
7
|
+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="modal-body">
|
|
10
|
+
The current editing won't be saved. Are you sure you want to proceed?
|
|
11
|
+
</div>
|
|
12
|
+
<div class="modal-footer">
|
|
13
|
+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"> Continue editing </button>
|
|
14
|
+
<button class="btn btn-danger" onclick="clearDraft()">Already saved, clear all</button> </div>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{# Rename modal component #}
|
|
2
|
+
<div class="modal fade" id="renameModal" tabindex="-1" aria-labelledby="renameModal" aria-hidden="true" >
|
|
3
|
+
<div class="modal-dialog">
|
|
4
|
+
<div class="modal-content">
|
|
5
|
+
<div class="modal-header">
|
|
6
|
+
<h1 class="modal-title fs-5" id="renameModal">Rename your script</h1>
|
|
7
|
+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
8
|
+
</div>
|
|
9
|
+
<form name="run_name" onsubmit="editScriptName(event)">
|
|
10
|
+
<div class="modal-body">
|
|
11
|
+
<div class="input-group mb-3">
|
|
12
|
+
<label class="input-group-text" for="new-name">Run Name</label>
|
|
13
|
+
<input class="form-control" type="text" name="new-name" id="new-name" value="{{ script['name'] }}" required="required">
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="modal-footer">
|
|
17
|
+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"> Close </button>
|
|
18
|
+
<button type="submit" class="btn btn-primary"> Save</button>
|
|
19
|
+
</div>
|
|
20
|
+
</form>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{# Save as modal component #}
|
|
2
|
+
<div class="modal fade" id="saveasModal" tabindex="-1" aria-labelledby="saveasModal" aria-hidden="true" >
|
|
3
|
+
<div class="modal-dialog">
|
|
4
|
+
<div class="modal-content">
|
|
5
|
+
<div class="modal-header">
|
|
6
|
+
<h1 class="modal-title fs-5" id="saveasModal">Save your script as </h1>
|
|
7
|
+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
8
|
+
</div>
|
|
9
|
+
<form method="POST" name="save-as" action="{{ url_for('library.save_as') }}">
|
|
10
|
+
<div class="modal-body">
|
|
11
|
+
<div class="input-group mb-3">
|
|
12
|
+
<label class="input-group-text" for="run_name">Run Name</label>
|
|
13
|
+
<input class="form-control" type="text" name="run_name" id="run_name" placeholder="{{script['name']}}" required="required">
|
|
14
|
+
</div>
|
|
15
|
+
<div class="form-check form-switch">
|
|
16
|
+
<input class="form-check-input" type="checkbox" name="register_workflow" id="register_workflow">
|
|
17
|
+
<label class="input-group-label" for="register_workflow">Register this workflow</label>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="modal-footer">
|
|
21
|
+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"> Close </button>
|
|
22
|
+
<button type="submit" class="btn btn-primary" > Save </button>
|
|
23
|
+
</div>
|
|
24
|
+
</form>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{# Modals component for experiment builder #}
|
|
2
|
+
{% include 'components/modals/new_script_modal.html' %}
|
|
3
|
+
{% include 'components/modals/saveas_modal.html' %}
|
|
4
|
+
{% include 'components/modals/rename_modal.html' %}
|
|
5
|
+
{% include 'components/modals/json_modal.html' %}
|
|
6
|
+
{% include 'components/modals/drop_modal.html' %}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{# Python code overlay component - Pure HTML #}
|
|
2
|
+
<style>
|
|
3
|
+
.code-overlay {
|
|
4
|
+
position: fixed;
|
|
5
|
+
right: 0;
|
|
6
|
+
top: 180px;
|
|
7
|
+
height: 100vh;
|
|
8
|
+
width: 400px;
|
|
9
|
+
z-index: 1000;
|
|
10
|
+
transition: transform 0.3s ease;
|
|
11
|
+
transform: translateX(100%);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.code-overlay.show {
|
|
15
|
+
transform: translateX(0);
|
|
16
|
+
}
|
|
17
|
+
</style>
|
|
18
|
+
|
|
19
|
+
{% if session.get('show_code') %}
|
|
20
|
+
<div id="pythonCodeOverlay" class="code-overlay bg-light border-start show">
|
|
21
|
+
{% else %}
|
|
22
|
+
<div id="pythonCodeOverlay" class="code-overlay bg-light border-start">
|
|
23
|
+
{% endif %}
|
|
24
|
+
<div class="overlay-header d-flex justify-content-between align-items-center px-3 py-2 border-bottom">
|
|
25
|
+
<strong>Python Code</strong>
|
|
26
|
+
<button class="btn btn-sm btn-outline-secondary" onclick="toggleCodeOverlay()">
|
|
27
|
+
<i class="bi bi-x-lg"></i>
|
|
28
|
+
</button>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="overlay-content p-3">
|
|
31
|
+
<!-- Top toggles (Single / Batch) -->
|
|
32
|
+
<div class="btn-group mb-3">
|
|
33
|
+
<button type="button" class="btn btn-outline-primary mode-toggle active" data-mode="single">Single</button>
|
|
34
|
+
<button type="button" class="btn btn-outline-primary mode-toggle" data-mode="batch">Batch</button>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
{# <!-- Secondary toggles (By Sample / By Step) TODO -->#}
|
|
38
|
+
{# <div class="btn-group mb-3" id="batch-options" style="display: none;">#}
|
|
39
|
+
{# <button type="button" class="btn btn-outline-secondary batch-toggle active" data-batch="sample">By Sample</button>#}
|
|
40
|
+
{# <button type="button" class="btn btn-outline-secondary batch-toggle" data-batch="step">By Step</button>#}
|
|
41
|
+
{# </div>#}
|
|
42
|
+
|
|
43
|
+
<!-- Code display -->
|
|
44
|
+
<pre><code id="python-code" class="language-python">Loading...</code></pre>
|
|
45
|
+
|
|
46
|
+
<!-- Action buttons -->
|
|
47
|
+
<div class="mt-2">
|
|
48
|
+
<button type="button" id="copy-code" class="btn btn-sm btn-outline-success">
|
|
49
|
+
<i class="bi bi-clipboard"></i> Copy
|
|
50
|
+
</button>
|
|
51
|
+
<button type="button" id="download-code" class="btn btn-sm btn-outline-primary">
|
|
52
|
+
<i class="bi bi-download"></i> Download
|
|
53
|
+
</button>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{# Sidebar component for experiment builder #}
|
|
2
|
+
<div class="instrument-panel" id="instrument-panel">
|
|
3
|
+
{% if instrument %}
|
|
4
|
+
<div class="instrument-methods" id="instrument-methods">
|
|
5
|
+
{% include 'components/actions_panel.html' %}
|
|
6
|
+
</div>
|
|
7
|
+
{% else %}
|
|
8
|
+
{# select deck if this is online#}
|
|
9
|
+
{% if off_line %}
|
|
10
|
+
{% include 'components/deck_selector.html' %}
|
|
11
|
+
{% endif %}
|
|
12
|
+
|
|
13
|
+
{% include 'components/instruments_panel.html' %}
|
|
14
|
+
{% endif %}
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{# Text-to-code panel component #}
|
|
2
|
+
<div class="accordion-item text-to-code">
|
|
3
|
+
<h2 class="accordion-header">
|
|
4
|
+
<button class="accordion-button text-to-code" type="button" data-bs-toggle="collapse" data-bs-target="#text-to-code" aria-expanded="false" aria-controls="collapseExample">
|
|
5
|
+
Text-to-Code
|
|
6
|
+
</button>
|
|
7
|
+
</h2>
|
|
8
|
+
<div id="text-to-code" class="accordion-collapse collapse show" data-bs-parent="#accordionActions">
|
|
9
|
+
<div class="accordion-body">
|
|
10
|
+
<form role="form" method='POST' name="generate" id="generate" action="{{url_for('design.generate_code')}}">
|
|
11
|
+
<input type="hidden" id="instrument" name="instrument" value="{{instrument}}">
|
|
12
|
+
<textarea class="form-control" id="prompt" name="prompt" rows="6" aria-describedby="promptHelpBlock">{{ session['prompt'][instrument] if instrument in session['prompt'] else '' }}</textarea>
|
|
13
|
+
<div id="promptHelpBlock" class="form-text">
|
|
14
|
+
This will overwrite current design.
|
|
15
|
+
</div>
|
|
16
|
+
<button type="submit" class="btn btn-dark" id="gen" name="gen">Generate</button>
|
|
17
|
+
</form>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|