Skip to content

Commit 6a5ac6c

Browse files
authored
Merge pull request #25 from OSLA-project/18-explain-how-to-adapt-quickstart-to-your-own-lab
18 explain how to adapt quickstart to your own lab
2 parents 5e63529 + b39a70c commit 6a5ac6c

13 files changed

Lines changed: 286 additions & 4 deletions

docs/customization.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Customization
2+
To customize the simulated example to your own needs, you will need to take a couple of steps.
3+
4+
- [Find lab resource classes](#resource_classes)
5+
- [Find or implement lab SiLA servers](#sila_servers)
6+
- [Write your device wrappers](#device_wrappers)
7+
- [Configure your lab definition](#lab_definition)
8+
- [Write your process descriptions](#process_descriptions)
9+
- [Customize the robot arm](#robot_arm)
10+
11+
## Find lab resource classes {#resource_classes}
12+
The first step is to find the lab resource classes that you want to use in your lab. The
13+
[PythonLab](https://gitlab.com/OpenLabAutomation/lab-automation-packages/pythonLab) package provides a set
14+
of predefined resource classes (see [PythonLab api reference](pythonlab/api_reference.md)) that you can use as a starting
15+
point.
16+
17+
## Find or implement lab SiLA servers {#sila_servers}
18+
The default method for communicating with lab devices in the LARA lab automation suite is through SiLA servers.
19+
[SiLA](https://sila-standard.com/) is an open source standard for communication between lab devices and has an active
20+
community of developers and users. SiLA server implementations for common lab devices can be found in various repositories,
21+
some of which we link to below:
22+
23+
- [LARA Lab Automation device integration](https://gitlab.com/OpenLabAutomation/device-integration)
24+
- [SiLA Awesome List of Servers](https://gitlab.com/SiLA2/sila_awesome#servers)
25+
26+
27+
## Write your device wrappers {#device_wrappers}
28+
The communication between the lab orchestrator and the sila servers is handled by device wrappers. These wrappers
29+
translate the high-level commands defined in the process descriptions to specific SiLA commands. The
30+
[quickstart](quickstart.md) example comes with a couple of example wrappers that you can use as a starting point.
31+
You can find more information about writing device wrappers in the [wrappers documentation](wrappers.md).
32+
33+
## Configure your lab definition {#lab_definition}
34+
Your lab config file describes the available resources in your lab and their capacities. In the quickstart template this
35+
file is named `platform_config.yaml`. You will need to modify this file to match the resources available in your lab.
36+
More information about the lab definition can be found at [lab configuration](lab configuration.md).
37+
38+
## Write your process descriptions {#process_descriptions}
39+
A Pythonlab process description describes the steps that should be executed in the lab. They are written in python and
40+
parsed into a workflow graph by the orchestrator. The process descriptions are the main part of your lab automation and
41+
you will need to write them to match your specific use case. You can find more information about writing process
42+
descriptions in the [pythonLab introduction](pythonlab/processes.md).
43+
44+
## Customize the robot arm {#robot_arm}
45+
Customizing the robot arm involves two parts. First of all, you will need to configure the
46+
[GenericRobotArm](https://gitlab.com/OpenLabAutomation/device-integration/genericroboticarm) SiLA server to match the
47+
brand and model of your robot arm.
48+
The [adaptation guide for the GenericRoboticArm](https://gitlab.com/OpenLabAutomation/device-integration/genericroboticarm/-/blob/main/docs/adaption.md)
49+
provides some guidance on how to do this.
50+
51+
The second part is to configure locations of your labware and the devices with respect to the robot arm.
52+
This is done with the RobotTeachingService endpoint on the GenericRobotArm SiLA server.
53+
54+
More info on configuring the arm and the locations can be found in the [robot arm documentation](robot arm.md).

docs/lab configuration.md

Whitespace-only changes.

docs/pythonlab/api_reference.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
## Resources
2+
3+
### ServiceResources
4+
5+
6+
::: pythonlab.resources.services.analysis.PlateReaderServiceResource
7+
8+
9+
::: pythonlab.resources.services.labware_storage.LabwareStorageResource
10+
11+
12+
::: pythonlab.resources.services.labware_storage.LabwareStorageResourcePool
13+
14+
15+
::: pythonlab.resources.services.incubation.IncubatorServiceResource
16+
17+
18+
::: pythonlab.resources.services.incubation.IncubatorServiceResourcePool
19+
20+
21+
::: pythonlab.resources.services.moving.MoverServiceResource
22+
23+
24+
::: pythonlab.resources.services.centrifugation.CentrifugeServiceResource
25+
26+
27+
28+
### LabwareResources
29+
30+
31+
::: pythonlab.resource.DynamicLabwareResource
32+
File renamed without changes.

docs/pythonlab/processes.md

Whitespace-only changes.

docs/quickstart.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Quickstart
22
## Simulated example
33
The fastest way to try out the LARA suite is by running the simulated example provided by the
4-
[adaptation template](https://gitlab.com/OpenLabAutomation/adaption-template).
4+
[adaptation template](https://gitlab.com/OpenLabAutomation/adaption-template). After the adaptation is set up, you can start customizing it to your needs by following the
5+
instructions in the [customization guide](customization.md).
56

67
There are two ways to run the example: using Docker or running it directly with Python.
78

docs/robot arm.md

Whitespace-only changes.

docs/wrappers.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Wrappers
22
Wrappers are the interface between the lab orchestrator and the actual devices. They translate the high-level commands
3-
defined in ?? to specific SILA commands.
3+
defined in PythonLab to specific SILA commands.
44

55
## The wrapper structure
66

@@ -19,8 +19,6 @@ class MyWrapper(DeviceInterface):
1919
### ProcessStep
2020
Describes the step that should be executed.
2121

22-
hoi
23-
bla
2422

2523
### ContainerInfo
2624
Describes the container that is handled

generate_docs.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
from pythonlab.resources.services import *
2+
from pythonlab.resources import LabwareResource
3+
from pythonlab.resource import ServiceResource
4+
import jinja2
5+
from pathlib import Path
6+
7+
8+
template_dir = Path("./templates")
9+
output_dir = Path("./docs/pythonlab")
10+
11+
12+
def get_all_subclasses(cls):
13+
"""Recursively get all subclasses of a class."""
14+
all_subclasses = []
15+
for subclass in cls.__subclasses__():
16+
all_subclasses.append(subclass)
17+
all_subclasses.extend(get_all_subclasses(subclass))
18+
return all_subclasses
19+
20+
21+
def main():
22+
# Get all subclasses
23+
service_subclasses = get_all_subclasses(ServiceResource)
24+
labware_subclasses = get_all_subclasses(LabwareResource)
25+
26+
# Set up Jinja2 environment
27+
env = jinja2.Environment(loader=jinja2.FileSystemLoader(template_dir))
28+
template = env.get_template('api_reference.md.jinja2')
29+
30+
# Render template
31+
output = template.render(
32+
service_subclasses=service_subclasses,
33+
labware_subclasses=labware_subclasses
34+
)
35+
36+
# Write output file
37+
output_file = output_dir / "api_reference.md"
38+
output_file.write_text(output)
39+
print(f"Generated {output_file}")
40+
41+
42+
if __name__ == "__main__":
43+
main()

mkdocs.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,14 @@ theme:
4141
plugins:
4242
- search
4343
- mermaid2
44+
- mkdocstrings:
45+
handlers:
46+
python:
47+
options:
48+
show_source: false
49+
show_root_heading: true
50+
show_root_full_path: true
51+
docstring_style: sphinx
52+
4453
- panzoom:
4554
full_screen: true

0 commit comments

Comments
 (0)