Skip to content

Conversation

@O957
Copy link
Contributor

@O957 O957 commented Aug 17, 2025

This PR:

  • Fixes spellings errors across the pylabrobot repository.
  • Adds the pre-commit hook typos to the pre-commit-config.yaml file.
  • Adds a configuration file for the typos pre-commit hook.

Context:

  • I found the spelling errors in the code base by:
    • using the typos pre-commit hook in .pre-commit-config.yaml
    • adding _typos.toml in root
    • running pre-commit run --all-files and finding false positives
    • adding the false positives to _typos.toml and re-running pre-commit run --all-files
    • fixing the true-positive spelling errors
  • See below for an example of the typos pre-commit hook output
Errors Found With Typos Pre-Commit Hook
error: `recieved` should be `received`
  --> pylabrobot/storage/cytomat/cytomat.py:125:33
    |
125 |       logging.error("Command %s recieved an unknown response: '%s'", command_str, resp)
    |                                 ^^^^^^^^
    |
error: `equaly` should be `equally`
  --> pylabrobot/resources/utils.py:68:71
   |
68 |   """Make equally spaced resources over the x-axis. See :meth:`create_equaly_spaced_2d` for more
   |                                                                       ^^^^^^
   |
error: `equaly` should be `equally`
  --> pylabrobot/resources/utils.py:107:71
    |
107 |   """Make equally spaced resources over the y-axis. See :meth:`create_equaly_spaced_2d` for more
    |                                                                       ^^^^^^
    |
error: `hight` should be `height`, `high`
  --> pylabrobot/liquid_handling/backends/tecan/EVO_backend.py:557:88
    |
557 |     await self.liha._drop_disposable_tip(self._bin_use_channels(use_channels), discard_hight=0)
    |                                                                                        ^^^^^
    |
error: `logial` should be `logical`
  --> pylabrobot/liquid_handling/backends/tecan/EVO_backend.py:721:27
    |
721 |       pvl: position_valve_logial
    |                           ^^^^^^
    |
error: `aboslute` should be `absolute`
  --> pylabrobot/liquid_handling/backends/tecan/EVO_backend.py:979:10
    |
979 |       x: aboslute x position in 1/10 mm, must be in allowed machine range
    |          ^^^^^^^^
    |
error: `hight` should be `height`, `high`
  --> pylabrobot/liquid_handling/backends/tecan/EVO_backend.py:1182:43
     |
1182 |     Discards at the Z-axes initialization hight
     |                                           ^^^^^
     |
error: `hight` should be `height`, `high`
  --> pylabrobot/liquid_handling/backends/tecan/EVO_backend.py:1189:54
     |
1189 |   async def _drop_disposable_tip(self, tips, discard_hight):
     |                                                      ^^^^^
     |
error: `hight` should be `height`, `high`
  --> pylabrobot/liquid_handling/backends/tecan/EVO_backend.py:1195:15
     |
1195 |       discard_hight: binary. 0 above tip rack, 1 in tip rack
     |               ^^^^^
     |
error: `hight` should be `height`, `high`
  --> pylabrobot/liquid_handling/backends/tecan/EVO_backend.py:1198:94
     |
1198 |     await self.backend.send_command(module=self.module, command="AST", params=[tips, discard_hight])
     |                                                                                              ^^^^^
     |
error: `aboslute` should be `absolute`
  --> pylabrobot/liquid_handling/backends/tecan/EVO_backend.py:1310:10
     |
1310 |       x: aboslute x position in 1/10 mm
     |          ^^^^^^^^
     |
error: `aboslute` should be `absolute`
  --> pylabrobot/liquid_handling/backends/tecan/EVO_backend.py:1311:10
     |
1311 |       y: aboslute y position in 1/10 mm
     |          ^^^^^^^^
     |
error: `aboslute` should be `absolute`
  --> pylabrobot/liquid_handling/backends/tecan/EVO_backend.py:1312:10
     |
1312 |       z: aboslute z position in 1/10 mm
     |          ^^^^^^^^
     |
error: `aboslute` should be `absolute`
  --> pylabrobot/liquid_handling/backends/tecan/EVO_backend.py:1313:10
     |
1313 |       r: aboslute r position in 1/10 mm
     |          ^^^^^^^^
     |
