matterlab-rotavaps 1.0.6__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,128 @@
1
+ Metadata-Version: 2.4
2
+ Name: matterlab_rotavaps
3
+ Version: 1.0.6
4
+ Summary: A Python API for the rotavaps in the Matter Lab.
5
+ Author: Han Hao, Martin Seifrid, Tony C. Wu
6
+ License-Expression: MIT
7
+ Project-URL: homepage, https://gitlab.com/aspuru-guzik-group/self-driving-lab/devices/rotavaps
8
+ Keywords: rotavap,automation,matterlab
9
+ Classifier: Intended Audience :: Science/Research
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3 :: Only
12
+ Classifier: Programming Language :: Python :: 3.7
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Scientific/Engineering
19
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
20
+ Classifier: Topic :: System :: Hardware
21
+ Classifier: Topic :: System :: Hardware :: Hardware Drivers
22
+ Classifier: Topic :: System :: Hardware :: Universal Serial Bus (USB)
23
+ Requires-Python: >=3.7
24
+ Description-Content-Type: text/markdown
25
+ Requires-Dist: matterlab_serial_device
26
+ Provides-Extra: dev
27
+ Requires-Dist: mypy>=0; extra == "dev"
28
+ Requires-Dist: pre-commit; extra == "dev"
29
+ Requires-Dist: pytest>=7; extra == "dev"
30
+ Requires-Dist: pytest-cov>=3; extra == "dev"
31
+ Requires-Dist: pytest-mock>=3; extra == "dev"
32
+ Requires-Dist: pytest-rerunfailures; extra == "dev"
33
+ Requires-Dist: pytest-timeout; extra == "dev"
34
+ Requires-Dist: ruff; extra == "dev"
35
+
36
+ # Rotavaps
37
+
38
+
39
+
40
+ ## Getting started
41
+
42
+ To make it easy for you to get started with GitLab, here's a list of recommended next steps.
43
+
44
+ Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
45
+
46
+ ## Add your files
47
+
48
+ * [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
49
+ * [Add files using the command line](https://docs.gitlab.com/topics/git/add_files/#add-files-to-a-git-repository) or push an existing Git repository with the following command:
50
+
51
+ ```
52
+ cd existing_repo
53
+ git remote add origin https://gitlab.com/aspuru-guzik-group/self-driving-lab/devices/rotavaps.git
54
+ git branch -M main
55
+ git push -uf origin main
56
+ ```
57
+
58
+ ## Integrate with your tools
59
+
60
+ * [Set up project integrations](https://gitlab.com/aspuru-guzik-group/self-driving-lab/devices/rotavaps/-/settings/integrations)
61
+
62
+ ## Collaborate with your team
63
+
64
+ * [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
65
+ * [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
66
+ * [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
67
+ * [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
68
+ * [Set auto-merge](https://docs.gitlab.com/user/project/merge_requests/auto_merge/)
69
+
70
+ ## Test and Deploy
71
+
72
+ Use the built-in continuous integration in GitLab.
73
+
74
+ * [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/)
75
+ * [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
76
+ * [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
77
+ * [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
78
+ * [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
79
+
80
+ ***
81
+
82
+ # Editing this README
83
+
84
+ When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
85
+
86
+ ## Suggestions for a good README
87
+
88
+ Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
89
+
90
+ ## Name
91
+ Choose a self-explaining name for your project.
92
+
93
+ ## Description
94
+ Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
95
+
96
+ ## Badges
97
+ On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
98
+
99
+ ## Visuals
100
+ Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
101
+
102
+ ## Installation
103
+ Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
104
+
105
+ ## Usage
106
+ Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
107
+
108
+ ## Support
109
+ Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
110
+
111
+ ## Roadmap
112
+ If you have ideas for releases in the future, it is a good idea to list them in the README.
113
+
114
+ ## Contributing
115
+ State if you are open to contributions and what your requirements are for accepting them.
116
+
117
+ For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
118
+
119
+ You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
120
+
121
+ ## Authors and acknowledgment
122
+ Show your appreciation to those who have contributed to the project.
123
+
124
+ ## License
125
+ For open source projects, say how it is licensed.
126
+
127
+ ## Project status
128
+ If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
@@ -0,0 +1,93 @@
1
+ # Rotavaps
2
+
3
+
4
+
5
+ ## Getting started
6
+
7
+ To make it easy for you to get started with GitLab, here's a list of recommended next steps.
8
+
9
+ Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
10
+
11
+ ## Add your files
12
+
13
+ * [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
14
+ * [Add files using the command line](https://docs.gitlab.com/topics/git/add_files/#add-files-to-a-git-repository) or push an existing Git repository with the following command:
15
+
16
+ ```
17
+ cd existing_repo
18
+ git remote add origin https://gitlab.com/aspuru-guzik-group/self-driving-lab/devices/rotavaps.git
19
+ git branch -M main
20
+ git push -uf origin main
21
+ ```
22
+
23
+ ## Integrate with your tools
24
+
25
+ * [Set up project integrations](https://gitlab.com/aspuru-guzik-group/self-driving-lab/devices/rotavaps/-/settings/integrations)
26
+
27
+ ## Collaborate with your team
28
+
29
+ * [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
30
+ * [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
31
+ * [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
32
+ * [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
33
+ * [Set auto-merge](https://docs.gitlab.com/user/project/merge_requests/auto_merge/)
34
+
35
+ ## Test and Deploy
36
+
37
+ Use the built-in continuous integration in GitLab.
38
+
39
+ * [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/)
40
+ * [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
41
+ * [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
42
+ * [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
43
+ * [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
44
+
45
+ ***
46
+
47
+ # Editing this README
48
+
49
+ When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
50
+
51
+ ## Suggestions for a good README
52
+
53
+ Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
54
+
55
+ ## Name
56
+ Choose a self-explaining name for your project.
57
+
58
+ ## Description
59
+ Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
60
+
61
+ ## Badges
62
+ On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
63
+
64
+ ## Visuals
65
+ Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
66
+
67
+ ## Installation
68
+ Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
69
+
70
+ ## Usage
71
+ Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
72
+
73
+ ## Support
74
+ Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
75
+
76
+ ## Roadmap
77
+ If you have ideas for releases in the future, it is a good idea to list them in the README.
78
+
79
+ ## Contributing
80
+ State if you are open to contributions and what your requirements are for accepting them.
81
+
82
+ For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
83
+
84
+ You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
85
+
86
+ ## Authors and acknowledgment
87
+ Show your appreciation to those who have contributed to the project.
88
+
89
+ ## License
90
+ For open source projects, say how it is licensed.
91
+
92
+ ## Project status
93
+ If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
@@ -0,0 +1,105 @@
1
+ [build-system]
2
+ requires = ["setuptools>=80.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "matterlab_rotavaps"
7
+ version = "1.0.6"
8
+ description = "A Python API for the rotavaps in the Matter Lab."
9
+ authors = [
10
+ { name = "Han Hao" },
11
+ { name = "Martin Seifrid" },
12
+ { name = "Tony C. Wu"}
13
+ ]
14
+ license = "MIT"
15
+ license-files = ["LICENSE"]
16
+ readme = "README.md"
17
+ requires-python = ">=3.7"
18
+ classifiers = [
19
+ "Intended Audience :: Science/Research",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3 :: Only",
22
+ "Programming Language :: Python :: 3.7",
23
+ "Programming Language :: Python :: 3.8",
24
+ "Programming Language :: Python :: 3.9",
25
+ "Programming Language :: Python :: 3.10",
26
+ "Programming Language :: Python :: 3.11",
27
+ "Programming Language :: Python :: 3.12",
28
+ "Topic :: Scientific/Engineering",
29
+ "Topic :: Scientific/Engineering :: Chemistry",
30
+ "Topic :: System :: Hardware",
31
+ "Topic :: System :: Hardware :: Hardware Drivers",
32
+ "Topic :: System :: Hardware :: Universal Serial Bus (USB)",
33
+ ]
34
+
35
+ keywords = ["rotavap", "automation", "matterlab"]
36
+
37
+ dependencies = [
38
+ "matterlab_serial_device"
39
+ ]
40
+
41
+ [project.optional-dependencies]
42
+ dev = [
43
+ "mypy>=0",
44
+ "pre-commit",
45
+ "pytest>=7",
46
+ "pytest-cov>=3",
47
+ "pytest-mock>=3",
48
+ "pytest-rerunfailures",
49
+ "pytest-timeout",
50
+ "ruff",
51
+ ]
52
+
53
+ [project.urls]
54
+ homepage = "https://gitlab.com/aspuru-guzik-group/self-driving-lab/devices/rotavaps"
55
+
56
+ [tool.pytest.ini_options]
57
+ addopts = "--timeout 60 --reruns 3 --reruns-delay 1 --cov=matterlab_rotavaps --cov-report xml --cov-report html --cov-report term --color=yes"
58
+ testpaths = "tests"
59
+ python_files = "test_*.py"
60
+ pythonpath = "."
61
+
62
+ [tool.coverage.run]
63
+ # branch = true
64
+ source = ["src"]
65
+ omit = ["*tests*"]
66
+ command_line = "-m pytest -v"
67
+
68
+ [tool.coverage.report]
69
+ show_missing = true
70
+
71
+ [tool.coverage.xml]
72
+ output = "coverage.xml"
73
+
74
+ [tool.ruff]
75
+ fix = true
76
+ line-length = 160
77
+ # Allow imports relative to the "src" and "test" directories.
78
+ src = ["src", "tests"]
79
+
80
+ [tool.ruff.format]
81
+ # Enable reformatting of code snippets in docstrings.
82
+ docstring-code-format = true
83
+
84
+ [tool.ruff.lint.pydocstyle]
85
+ convention = "google"
86
+
87
+ [tool.mypy]
88
+ mypy_path = "src"
89
+ check_untyped_defs = true
90
+ disallow_any_generics = false
91
+ ignore_missing_imports = true
92
+ no_implicit_optional = true
93
+ show_error_codes = true
94
+ strict_equality = true
95
+ warn_redundant_casts = true
96
+ warn_return_any = true
97
+ warn_unreachable = true
98
+ warn_unused_configs = true
99
+ allow_redefinition = true
100
+ #no_explicitly_reexport = true
101
+
102
+ [project.entry-points."medusa.devices"]
103
+ Rotavap = "matterlab_rotavaps.base_rotavap:Rotavap"
104
+ IKARV10 = "matterlab_rotavaps.ika_rotavap:IKARV10"
105
+
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,4 @@
1
+ from setuptools import setup
2
+
3
+ if __name__ == "__main__":
4
+ setup()
@@ -0,0 +1,5 @@
1
+ from .base_rotavap import Rotavap
2
+ from .ika_rotavap import IKARV10
3
+
4
+
5
+ __all__ = ["Rotavap", "IKARV10"]
@@ -0,0 +1,58 @@
1
+ from abc import ABC, abstractmethod
2
+ from logging import Logger, getLogger
3
+ from typing import Optional
4
+
5
+
6
+ class Rotavap(ABC):
7
+ category = "Rotavap"
8
+ ui_fields = "com_port"
9
+
10
+ _rpm_query: str
11
+ _rpm_set: str
12
+ _stir_start: str
13
+ _stir_stop: str
14
+
15
+ _switch_rpm: int = 0
16
+
17
+ def __init__(self, max_rpm: int, logger: Optional[Logger] = None):
18
+ self._targe_rpm: int
19
+ self._stir_switch_status: bool
20
+
21
+ self.max_rpm = max_rpm
22
+ self.logger = logger if logger is not None else getLogger(
23
+ f"{self.__class__.__module__}.{self.__class__.__name__}"
24
+ )
25
+
26
+ @abstractmethod
27
+ def _query_rotavap(self, command: str) ->str:
28
+ pass
29
+
30
+ @abstractmethod
31
+ def standby(self)->None:
32
+ self.rpm = self._switch_rpm
33
+
34
+ @property
35
+ @abstractmethod
36
+ def rpm(self) ->int:
37
+ pass
38
+
39
+ @rpm.setter
40
+ @abstractmethod
41
+ def rpm(self, rpm:int) ->None:
42
+ pass
43
+
44
+ @property
45
+ @abstractmethod
46
+ def target_rpm(self) ->int:
47
+ pass
48
+
49
+ @property
50
+ @abstractmethod
51
+ def _stir_switch(self) ->bool:
52
+ pass
53
+
54
+ @_stir_switch.setter
55
+ @abstractmethod
56
+ def _stir_switch(self, stir_switch_status: bool) ->None:
57
+ pass
58
+
@@ -0,0 +1,220 @@
1
+ import time
2
+ from logging import Logger
3
+ from typing import Optional, Union
4
+
5
+ from matterlab_serial_device import SerialDevice, open_close
6
+ from matterlab_rotavaps.base_rotavap import Rotavap
7
+
8
+
9
+ class IKARV10(Rotavap, SerialDevice):
10
+ category = "Rotavap"
11
+ min_rpm = 0
12
+
13
+ _name = "IN_NAME"
14
+ _software = "IN_SOFTWARE"
15
+
16
+ _reset = "RESET"
17
+
18
+ _rpm_query = "IN_PV_4"
19
+ _target_rpm_query = "IN_SP_4"
20
+
21
+ _rpm_set = "OUT_SP_4"
22
+ _interval_set = "OUT_SP_60"
23
+ _timer_set = "OUT_SP_61"
24
+ _rotate_start = "START_4"
25
+ _rotate_stop = "STOP_4"
26
+
27
+ _move_up = "OUT_SP_62 1"
28
+ _move_down = "START_62"
29
+ _move_stop = "STOP_62"
30
+
31
+ def __init__(
32
+ self,
33
+ com_port: str,
34
+ max_rpm: int = 200,
35
+ connect_hardware: bool = True,
36
+ encoding: str = "utf-8",
37
+ baudrate: int = 9600,
38
+ timeout: float = 1.0,
39
+ parity: str = "even",
40
+ bytesize: int = 7,
41
+ stopbits: int = 1,
42
+ read_delay: float = 0.5,
43
+ write_delay: float = 0.5,
44
+ logger: Optional[Logger] = None,
45
+ **kwargs,
46
+ ) -> None:
47
+ SerialDevice.__init__(
48
+ self,
49
+ com_port=com_port,
50
+ encoding=encoding,
51
+ baudrate=baudrate,
52
+ timeout=timeout,
53
+ parity=parity,
54
+ bytesize=bytesize,
55
+ stopbits=stopbits,
56
+ **kwargs,
57
+ )
58
+ Rotavap.__init__(self, max_rpm=max_rpm, logger=logger)
59
+ self._read_delay = read_delay
60
+ self._write_delay = write_delay
61
+ self._rotate = False
62
+ self._interval = 0
63
+ self._timer = 0
64
+
65
+ if connect_hardware:
66
+ self.logger.info("Initializing IKA RV10 rotavap on %s", self.com_port)
67
+ self.reset()
68
+
69
+ @open_close
70
+ def _query_rotavap(self, command: str) -> str:
71
+ response = self.query(write_command=f"{command}\r\n", read_delay=self._read_delay).split()[1]
72
+ self.logger.debug("Query to IKA RV10 on %s: %s -> %s", self.com_port, command, response)
73
+ return response
74
+
75
+ @property
76
+ def name(self) -> str:
77
+ name = self._query_rotavap(self._name)
78
+ self.logger.info("IKA RV10 on %s reports name %s", self.com_port, name)
79
+ return name
80
+
81
+ @property
82
+ def software_version(self) -> str:
83
+ software_version = self._query_rotavap(self._software)
84
+ self.logger.info("IKA RV10 on %s software version is %s", self.com_port, software_version)
85
+ return software_version
86
+
87
+ def reset(self) -> None:
88
+ self.logger.warning("Resetting IKA RV10 on %s", self.com_port)
89
+ self._query_rotavap(self._reset)
90
+
91
+ @property
92
+ def rpm(self) -> int:
93
+ """
94
+ current speed in rpm
95
+
96
+ :param self: Description
97
+ :return: Description
98
+ :rtype: int
99
+ """
100
+ rpm = int(self._query_rotavap(self._rpm_query))
101
+ self.logger.info("Current rotation speed on %s is %s rpm", self.com_port, rpm)
102
+ return rpm
103
+
104
+ @property
105
+ def target_rpm(self) -> int:
106
+ """
107
+ target speed in rpm
108
+
109
+ :param self: Description
110
+ :return: Description
111
+ :rtype: int
112
+ """
113
+ target_rpm = int(self._query_rotavap(self._target_rpm_query))
114
+ self.logger.info("Target rotation speed on %s is %s rpm", self.com_port, target_rpm)
115
+ return target_rpm
116
+
117
+ @rpm.setter
118
+ def rpm(self, rpm:int) -> None:
119
+ if not isinstance(rpm, int):
120
+ raise TypeError("rpm must be an integer")
121
+
122
+ if not self._switch_rpm <= rpm <= self.max_rpm:
123
+ raise ValueError(f"RPM out of range: min {self._switch_rpm}, max {self.max_rpm}!")
124
+
125
+ self._target_rpm = rpm
126
+ self.logger.info("Setting target rotation speed on %s to %s rpm", self.com_port, rpm)
127
+ self._query_rotavap(f"{self._rpm_set} {rpm}")
128
+
129
+ if rpm == self._switch_rpm:
130
+ self._stir_switch = False
131
+ else:
132
+ self._stir_switch = True
133
+
134
+ @property
135
+ def _stir_switch(self) ->bool:
136
+ return self._stir_switch_status
137
+
138
+ @_stir_switch.setter
139
+ def _stir_switch(self, stir_switch_status: bool) ->None:
140
+ self._stir_switch_status = stir_switch_status
141
+ if self._stir_switch_status:
142
+ self._query_rotavap(self._rotate_start)
143
+ self.logger.info("Started rotavap rotation on %s", self.com_port)
144
+ else:
145
+ self._query_rotavap(self._rotate_stop)
146
+ self.logger.info("Stopped rotavap rotation on %s", self.com_port)
147
+
148
+ @property
149
+ def interval(self) -> int:
150
+ """
151
+ interval in sec
152
+
153
+ :param self: Description
154
+ :return: Description
155
+ :rtype: int
156
+ """
157
+ return self._interval
158
+
159
+ @interval.setter
160
+ def interval(self, interval: int) -> None:
161
+ if not isinstance(interval, int):
162
+ raise TypeError("interval must be an interger")
163
+ self._interval = interval
164
+ self._query_rotavap(f"{self._interval_set} {interval}")
165
+ self.logger.info("Set IKA RV10 on %s interval to %s s", self.com_port, interval)
166
+
167
+ @property
168
+ def timer(self) -> int:
169
+ """
170
+ timer/min
171
+
172
+ :param self: Description
173
+ :return: Description
174
+ :rtype: int
175
+ """
176
+ return self._timer
177
+
178
+ @timer.setter
179
+ def timer(self, timer: int) ->None :
180
+ """
181
+ timer/min
182
+
183
+ :param self: Description
184
+ :param timer: Description
185
+ :type timer: int
186
+ """
187
+ if not isinstance(timer, int):
188
+ raise TypeError("timer must be an interger")
189
+ self._timer = timer
190
+ self._query_rotavap(f"{self._timer_set} {timer}")
191
+ self.logger.info("Set IKA RV10 on %s timer to %s min", self.com_port, timer)
192
+
193
+ def move_up(self) -> None:
194
+ """
195
+ move to top or until move_stop
196
+
197
+ :param self: Description
198
+ """
199
+ self.logger.info("Moving IKA RV10 on %s up", self.com_port)
200
+ self._query_rotavap(self._move_up)
201
+
202
+ def move_down(self) -> None:
203
+ """
204
+ move to bottom or until move_stop
205
+
206
+ :param self: Description
207
+ """
208
+ self.logger.info("Moving IKA RV10 on %s down", self.com_port)
209
+ self._query_rotavap(self._move_down)
210
+
211
+ def move_stop(self) -> None:
212
+ """
213
+ Stop moving
214
+
215
+ :param self: Description
216
+ """
217
+ self._query_rotavap(self._move_stop)
218
+ def standby(self) -> None:
219
+ self.logger.info("Setting IKA RV10 on %s to standby", self.com_port)
220
+ self.rpm = self._switch_rpm
@@ -0,0 +1,128 @@
1
+ Metadata-Version: 2.4
2
+ Name: matterlab_rotavaps
3
+ Version: 1.0.6
4
+ Summary: A Python API for the rotavaps in the Matter Lab.
5
+ Author: Han Hao, Martin Seifrid, Tony C. Wu
6
+ License-Expression: MIT
7
+ Project-URL: homepage, https://gitlab.com/aspuru-guzik-group/self-driving-lab/devices/rotavaps
8
+ Keywords: rotavap,automation,matterlab
9
+ Classifier: Intended Audience :: Science/Research
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3 :: Only
12
+ Classifier: Programming Language :: Python :: 3.7
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Scientific/Engineering
19
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
20
+ Classifier: Topic :: System :: Hardware
21
+ Classifier: Topic :: System :: Hardware :: Hardware Drivers
22
+ Classifier: Topic :: System :: Hardware :: Universal Serial Bus (USB)
23
+ Requires-Python: >=3.7
24
+ Description-Content-Type: text/markdown
25
+ Requires-Dist: matterlab_serial_device
26
+ Provides-Extra: dev
27
+ Requires-Dist: mypy>=0; extra == "dev"
28
+ Requires-Dist: pre-commit; extra == "dev"
29
+ Requires-Dist: pytest>=7; extra == "dev"
30
+ Requires-Dist: pytest-cov>=3; extra == "dev"
31
+ Requires-Dist: pytest-mock>=3; extra == "dev"
32
+ Requires-Dist: pytest-rerunfailures; extra == "dev"
33
+ Requires-Dist: pytest-timeout; extra == "dev"
34
+ Requires-Dist: ruff; extra == "dev"
35
+
36
+ # Rotavaps
37
+
38
+
39
+
40
+ ## Getting started
41
+
42
+ To make it easy for you to get started with GitLab, here's a list of recommended next steps.
43
+
44
+ Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
45
+
46
+ ## Add your files
47
+
48
+ * [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
49
+ * [Add files using the command line](https://docs.gitlab.com/topics/git/add_files/#add-files-to-a-git-repository) or push an existing Git repository with the following command:
50
+
51
+ ```
52
+ cd existing_repo
53
+ git remote add origin https://gitlab.com/aspuru-guzik-group/self-driving-lab/devices/rotavaps.git
54
+ git branch -M main
55
+ git push -uf origin main
56
+ ```
57
+
58
+ ## Integrate with your tools
59
+
60
+ * [Set up project integrations](https://gitlab.com/aspuru-guzik-group/self-driving-lab/devices/rotavaps/-/settings/integrations)
61
+
62
+ ## Collaborate with your team
63
+
64
+ * [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
65
+ * [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
66
+ * [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
67
+ * [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
68
+ * [Set auto-merge](https://docs.gitlab.com/user/project/merge_requests/auto_merge/)
69
+
70
+ ## Test and Deploy
71
+
72
+ Use the built-in continuous integration in GitLab.
73
+
74
+ * [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/)
75
+ * [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
76
+ * [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
77
+ * [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
78
+ * [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
79
+
80
+ ***
81
+
82
+ # Editing this README
83
+
84
+ When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
85
+
86
+ ## Suggestions for a good README
87
+
88
+ Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
89
+
90
+ ## Name
91
+ Choose a self-explaining name for your project.
92
+
93
+ ## Description
94
+ Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
95
+
96
+ ## Badges
97
+ On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
98
+
99
+ ## Visuals
100
+ Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
101
+
102
+ ## Installation
103
+ Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
104
+
105
+ ## Usage
106
+ Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
107
+
108
+ ## Support
109
+ Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
110
+
111
+ ## Roadmap
112
+ If you have ideas for releases in the future, it is a good idea to list them in the README.
113
+
114
+ ## Contributing
115
+ State if you are open to contributions and what your requirements are for accepting them.
116
+
117
+ For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
118
+
119
+ You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
120
+
121
+ ## Authors and acknowledgment
122
+ Show your appreciation to those who have contributed to the project.
123
+
124
+ ## License
125
+ For open source projects, say how it is licensed.
126
+
127
+ ## Project status
128
+ If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
@@ -0,0 +1,12 @@
1
+ README.md
2
+ pyproject.toml
3
+ setup.py
4
+ src/matterlab_rotavaps/__init__.py
5
+ src/matterlab_rotavaps/base_rotavap.py
6
+ src/matterlab_rotavaps/ika_rotavap.py
7
+ src/matterlab_rotavaps.egg-info/PKG-INFO
8
+ src/matterlab_rotavaps.egg-info/SOURCES.txt
9
+ src/matterlab_rotavaps.egg-info/dependency_links.txt
10
+ src/matterlab_rotavaps.egg-info/entry_points.txt
11
+ src/matterlab_rotavaps.egg-info/requires.txt
12
+ src/matterlab_rotavaps.egg-info/top_level.txt
@@ -0,0 +1,3 @@
1
+ [medusa.devices]
2
+ IKARV10 = matterlab_rotavaps.ika_rotavap:IKARV10
3
+ Rotavap = matterlab_rotavaps.base_rotavap:Rotavap
@@ -0,0 +1,11 @@
1
+ matterlab_serial_device
2
+
3
+ [dev]
4
+ mypy>=0
5
+ pre-commit
6
+ pytest>=7
7
+ pytest-cov>=3
8
+ pytest-mock>=3
9
+ pytest-rerunfailures
10
+ pytest-timeout
11
+ ruff
@@ -0,0 +1 @@
1
+ matterlab_rotavaps