Skip to content

Commit 04e67d4

Browse files
committed
Mermaid graphs
1 parent 5f2352e commit 04e67d4

File tree

6 files changed

+367
-139
lines changed

6 files changed

+367
-139
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22
serve:
3-
mkdocs serve
3+
mkdocs serve --livereload

docs/pythonlab/examples.md

Lines changed: 78 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,16 @@ class PhysicsMiniProcess(PLProcess):
9494

9595
### Resulting Workflow
9696

97-
```
98-
[Wire] (labware node)
99-
100-
├─→ [measure_amperage] → [I] (variable)
101-
│ │
102-
├─→ [measure_voltage] → [U] (variable)
103-
│ │
104-
└──────────────────────────┴→ [compute_resistance] → [R] (computation)
97+
```mermaid
98+
graph LR
99+
Wire["Wire<br/>(labware node)"]
100+
Wire --> measure_amperage[measure_amperage]
101+
Wire --> measure_voltage[measure_voltage]
102+
measure_amperage --> I["I<br/>(variable)"]
103+
measure_voltage --> U["U<br/>(variable)"]
104+
I --> compute_resistance[compute_resistance]
105+
U --> compute_resistance
106+
compute_resistance --> R["R<br/>(computation)"]
105107
```
106108

107109
### Key Concepts
@@ -194,29 +196,16 @@ class SimpleBioProcess(PLProcess):
194196

195197
### Resulting Workflow
196198

197-
```
198-
[SamplePlate] (labware, origin=Hotel_1, pos=1)
199-
200-
201-
[move to Incubator_37C] (duration=20s)
202-
203-
204-
[incubate] (duration=7200s, temp=310K, shaking=200rpm)
205-
206-
207-
[move to PlateReader] (duration=20s, lidded=False)
208-
209-
210-
[single_read] (duration=30s, wavelength=600nm)
211-
212-
213-
[absorbance] (variable)
214-
215-
216-
[move to Hotel_1] (duration=20s, lidded=True)
217-
218-
219-
[store] (duration=10s, position=1)
199+
```mermaid
200+
graph LR
201+
SamplePlate["SamplePlate<br/>(labware, origin=Hotel_1, pos=1)"]
202+
SamplePlate --> move1["move to Incubator_37C<br/>(duration=20s)"]
203+
move1 --> incubate["incubate<br/>(duration=7200s, temp=310K, shaking=200rpm)"]
204+
incubate --> move2["move to PlateReader<br/>(duration=20s, lidded=False)"]
205+
move2 --> read["single_read<br/>(duration=30s, wavelength=600nm)"]
206+
read --> absorbance["absorbance<br/>(variable)"]
207+
absorbance --> move3["move to Hotel_1<br/>(duration=20s, lidded=True)"]
208+
move3 --> store["store<br/>(duration=10s, position=1)"]
220209
```
221210

222211
### Key Concepts
@@ -330,41 +319,23 @@ class RuntimeDecisionProcess(PLProcess):
330319

331320
### Resulting Workflow
332321

333-
```
334-
[cont_0] (labware)
335-
336-
337-
[move to Incubator1]
338-
339-
340-
[incubate] (80s)
341-
342-
343-
[move to ReaderPool]
344-
345-
346-
[single_read] → [absorb] (variable)
347-
│ │
348-
│ ▼
349-
│ [compute avg] → [avg_abs] (computation)
350-
│ │
351-
│ ▼
352-
│ [if avg_abs < 0.6] (if_node)
353-
│ ╱ ╲
354-
│ True False
355-
│ ╱ ╲
356-
│ [move to Incubator1] [skip to next]
357-
│ │
358-
│ ▼
359-
│ [incubate] (80s)
360-
│ │
361-
└──────────────────┴─────────────────────┘
362-
363-
364-
[move to LabwareStorage_200]
365-
366-
367-
[store]
322+
```mermaid
323+
graph LR
324+
cont_0["cont_0<br/>(labware)"]
325+
cont_0 --> move1[move to Incubator1]
326+
move1 --> incubate1["incubate<br/>(80s)"]
327+
incubate1 --> move2[move to ReaderPool]
328+
move2 --> read[single_read]
329+
read --> absorb["absorb<br/>(variable)"]
330+
absorb --> compute["compute avg"]
331+
compute --> avg_abs["avg_abs<br/>(computation)"]
332+
avg_abs --> if_node{"if avg_abs < 0.6<br/>(if_node)"}
333+
if_node -->|True| move3[move to Incubator1]
334+
if_node -->|False| merge[merge point]
335+
move3 --> incubate2["incubate<br/>(80s)"]
336+
incubate2 --> merge
337+
merge --> move4[move to LabwareStorage_200]
338+
move4 --> store[store]
368339
```
369340

370341
### Key Concepts
@@ -501,37 +472,23 @@ class GrowthCentrifugationProcess(PLProcess):
501472

502473
### Workflow Highlights
503474

504-
```
505-
[4 plates in storage]
506-
507-
508-
[barcode scanning loop] (4 operations)
509-
510-
511-
[move all to incubator] (4 operations)
512-
513-
├─→ [incubate cont_0] (1800s)
514-
│ │
515-
│ ▼
516-
│ [move to reader]
517-
│ │
518-
│ ▼
519-
│ [measure cont_0]
520-
521-
├─→ [incubate cont_1] (1800s)
522-
523-
├─→ [incubate cont_2] (3600s)
524-
525-
└─→ [incubate cont_3] (3600s)
526-
527-
528-
[centrifuge ALL plates] (1200s, rpm=50)
529-
530-
531-
[measurement loop for all plates]
532-
533-
534-
[return all to storage]
475+
```mermaid
476+
graph LR
477+
storage["4 plates in storage"]
478+
storage --> barcode["barcode scanning loop<br/>(4 operations)"]
479+
barcode --> move_all["move all to incubator<br/>(4 operations)"]
480+
move_all --> incubate0["incubate cont_0<br/>(1800s)"]
481+
move_all --> incubate1["incubate cont_1<br/>(1800s)"]
482+
move_all --> incubate2["incubate cont_2<br/>(3600s)"]
483+
move_all --> incubate3["incubate cont_3<br/>(3600s)"]
484+
incubate0 --> move_reader["move to reader"]
485+
move_reader --> measure0["measure cont_0"]
486+
incubate1 --> centrifuge
487+
incubate2 --> centrifuge
488+
incubate3 --> centrifuge
489+
measure0 --> centrifuge["centrifuge ALL plates<br/>(1200s, rpm=50)"]
490+
centrifuge --> measure_loop["measurement loop<br/>for all plates"]
491+
measure_loop --> return["return all to storage"]
535492
```
536493