error: `aboslute` should be `absolute`
  --> pylabrobot/liquid_handling/backends/tecan/EVO_backend.py:1314:10
     |
1314 |       g: aboslute g position in 1/10 mm
     |          ^^^^^^^^
     |
error: `publically` should be `publicly`
  --> docs/resources/library/porvair.md:5:345
  |
5 | > Porvair Filtration Group, a wholly owned subsidiary of Porvair plc, is a specialist filtration and environmental technology group involved in developing, designing and manufacturing filtration and separation solutions to industry sectors such as the aviation, molten metal, energy, water treatment and life sciences markets. Porvair plc is a publically owned company with four principal subsidiaries: Porvair Filtration Group Ltd., Porvair Sciences Ltd., Selee Corporation and Seal Analytical Ltd.
  |                                                                                                                                                                                                                                                                                                                                                         ^^^^^^^^^^
  |
error: `adress` should be `address`
  --> pylabrobot/powder_dispensing/chemspeed/crystal_powderdose.py:9:31
  |
9 |   def __init__(self, arksuite_adress: str) -> None:
  |                               ^^^^^^
  |
error: `adress` should be `address`
  --> pylabrobot/powder_dispensing/chemspeed/crystal_powderdose.py:10:19
   |
10 |     self.arksuite_adress = arksuite_adress
   |                   ^^^^^^
   |
error: `adress` should be `address`
  --> pylabrobot/powder_dispensing/chemspeed/crystal_powderdose.py:10:37
   |
10 |     self.arksuite_adress = arksuite_adress
   |                                     ^^^^^^
   |
error: `adress` should be `address`
  --> pylabrobot/powder_dispensing/chemspeed/crystal_powderdose.py:21:17
   |
21 |       "arksuite_adress": self.arksuite_adress,
   |                 ^^^^^^
   |
error: `adress` should be `address`
  --> pylabrobot/powder_dispensing/chemspeed/crystal_powderdose.py:21:40
   |
21 |       "arksuite_adress": self.arksuite_adress,
   |                                        ^^^^^^
   |
error: `doens` should be `does`, `doesn`
  --> pylabrobot/liquid_handling/liquid_handler_tests.py:1094:19
     |
1094 |     # test volume doens't change on failed dispense
     |                   ^^^^^
     |
error: `avilable` should be `available`
  --> docs/user_guide/00_liquid-handling/hamilton-star/star_lld.md:22:34
   |
22 | The `lld_mode` parameter is only avilable when using the `STAR` backend.
   |                                  ^^^^^^^^
   |
error: `resetable` should be `resettable`
  --> pylabrobot/liquid_handling/backends/hamilton/vantage_backend.py:152:24
    |
152 |   90: "Limit curve not resetable",
    |                        ^^^^^^^^^
    |
error: `heigh` should be `height`, `high`
  --> pylabrobot/liquid_handling/backends/hamilton/vantage_backend.py:189:60
    |
189 |   59: "Divergance Y motion controller to linear encoder to heigh",
    |                                                            ^^^^^
    |
error: `resetable` should be `resettable`
  --> pylabrobot/liquid_handling/backends/hamilton/vantage_backend.py:215:24
    |
215 |   90: "Limit curve not resetable",
    |                        ^^^^^^^^^
    |
error: `definiton` should be `definition`
  --> pylabrobot/resources/height_volume_functions.py:130:24
    |
130 |     check your labware definiton and/or that you are using the right labware."""
    |                        ^^^^^^^^^
    |
error: `definiton` should be `definition`
  --> pylabrobot/resources/height_volume_functions.py:213:24
    |
213 |     check your labware definiton and/or that you are using the right labware."""
    |                        ^^^^^^^^^
    |
error: `definiton` should be `definition`
  --> pylabrobot/resources/height_volume_functions.py:301:24
    |
301 |     check your labware definiton and/or that you are using the right labware."""
    |                        ^^^^^^^^^
    |
error: `definiton` should be `definition`
  --> pylabrobot/resources/height_volume_functions.py:389:24
    |
389 |     check your labware definiton and/or that you are using the right labware."""
    |                        ^^^^^^^^^
    |
error: `definiton` should be `definition`
  --> pylabrobot/resources/height_volume_functions.py:454:24
    |
