-
Notifications
You must be signed in to change notification settings - Fork 0
18 explain how to adapt quickstart to your own lab #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dsmits
wants to merge
10
commits into
main
Choose a base branch
from
18-explain-how-to-adapt-quickstart-to-your-own-lab
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
05cb9e5
Generating api docs from docstrings
dsmits 2ec6ccf
Actual generated api reference
dsmits 1bfd72f
Disable show source
dsmits 7631517
explain sila servers in customization
dsmits 24279b8
Explained wrapper customization
dsmits 5a666d4
Added last parts to customization
dsmits b362f56
Update docs/customization.md
dsmits 4ed39df
Update docs/customization.md
dsmits 62e811c
Renamed processes to processes.md
dsmits b39a70c
Update docs/customization.md
dsmits File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Customization | ||
| To customize the simulated example to your own needs, you will need to take a couple of steps. | ||
|
|
||
| - [Find lab resource classes](#resource_classes) | ||
| - [Find or implement lab SiLA servers](#sila_servers) | ||
| - [Write your device wrappers](#device_wrappers) | ||
| - [Configure your lab definition](#lab_definition) | ||
| - [Write your process descriptions](#process_descriptions) | ||
| - [Customize the robot arm](#robot_arm) | ||
|
|
||
| ## Find lab resource classes {#resource_classes} | ||
| The first step is to find the lab resource classes that you want to use in your lab. The | ||
| [PythonLab](https://gitlab.com/OpenLabAutomation/lab-automation-packages/pythonLab) package provides a set | ||
| of predefined resource classes (see [PythonLab api reference](pythonlab/api_reference.md)) that you can use as a starting | ||
| point. | ||
|
|
||
| ## Find or implement lab SiLA servers {#sila_servers} | ||
| The default method for communicating with lab devices in the LARA lab automation suite is through SiLA servers. | ||
| [SiLA](https://sila-standard.com/) is an open source standard for communication between lab devices and has an active | ||
| community of developers and users. SiLA server implementations for common lab devices can be found in various repositories, | ||
| some of which we link to below: | ||
|
|
||
| - [LARA Lab Automation device integration](https://gitlab.com/OpenLabAutomation/device-integration) | ||
| - [SiLA Awesome List of Servers](https://gitlab.com/SiLA2/sila_awesome#servers) | ||
|
|
||
|
|
||
| ## Write your device wrappers {#device_wrappers} | ||
| The communication between the lab orchestrator and the sila servers is handled by device wrappers. These wrappers | ||
| translate the high-level commands defined in the process descriptions to specific SiLA commands. The | ||
| [quickstart](quickstart.md) example comes with a couple of example wrappers that you can use as a starting point. | ||
| You can find more information about writing device wrappers in the [wrappers documentation](wrappers.md). | ||
|
|
||
| ## Configure your lab definition {#lab_definition} | ||
| Your lab config file describes the available resources in your lab and their capacities. In the quickstart template this | ||
| file is named `platform_config.yaml`. You will need to modify this file to match the resources available in your lab. | ||
| More information about the lab definition can be found at [lab configuration](lab configuration.md). | ||
|
|
||
| ## Write your process descriptions {#process_descriptions} | ||
| A Pythonlab process description describes the steps that should be executed in the lab. They are written in python and | ||
| parsed into a workflow graph by the orchestrator. The process descriptions are the main part of your lab automation and | ||
| you will need to write them to match your specific use case. You can find more information about writing process | ||
| descriptions in the [pythonLab introduction](pythonlab/processes.md). | ||
|
|
||
| ## Customize the robot arm {#robot_arm} | ||
| Customizing the robot arm involves two parts. First of all, you will need to configure the | ||
| [GenericRobotArm](https://gitlab.com/OpenLabAutomation/device-integration/genericroboticarm) SiLA server to match the | ||
| brand and model of your robot arm. | ||
| The [adaptation guide for the GenericRoboticArm](https://gitlab.com/OpenLabAutomation/device-integration/genericroboticarm/-/blob/main/docs/adaption.md) | ||
| provides some guidance on how to do this. | ||
|
|
||
| The second part is to configure locations of your labware and the devices with respect to the robot arm. | ||
| This is done with the RobotTeachingService endpoint on the GenericRobotArm SiLA server. | ||
|
|
||
| More info on configuring the arm and the locations can be found in the [robot arm documentation](robot arm.md). | ||
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| ## Resources | ||
|
|
||
| ### ServiceResources | ||
|
|
||
|
|
||
| ::: pythonlab.resources.services.analysis.PlateReaderServiceResource | ||
|
|
||
|
|
||
| ::: pythonlab.resources.services.labware_storage.LabwareStorageResource | ||
|
|
||
|
|
||
| ::: pythonlab.resources.services.labware_storage.LabwareStorageResourcePool | ||
|
|
||
|
|
||
| ::: pythonlab.resources.services.incubation.IncubatorServiceResource | ||
|
|
||
|
|
||
| ::: pythonlab.resources.services.incubation.IncubatorServiceResourcePool | ||
|
|
||
|
|
||
| ::: pythonlab.resources.services.moving.MoverServiceResource | ||
|
|
||
|
|
||
| ::: pythonlab.resources.services.centrifugation.CentrifugeServiceResource | ||
|
|
||
|
|
||
|
|
||
| ### LabwareResources | ||
|
|
||
|
|
||
| ::: pythonlab.resource.DynamicLabwareResource | ||
|
|
File renamed without changes.
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| from pythonlab.resources.services import * | ||
dsmits marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| from pythonlab.resources import LabwareResource | ||
| from pythonlab.resource import ServiceResource | ||
| import jinja2 | ||
| from pathlib import Path | ||
|
|
||
|
|
||
| template_dir = Path("./templates") | ||
| output_dir = Path("./docs/pythonlab") | ||
|
|
||
|
|
||
| def get_all_subclasses(cls): | ||
| """Recursively get all subclasses of a class.""" | ||
| all_subclasses = [] | ||
| for subclass in cls.__subclasses__(): | ||
| all_subclasses.append(subclass) | ||
| all_subclasses.extend(get_all_subclasses(subclass)) | ||
| return all_subclasses | ||
|
|
||
|
|
||
| def main(): | ||
| # Get all subclasses | ||
| service_subclasses = get_all_subclasses(ServiceResource) | ||
| labware_subclasses = get_all_subclasses(LabwareResource) | ||
|
|
||
| # Set up Jinja2 environment | ||
| env = jinja2.Environment(loader=jinja2.FileSystemLoader(template_dir)) | ||
| template = env.get_template('api_reference.md.jinja2') | ||
|
|
||
| # Render template | ||
| output = template.render( | ||
| service_subclasses=service_subclasses, | ||
| labware_subclasses=labware_subclasses | ||
| ) | ||
|
|
||
dsmits marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # Write output file | ||
| output_file = output_dir / "api_reference.md" | ||
| output_file.write_text(output) | ||
| print(f"Generated {output_file}") | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| ## Resources | ||
|
|
||
| ### ServiceResources | ||
|
|
||
| {% for service in service_subclasses %} | ||
| ::: {{ service.__module__ }}.{{ service.__qualname__ }} | ||
|
|
||
| {% endfor %} | ||
|
|
||
| ### LabwareResources | ||
|
|
||
| {% for labware in labware_subclasses %} | ||
| ::: {{ labware.__module__ }}.{{ labware.__qualname__ }} | ||
|
|
||
| {% endfor %} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.