uuPythonlab 0.2.4__tar.gz

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.
@@ -0,0 +1,17 @@
1
+
2
+ # Acknowledgements and Credits
3
+
4
+ The pythonLab project thanks
5
+
6
+
7
+ Contributors
8
+ ------------
9
+
10
+ * Stefan Maak <stefan.maak@uni-greifswald.de>
11
+ * Mickey Kim <mickey.kim@genomicsengland.co.uk> ! Thanks for the phantastic cookiecutter template !
12
+
13
+
14
+ Development Lead
15
+ ----------------
16
+
17
+ * mark doerr <mark.doerr@uni-greifswald.de>
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022, mark doerr
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,232 @@
1
+ Metadata-Version: 2.4
2
+ Name: uuPythonlab
3
+ Version: 0.2.4
4
+ License-Expression: MIT
5
+ Classifier: Development Status :: 2 - Pre-Alpha
6
+ Classifier: Intended Audience :: Developers
7
+ Classifier: Intended Audience :: Science/Research
8
+ Classifier: Intended Audience :: Education
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Natural Language :: English
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.8
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Topic :: Scientific/Engineering
16
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
17
+ Classifier: Topic :: Scientific/Engineering :: Visualization
18
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
19
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ License-File: AUTHORS.md
23
+ Requires-Dist: graphviz
24
+ Requires-Dist: networkx
25
+ Dynamic: license-file
26
+
27
+ # pythonLab
28
+
29
+ This is the specification and development repository of
30
+ **pythonLab**, a universal, extendable and safe language for laboratory processes.
31
+
32
+ Reproducibility and reliability is in the core of science.
33
+ Describing lab operations in an precise, easy and standardised form will help to transfer knowledge in every lab around the world.
34
+ A *laboratory process description language* is a long desired goal in laboratory process standardisation and lab automation.
35
+ It will enable automated execution of steps and better machine learning and AI predictions, since these process descriptions can be packed as metadata to the data resulting form this process.
36
+
37
+ Since this process language needs many characteristics of a programming language, like conditions (if ...), loops (for/while), variables, etc. we do not want to re-invent the wheel twice but rather use the **python syntax**, which is very popular in science.
38
+
39
+ ## Key (desired) Features
40
+
41
+ * easy and simple to learn and write (close to simple English)
42
+ * clear, human readable syntax
43
+ * universal - applicable for most laboratory operations
44
+ * transferable from one lab to another
45
+ * easy mapping between abstract resource representation and actual lab resource
46
+ * [*Turing-complete*](https://en.wikipedia.org/wiki/Turing_completeness), including conditions and loops
47
+ * easy extendible - prepared for the constant development of science
48
+ * close to real laboratory work
49
+ * vendor independent
50
+ * safe to execute
51
+ * converter from other lab description languages to pythonLab easy to implement
52
+
53
+ ## Applications of pythonLab
54
+
55
+ * general lab processes, common in any natural sciences lab (very broad application)
56
+ * description of lab automation workflows
57
+ * workflows on the lab devices (e.g. HPLC processes - sometimes also called 'methods', plate reader processes etc.)
58
+ * data evaluation workflows
59
+
60
+ ## Architecture of pythonLab
61
+
62
+ pythonLab processes are denoted in a python like syntax, but they are **not** directly executed by a *python interpreter*. They are rather parsed into a *workflow graph*, which can be used by a *Scheduler* to calculate
63
+ an optimal schedule (=order of execution). This order of execution might be different from the initial notation. An *Orchestrator* executes then the schedule and supervises the device communication, e.g. to SiLA servers/devices.
64
+
65
+ ![pythonLab Architecture](docs/images/pythonLab_architecture_overview.svg)
66
+
67
+ ## [Specification](https://opensourcelab.gitlab.io/pythonLab/specification/0_specification_base.html)
68
+
69
+ Please find a draft of the pythonLab specification in [docs/specification](https://pythonlabor.gitlab.io/pythonLab/specification/specification.html) (very early stage !).
70
+
71
+ Very briefly, the generic lab description language should have many features a common programming language has and following the desired *Turning-completeness*, like:
72
+
73
+ - variables (x = value)
74
+ - conditions (if, else, ...)
75
+ - loops (for ... while ....)
76
+ - functions / methods and subroutines
77
+ - modules
78
+ - namespaces and versions for unique addressing of a process step
79
+ - (at a later stage of language development: object orientation)
80
+
81
+ **!! This is a proposal - we would like to discuss it with a wide range of scientist to find the best common ground**
82
+
83
+ ## [Documentation](https://opensourcelab.gitlab.io/pythonLab/)
84
+
85
+ The pythonLab Documentation can be found in [docs](https://pythonlabor.gitlab.io/pythonLab/)
86
+
87
+ ## Language Core extensions
88
+
89
+ extensible Modules for e.g.
90
+ - liquid handling
91
+ - cultivation
92
+ - (bio-chemical) assays
93
+ - molecular biology
94
+ - chemical synthesis
95
+ - data evaluation
96
+
97
+ are in preparation
98
+
99
+
100
+ ## Examples
101
+
102
+ A simple description of liquid transfer step
103
+
104
+ ```python
105
+
106
+ # using settings: volume unit: uL, liquid class: water
107
+ # these are set in a settings module
108
+ # specifying resources
109
+ from pythonlab.resource import LabwareResource, DeviceResource
110
+ from pythonlab.liquid_handling import aspirate, dispense
111
+
112
+ cont1 = LabwareResource()
113
+ cont2 = LabwareResource()
114
+ liquid_handler = DeviceResource()
115
+
116
+ # process steps
117
+ liquid_handler.aspirate(cont1, row=1, col=3, vol=4.0)
118
+ liquid_handler.dispense(cont2, row=2, col=3 , vol=7.2)
119
+ ...
120
+
121
+ ```
122
+
123
+ A bit more complex example
124
+
125
+ ```python
126
+ # default units (SI) are specified in the standard unit module
127
+ # additional unit definitions can be added in the code
128
+ # specifying resources
129
+
130
+ from pythonlab.resource.labware import LabwareResource
131
+ from pythonlab.resource.services import MoverServiceResource, IncubationServiceResource
132
+
133
+ cont1 = LabwareResource()
134
+ mover = MoverServiceResource()
135
+ incubator = IncubationServiceResource()
136
+ start_pos = cont1.set_start_position(pos=1)
137
+ incubation_duration = 6 # hours
138
+
139
+ # initialise the process
140
+ incubator.init()
141
+ # process steps
142
+ mover.move(cont1, start_pos, incubator.nest1)
143
+ incubator.incubate(cont1, incubation_duration, unit="h")
144
+ mover.move(cont1, incubator.nest1, start_pos)
145
+
146
+
147
+ ...
148
+
149
+ ```
150
+
151
+ And finally a higher level example
152
+
153
+ ```python
154
+ # default units (SI) are specified in the standard unit module
155
+ # additional unit definitions can be added in the code
156
+ # specifying resources
157
+
158
+ from pythonlab.resource.labware import LabwareResource
159
+ from pythonlab.resource.services import MoverServiceResource, DispensionServiceResource, IncubationServiceResource
160
+
161
+ from pythonlab.processes.base import incubate, centrifugate
162
+ from pythonlab.bioprocess import inoculate
163
+
164
+ Labware_set = [LabwareResource(name=f"growth_plate_{cont}")
165
+ for cont in range(8)]
166
+
167
+ dispenser = DispensionServiceResource()
168
+ incubator = IncubationServiceResource()
169
+
170
+ inoculate([dispenser, Labware_set], source="starting_culture")
171
+ incubate([incubator, Labware_set], temp=310.0, shaking=(700,2) ) # temp in K
172
+ centrifugate([incubator, Labware_set], duration=600, force=4500)
173
+
174
+ ...
175
+
176
+ ```
177
+ ## Why python ?
178
+
179
+ Python is a programming language that is very common in modern scientific laboratories and covers all the desired characteristics we expect of a user-friendly lab process programming language.
180
+
181
+ The syntax is very simple, and intuitive to learn.
182
+ Syntax validation comes for free: the python interpreter already does it.
183
+
184
+ Standardisation of a minimal set of functionally will be achieved by standardised packages provided by this site (or any publicly available site).
185
+ Defined namespaces and versioning allow unique addressing of a process step.
186
+
187
+
188
+ ## [Implementation](./implementation)
189
+
190
+ As a proof-of-concept we are planning to provide a [pypy-sandbox](https://www.pypy.org) implementation in the future.
191
+ [pypy-sandbox](https://www.pypy.org) offerers a safe execution environment to execute insecure code.
192
+ A new version is currently developed to by the pypy community.
193
+ Alternatively WASM will be a possible safe execution environment.
194
+
195
+ ## Related projects
196
+
197
+ Here is an incomplete list of related OpenSource projects - please let us know, if we missed a relevant project.
198
+
199
+ ### [Autoprotocoll](http://autoprotocol.org)
200
+
201
+ * Syntax: JSON based
202
+ * (-) not *Turing complete*
203
+ * (-) hard to write and read by humans
204
+
205
+ ### [LabOP](https://bioprotocols.github.io/labop/)
206
+
207
+ * Syntax: RDF / python
208
+ * (-) not *Turing complete* (?)
209
+ * (-) hard to write and read by humans
210
+
211
+ ### [RoboLiq](https://ellis.github.io/roboliq/protocol/index.html)
212
+
213
+ * Syntax: yaml / Javascript
214
+ * (-) not *Turing complete*
215
+ * (-) hard to write and read by humans
216
+ * (-) design not clearly specified
217
+
218
+ ## Repository Maintainer:
219
+
220
+ * mark doerr (mark.doerr@uni-greifswald.de)
221
+
222
+ ## Documentation
223
+
224
+ The Documentation can be found here: [opensourcelab.gitlab.io/pythonLab](opensourcelab.gitlab.io/pythonLab) or [pythonLab.gitlab.io](pythonlab.gitlab.io/)
225
+
226
+
227
+ ## Credits
228
+
229
+ This package was created with Cookiecutter* and the `opensource/templates/cookiecutter-pypackage`* project template.
230
+
231
+ [Cookiecutter](https://github.com/audreyr/cookiecutter )
232
+ [opensource/templates/cookiecutter-pypackage](https://gitlab.com/opensourcelab/software-dev/cookiecutter-pypackage)
@@ -0,0 +1,206 @@
1
+ # pythonLab
2
+
3
+ This is the specification and development repository of
4
+ **pythonLab**, a universal, extendable and safe language for laboratory processes.
5
+
6
+ Reproducibility and reliability is in the core of science.
7
+ Describing lab operations in an precise, easy and standardised form will help to transfer knowledge in every lab around the world.
8
+ A *laboratory process description language* is a long desired goal in laboratory process standardisation and lab automation.
9
+ It will enable automated execution of steps and better machine learning and AI predictions, since these process descriptions can be packed as metadata to the data resulting form this process.
10
+
11
+ Since this process language needs many characteristics of a programming language, like conditions (if ...), loops (for/while), variables, etc. we do not want to re-invent the wheel twice but rather use the **python syntax**, which is very popular in science.
12
+
13
+ ## Key (desired) Features
14
+
15
+ * easy and simple to learn and write (close to simple English)
16
+ * clear, human readable syntax
17
+ * universal - applicable for most laboratory operations
18
+ * transferable from one lab to another
19
+ * easy mapping between abstract resource representation and actual lab resource
20
+ * [*Turing-complete*](https://en.wikipedia.org/wiki/Turing_completeness), including conditions and loops
21
+ * easy extendible - prepared for the constant development of science
22
+ * close to real laboratory work
23
+ * vendor independent
24
+ * safe to execute
25
+ * converter from other lab description languages to pythonLab easy to implement
26
+
27
+ ## Applications of pythonLab
28
+
29
+ * general lab processes, common in any natural sciences lab (very broad application)
30
+ * description of lab automation workflows
31
+ * workflows on the lab devices (e.g. HPLC processes - sometimes also called 'methods', plate reader processes etc.)
32
+ * data evaluation workflows
33
+
34
+ ## Architecture of pythonLab
35
+
36
+ pythonLab processes are denoted in a python like syntax, but they are **not** directly executed by a *python interpreter*. They are rather parsed into a *workflow graph*, which can be used by a *Scheduler* to calculate
37
+ an optimal schedule (=order of execution). This order of execution might be different from the initial notation. An *Orchestrator* executes then the schedule and supervises the device communication, e.g. to SiLA servers/devices.
38
+
39
+ ![pythonLab Architecture](docs/images/pythonLab_architecture_overview.svg)
40
+
41
+ ## [Specification](https://opensourcelab.gitlab.io/pythonLab/specification/0_specification_base.html)
42
+
43
+ Please find a draft of the pythonLab specification in [docs/specification](https://pythonlabor.gitlab.io/pythonLab/specification/specification.html) (very early stage !).
44
+
45
+ Very briefly, the generic lab description language should have many features a common programming language has and following the desired *Turning-completeness*, like:
46
+
47
+ - variables (x = value)
48
+ - conditions (if, else, ...)
49
+ - loops (for ... while ....)
50
+ - functions / methods and subroutines
51
+ - modules
52
+ - namespaces and versions for unique addressing of a process step
53
+ - (at a later stage of language development: object orientation)
54
+
55
+ **!! This is a proposal - we would like to discuss it with a wide range of scientist to find the best common ground**
56
+
57
+ ## [Documentation](https://opensourcelab.gitlab.io/pythonLab/)
58
+
59
+ The pythonLab Documentation can be found in [docs](https://pythonlabor.gitlab.io/pythonLab/)
60
+
61
+ ## Language Core extensions
62
+
63
+ extensible Modules for e.g.
64
+ - liquid handling
65
+ - cultivation
66
+ - (bio-chemical) assays
67
+ - molecular biology
68
+ - chemical synthesis
69
+ - data evaluation
70
+
71
+ are in preparation
72
+
73
+
74
+ ## Examples
75
+
76
+ A simple description of liquid transfer step
77
+
78
+ ```python
79
+
80
+ # using settings: volume unit: uL, liquid class: water
81
+ # these are set in a settings module
82
+ # specifying resources
83
+ from pythonlab.resource import LabwareResource, DeviceResource
84
+ from pythonlab.liquid_handling import aspirate, dispense
85
+
86
+ cont1 = LabwareResource()
87
+ cont2 = LabwareResource()
88
+ liquid_handler = DeviceResource()
89
+
90
+ # process steps
91
+ liquid_handler.aspirate(cont1, row=1, col=3, vol=4.0)
92
+ liquid_handler.dispense(cont2, row=2, col=3 , vol=7.2)
93
+ ...
94
+
95
+ ```
96
+
97
+ A bit more complex example
98
+
99
+ ```python
100
+ # default units (SI) are specified in the standard unit module
101
+ # additional unit definitions can be added in the code
102
+ # specifying resources
103
+
104
+ from pythonlab.resource.labware import LabwareResource
105
+ from pythonlab.resource.services import MoverServiceResource, IncubationServiceResource
106
+
107
+ cont1 = LabwareResource()
108
+ mover = MoverServiceResource()
109
+ incubator = IncubationServiceResource()
110
+ start_pos = cont1.set_start_position(pos=1)
111
+ incubation_duration = 6 # hours
112
+
113
+ # initialise the process
114
+ incubator.init()
115
+ # process steps
116
+ mover.move(cont1, start_pos, incubator.nest1)
117
+ incubator.incubate(cont1, incubation_duration, unit="h")
118
+ mover.move(cont1, incubator.nest1, start_pos)
119
+
120
+
121
+ ...
122
+
123
+ ```
124
+
125
+ And finally a higher level example
126
+
127
+ ```python
128
+ # default units (SI) are specified in the standard unit module
129
+ # additional unit definitions can be added in the code
130
+ # specifying resources
131
+
132
+ from pythonlab.resource.labware import LabwareResource
133
+ from pythonlab.resource.services import MoverServiceResource, DispensionServiceResource, IncubationServiceResource
134
+
135
+ from pythonlab.processes.base import incubate, centrifugate
136
+ from pythonlab.bioprocess import inoculate
137
+
138
+ Labware_set = [LabwareResource(name=f"growth_plate_{cont}")
139
+ for cont in range(8)]
140
+
141
+ dispenser = DispensionServiceResource()
142
+ incubator = IncubationServiceResource()
143
+
144
+ inoculate([dispenser, Labware_set], source="starting_culture")
145
+ incubate([incubator, Labware_set], temp=310.0, shaking=(700,2) ) # temp in K
146
+ centrifugate([incubator, Labware_set], duration=600, force=4500)
147
+
148
+ ...
149
+
150
+ ```
151
+ ## Why python ?
152
+
153
+ Python is a programming language that is very common in modern scientific laboratories and covers all the desired characteristics we expect of a user-friendly lab process programming language.
154
+
155
+ The syntax is very simple, and intuitive to learn.
156
+ Syntax validation comes for free: the python interpreter already does it.
157
+
158
+ Standardisation of a minimal set of functionally will be achieved by standardised packages provided by this site (or any publicly available site).
159
+ Defined namespaces and versioning allow unique addressing of a process step.
160
+
161
+
162
+ ## [Implementation](./implementation)
163
+
164
+ As a proof-of-concept we are planning to provide a [pypy-sandbox](https://www.pypy.org) implementation in the future.
165
+ [pypy-sandbox](https://www.pypy.org) offerers a safe execution environment to execute insecure code.
166
+ A new version is currently developed to by the pypy community.
167
+ Alternatively WASM will be a possible safe execution environment.
168
+
169
+ ## Related projects
170
+
171
+ Here is an incomplete list of related OpenSource projects - please let us know, if we missed a relevant project.
172
+
173
+ ### [Autoprotocoll](http://autoprotocol.org)
174
+
175
+ * Syntax: JSON based
176
+ * (-) not *Turing complete*
177
+ * (-) hard to write and read by humans
178
+
179
+ ### [LabOP](https://bioprotocols.github.io/labop/)
180
+
181
+ * Syntax: RDF / python
182
+ * (-) not *Turing complete* (?)
183
+ * (-) hard to write and read by humans
184
+
185
+ ### [RoboLiq](https://ellis.github.io/roboliq/protocol/index.html)
186
+
187
+ * Syntax: yaml / Javascript
188
+ * (-) not *Turing complete*
189
+ * (-) hard to write and read by humans
190
+ * (-) design not clearly specified
191
+
192
+ ## Repository Maintainer:
193
+
194
+ * mark doerr (mark.doerr@uni-greifswald.de)
195
+
196
+ ## Documentation
197
+
198
+ The Documentation can be found here: [opensourcelab.gitlab.io/pythonLab](opensourcelab.gitlab.io/pythonLab) or [pythonLab.gitlab.io](pythonlab.gitlab.io/)
199
+
200
+
201
+ ## Credits
202
+
203
+ This package was created with Cookiecutter* and the `opensource/templates/cookiecutter-pypackage`* project template.
204
+
205
+ [Cookiecutter](https://github.com/audreyr/cookiecutter )
206
+ [opensource/templates/cookiecutter-pypackage](https://gitlab.com/opensourcelab/software-dev/cookiecutter-pypackage)
@@ -0,0 +1,79 @@
1
+ #--------------------------- setuptools -----------------------------
2
+
3
+ [build-system]
4
+ requires = [
5
+ "setuptools>=42",
6
+ ]
7
+ build-backend = "setuptools.build_meta"
8
+
9
+ [project]
10
+ name = "uuPythonlab"
11
+ version = "0.2.4"
12
+ readme = "README.md"
13
+ license = "MIT"
14
+ classifiers=[
15
+ 'Development Status :: 2 - Pre-Alpha',
16
+ 'Intended Audience :: Developers',
17
+ 'Intended Audience :: Science/Research',
18
+ 'Intended Audience :: Education',
19
+ 'Operating System :: OS Independent',
20
+ 'Natural Language :: English',
21
+ 'Programming Language :: Python :: 3',
22
+ 'Programming Language :: Python :: 3.8',
23
+ 'Programming Language :: Python :: 3.9',
24
+ 'Programming Language :: Python :: 3.10',
25
+ 'Topic :: Scientific/Engineering',
26
+ 'Topic :: Scientific/Engineering :: Information Analysis',
27
+ 'Topic :: Scientific/Engineering :: Visualization',
28
+ 'Topic :: Scientific/Engineering :: Bio-Informatics',
29
+ 'Topic :: Scientific/Engineering :: Chemistry'
30
+ ]
31
+
32
+ dependencies = [
33
+ "graphviz", "networkx",
34
+ ]
35
+
36
+
37
+ # uncomment to enable commandline access of the module via its name
38
+ #[project.scripts]
39
+ #pythonlab = "pythonlab.__main__:main"
40
+
41
+ [tool.pytest.ini_options]
42
+ minversion = "6.0"
43
+ filterwarnings = "ignore::DeprecationWarning"
44
+ addopts = [
45
+ "-v",
46
+ #"-n=auto",
47
+ ]
48
+
49
+ [tool.black]
50
+ line-length = 120
51
+
52
+ [tool.isort]
53
+ profile = "black"
54
+
55
+ [tool.coverage.report]
56
+ exclude_lines = ["if __name__ == .__main__.:"]
57
+ skip_empty = true
58
+
59
+ [tool.bandit]
60
+ exclude_dirs = ["tests"]
61
+ skips = ["B101"]
62
+
63
+ [dependency-groups]
64
+ dev = [
65
+ "bumpversion>=0.6.0",
66
+ "graphviz>=0.21",
67
+ "invoke>=2.2.1",
68
+ "myst-parser>=5.0.0",
69
+ "networkx>=3.5",
70
+ "pytest>=9.0.2",
71
+ "python-docs-theme>=2025.12",
72
+ "ruff>=0.15.1",
73
+ "sphinx>=9.1.0",
74
+ "wheel>=0.46.3",
75
+ ]
76
+
77
+ [tool.setuptools.packages.find]
78
+ include = ["pythonlab"]
79
+
@@ -0,0 +1,5 @@
1
+ """Top-level package for pythonLab."""
2
+
3
+ __author__ = """mark doerr"""
4
+ __email__ = "mark.doerr@uni-greifswald.de"
5
+ __version__ = "0.2.4"