454 |     check your labware definiton and/or that you are using the right labware."""
    |                        ^^^^^^^^^
    |
error: `resevoir` should be `reservoir`
  --> pylabrobot/resources/height_volume_functions.py:463:19
    |
463 | #   """ An 8 well resevoir with a 30mL volume. """
    |                   ^^^^^^^^
    |
error: `dimenions` should be `dimensions`
  --> docs/resources/library/eppendorf.md:15:356
   |
15 | | 'Eppendorf_96_wellplate_250ul_Vb'<br>Part no.: 0030133374<br>[manufacturer website](https://www.eppendorf.com/gb-en/Products/Laboratory-Consumables/Plates/Eppendorf-twintec-PCR-Plates-p-0030133374) <br><br> - Material: polycarbonate (frame), polypropylene (wells)<br> - part of the twin.tec(R) product line<br> - WARNING: not ANSI/SLAS 1-2004 footprint dimenions (123x81 mm^2!) ==> requires `PlateAdapter`<br> - 'Can be divided into 4 segments of 24 wells each to prevent waste and save money'. | ![](img/eppendorf/Eppendorf_96_wellplate_250ul_Vb_COMPLETE.png) ![](img/eppendorf/Eppendorf_96_wellplate_250ul_Vb_DIVIDED.png) | `Eppendorf_96_wellplate_250ul_Vb` |
   |                                                                                                                                                                                                                                                                                                                                                                    ^^^^^^^^^
   |
error: `intialized` should be `initialized`
  --> pylabrobot/centrifuge/vspin_backend.py:149:55
    |
149 |     # TODO: add functionality where if robot has been intialized before nothing needs to happen
    |                                                       ^^^^^^^^^^
    |
error: `portait` should be `portrait`
  --> pylabrobot/resources/tecan/plates.py:247:14
    |
247 | def DeepWell_portait_96_Well_Lid(name: str) -> Lid:
    |              ^^^^^^^
    |
error: `portait` should be `portrait`
  --> pylabrobot/resources/tecan/plates.py:256:23
    |
256 |   #   model="DeepWell_portait_96_Well_Lid",
    |                       ^^^^^^^
    |
error: `portait` should be `portrait`
  --> pylabrobot/resources/tecan/plates.py:260:14
    |
260 | def DeepWell_portait_96_Well(name: str, with_lid: bool = False) -> TecanPlate:
    |              ^^^^^^^
    |
error: `portait` should be `portrait`
  --> pylabrobot/resources/tecan/plates.py:266:18
    |
266 |     lid=DeepWell_portait_96_Well_Lid(name=name + "_lid") if with_lid else None,
    |                  ^^^^^^^
    |
error: `portait` should be `portrait`
  --> pylabrobot/resources/tecan/plates.py:267:21
    |
267 |     model="DeepWell_portait_96_Well",
    |                     ^^^^^^^
    |
error: `hight` should be `height`, `high`
  --> pylabrobot/liquid_handling/liquid_classes/hamilton/vantage.py:5151:48
     |
5151 | # V1.1: Set mix flow rate to 120, Clot retract hight = 0
     |                                                ^^^^^
     |
error: `shure` should be `sure`
  --> pylabrobot/liquid_handling/liquid_classes/hamilton/star.py:4215:68
     |
4215 | # - a break time after dispense with about 10s time counter, makes shure the drop which  residue
     |                                                                    ^^^^^
     |
error: `hight` should be `height`, `high`
  --> pylabrobot/liquid_handling/liquid_classes/hamilton/star.py:5477:48
     |
5477 | # V1.1: Set mix flow rate to 120, Clot retract hight = 0
     |                                                ^^^^^
     |
error: `indictor` should be `indicator`
  --> pylabrobot/liquid_handling/backends/hamilton/STAR_tests.py:273:18
    |
273 |   async def test_indictor_light(self):
    |                  ^^^^^^^^
    |
error: `droped` should be `dropped`
  --> pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py:474:51
    |
474 |     "Get command" is sent twice or element is not droped expected element is missing (lost)
    |                                                   ^^^^^^
    |
error: `possiby` should be `possibly`
  --> pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py:898:85
    |
898 |       71: "Not enough liquid present (Immersion depth or surface following position possiby"
    |                                                                                     ^^^^^^^
    |
error: `droped` should be `dropped`
  --> pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py:905:20
    |
905 |       77: "Tip not droped",
    |                    ^^^^^^
    |
error: `possiby` should be `possibly`
  --> pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py:915:85
    |
915 |       88: "Not enough liquid present (Immersion depth or surface following position possiby"
    |                                                                                     ^^^^^^^
    |
error: `resetable` should be `resettable`
  --> pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py:917:28
    |
917 |       90: "Limit curve not resetable",
    |                            ^^^^^^^^^
    |
error: `depricated` should be `deprecated`
  --> pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py:1179:40
     |
1179 |       "set_minimum_traversal_height is depricated. use set_minimum_channel_traversal_height or "
     |                                        ^^^^^^^^^^
     |
error: `ressource` should be `resource`
  --> pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py:2740:16
     |
2740 |     """After a ressource is picked up, move it to a new location but don't release it yet.
     |                ^^^^^^^^^
     |