537494
### Key Concepts
@@ -642,45 +599,30 @@ class ComplexDecisionProcess(PLProcess):
642599

643600
### Workflow Structure
644601

645-
```
646-
For each plate:
647-
[incubate] (3600s)
648-
649-
650-
[measure 600nm] → [abs_600]
651-
│ │
652-
│ ▼
653-
│ [calculate density]
654-
│ │
655-
│ ▼
656-
│ [if density < 0.3]
657-
│ ╱ │ ╲
658-
│ True False ...
659-
│ │ │
660-
│ [incubate [if density < 0.7]
661-
│ 7200s] ╱ ╲
662-
│ True False
663-
│ │ │
664-
│ [incubate] [measure 660nm]
665-
│ 3600s] │
666-
│ ▼
667-
│ [calculate ratio]
668-
│ │
669-
│ ▼
670-
│ [if ratio > 1.5]
671-
│ ╱ ╲
672-
│ True False
673-
│ │ │
674-
│ [incubate] [skip]
675-
│ 1800s]
676-
│ │
677-
└──────────────────┴─────────────┘
678-
679-
680-
[final measurement]
681-
682-
683-
[storage]
602+
```mermaid
603+
graph LR
604+
start["For each plate"]
605+
start --> incubate1["incubate<br/>(3600s)"]
606+
incubate1 --> measure600["measure 600nm"]
607+
measure600 --> abs_600["abs_600<br/>(variable)"]
608+
abs_600 --> calc_density["calculate density"]
609+
calc_density --> density["density<br/>(computation)"]
610+
density --> if1{"if density < 0.3"}
611+
if1 -->|True| incubate_long["incubate<br/>(7200s)"]
612+
if1 -->|False| if2{"if density < 0.7"}
613+
if2 -->|True| incubate_med["incubate<br/>(3600s)"]
614+
if2 -->|False| measure660["measure 660nm"]
615+
measure660 --> abs_660["abs_660<br/>(variable)"]
616+
abs_660 --> calc_ratio["calculate ratio"]
617+
calc_ratio --> ratio["ratio<br/>(computation)"]
618+
ratio --> if3{"if ratio > 1.5"}
619+
if3 -->|True| incubate_short["incubate<br/>(1800s)"]
620+
if3 -->|False| merge
621+
incubate_long --> merge[merge point]
622+
incubate_med --> merge
623+
incubate_short --> merge
624+
merge --> final_measure["final measurement"]
625+
final_measure --> storage[storage]
684626
```
685627

686628
### Key Concepts

docs/wrappers.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ class MyWrapper(DeviceInterface):
1919
### ProcessStep
2020
Describes the step that should be executed.
2121

22+
hoi
23+
bla
24+
2225
### ContainerInfo
2326
Describes the container that is handled
2427

mkdocs.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,23 @@
11
site_name: Lab automation docs
2+
3+
markdown_extensions:
4+
- pymdownx.highlight:
5+
anchor_linenums: true
6+
line_spans: __span
7+
pygments_lang_class: true
8+
- pymdownx.inlinehilite
9+
- pymdownx.snippets
10+
- pymdownx.superfences:
11+
custom_fences:
12+
- name: mermaid
13+
class: mermaid
14+
format: !!python/name:pymdownx.superfences.fence_code_format
15+
16+
theme:
17+
name: material
18+
features:
19+
- content.code.copy
20+
21+
plugins:
22+
- search
23+
- mermaid2

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ readme = "README.md"
66
requires-python = ">=3.13"
77
dependencies = [
88
"mkdocs>=1.6.1",
9+
"mkdocs-material>=9.6.22",
10+
"mkdocs-mermaid2-plugin>=1.2.3",
11+
"pygments>=2.19.2",
12+
"pymdown-extensions>=10.16.1",
913
]

0 commit comments

Comments
 (0)