error: `UE` should be `USE`, `DUE`
  --> pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py:5208:19
     |
5208 |   # TODO:(command:UE)
     |                   ^^
     |
error: `FO` should be `OF`, `FOR`, `DO`, `GO`, `TO`
  --> pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py:5229:19
     |
5229 |   # TODO:(command:FO)
     |                   ^^
     |
error: `predifined` should be `predefined`
  --> pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py:6753:27
     |
6753 |     Rotate the iswap to a predifined position.
     |                           ^^^^^^^^^^
     |
error: `successfuly` should be `successfully`
  --> pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py:6871:38
     |
6871 |     # Once the command has completed successfuly, set _iswap_parked to false
     |                                      ^^^^^^^^^^^
     |
error: `aviod` should be `avoid`
  --> pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py:7523:83
     |
7523 |         if the requested locations are not valid. Set this to False if you wan to aviod inadvertently
     |                                                                                   ^^^^^
     |
error: `perfom` should be `perform`
  --> pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py:7800:44
     |
7800 |   Namespace for actions that are unsafe to perfom.
     |                                            ^^^^^^
     |
error: `Celcius` should be `Celsius`
  --> pylabrobot/tilting/hamilton_backend.py:234:35
    |
234 |       temperature: temperature in Celcius, between 10 and 50
    |                                   ^^^^^^^
    |
error: `heighest` should be `heights`, `highest`
  --> pylabrobot/resources/resource.py:803:5
    |
803 |     heighest_point = self.get_absolute_location(z="t").z
    |     ^^^^^^^^
    |
error: `heighest` should be `heights`, `highest`
  --> pylabrobot/resources/resource.py:805:7
    |
805 |       heighest_point = 0
    |       ^^^^^^^^
    |
error: `heighest` should be `heights`, `highest`
  --> pylabrobot/resources/resource.py:807:7
    |
807 |       heighest_point = max(heighest_point, resource.get_highest_known_point())
    |       ^^^^^^^^
    |
error: `heighest` should be `heights`, `highest`
  --> pylabrobot/resources/resource.py:807:28
    |
807 |       heighest_point = max(heighest_point, resource.get_highest_known_point())
    |                            ^^^^^^^^
    |
error: `heighest` should be `heights`, `highest`
  --> pylabrobot/resources/resource.py:808:12
    |
808 |     return heighest_point
    |            ^^^^^^^^
    |
error: `resuse` should be `reuse`
  --> docs/resources/index.md:155:50
    |
155 |     <p>PLR is actively addressing these resource resuse constraints in numerous ways:</p>
    |                                                  ^^^^^^
    |
error: `trought` should be `through`
  --> pylabrobot/resources/hamilton/trough_carriers.py:20:3
   |
20 |   trought_z_thickness = 1.4
   |   ^^^^^^^
   |
error: `tht` should be `the`, `that`
  --> pylabrobot/resources/carrier.py:239:51
    |
239 |       resource: The Resource on the ResourceStack tht was assigned.
    |                                                   ^^^
    |
error: `comunication` should be `communication`
  --> docs/user_guide/00_liquid-handling/hamilton-star/hardware/replacing-iswap.md:42:100
   |
42 | 6. Place the replacement arm on the system, insert and tighten the two fixing screws, reattach the comunication and Y-drive ribon cables.
   |                                                                                                    ^^^^^^^^^^^^
   |
error: `recomended` should be `recommended`
  --> docs/user_guide/00_liquid-handling/hamilton-star/hardware/replacing-iswap.md:44:53
   |
44 | Note: Once physically installed on the system it is recomended that you level the arm in relation to the deck.
   |                                                     ^^^^^^^^^^
   |
error: `machiens` should be `machines`
  --> docs/user_guide/_getting-started/plr-architecture.rst:64:50
   |
64 | For detailed information on how to integrate new machiens into PLR ecosystem,
   |                                                  ^^^^^^^^
   |
error: `predifined` should be `predefined`
  --> docs/user_guide/00_liquid-handling/hamilton-star/iswap-module.md:25:32
   |
25 | You can rotate the iSWAP to 12 predifined positions using {meth}`~pylabrobot.liquid_handling.backends.hamilton.STAR_backend.STARBackend.iswap_rotate`.
   |                                ^^^^^^^^^^
   |
error: `Whe` should be `When`, `We`
  --> pylabrobot/liquid_handling/backends/opentrons_backend.py:628:57
    |
628 |     """Move the pipette head to the specified location. Whe a tip is mounted, the location refers
    |                                                         ^^^
    |

@rickwierenga
Copy link
Member

thanks for nice PR!

could you please run make format

@O957
Copy link
Contributor Author

O957 commented Aug 17, 2025

I got

python -m ruff format pylabrobot
make: python: No such file or directory
make: *** [format] Error 1

after running make format in pylabrobot. Instead, I tried:

python3 -m ruff format pylabrobot

and got as output the following:

27 files reformatted, 300 files left unchanged

Unrelated: I am unaccustomed to using ruff in this manner (not a value judgement). For context, I typically use Astral's pre-commit hook for ruff, e.g. see this pre-commit-config.yaml config file in one of my repos: https://github.com/AFg6K7h4fhy2/AFg6K7h4fhy2/blob/ece2a7ec328ceb0354df0cbdf669c78341a27171/.pre-commit-config.yaml#L93-L143

@O957
Copy link
Contributor Author

O957 commented Aug 17, 2025

Note

If you retain typos hook and get a failure in the future with a false positive, e.g. some variable named THR and typos suggests "the" as a correction, add the line <false_positive> = "<false_positive>" under [default.extend-words] in _typos.toml.

@rickwierenga
Copy link
Member

looking at the number of files that changes, i think you might be running a different version of ruff. we currently use ruff==0.2.1. (I know, very outdated, but that's a separate PR.)

we have pre-commit configured to run make format if you wanna use it.

@O957
Copy link
Contributor Author

O957 commented Aug 18, 2025

Okay, sounds good. I will revert the ruff format commit and run ruff format with the correct version at some point soon.

@rickwierenga
Copy link
Member

thanks! should be all good to merge when ci passes

@rickwierenga
Copy link
Member

if you want to add this, it would be nice to also run the same check in ci :)

@O957
Copy link
Contributor Author

O957 commented Aug 18, 2025

Commands used in reformating:

  • git revert --no-edit HEAD
  • uvx --from ruff==0.2.1 python3 -m ruff format pylabrobot

@rickwierenga
Copy link
Member

rickwierenga commented Aug 18, 2025

https://github.com/PyLabRobot/pylabrobot/actions/runs/17031151408/job/48275310949?pr=655

seems pre-commit is not found in ci, it needs to be installed explicitly

tbh, i am not a huge fan of ci relying on pre-commit as infrastructure. imo it would be better to have a pre-commit independent command (similar to how other commands are shared in pre-commit/ci/user level through the Makefile). but perhaps this typos library is pre-commit/ci specific? happy to hear your thoughts on this

@rickwierenga rickwierenga force-pushed the main branch 5 times, most recently from 49a6770 to 159fd78 Compare August 29, 2025 21:51
@O957
Copy link
Contributor Author

O957 commented Sep 15, 2025

Apologies for the laggardness on this; I partially forgot about it until it re-hit my notifactions today. Thank you for being supportive and best wishes with this repository and your future work!

@rickwierenga rickwierenga merged commit 0cf81d4 into PyLabRobot:main Sep 15, 2025
7 checks passed
@rickwierenga
Copy link
Member

thank you for making the PR! makes everything look more polished and presentable, especially in public facing docs.

and apologies also for slow responses on my side :)

@BioCam
Copy link
Collaborator

BioCam commented Sep 15, 2025

This is amazing; thank you for this!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants