Skip to content

Commit

Permalink
forgot these
Browse files Browse the repository at this point in the history
  • Loading branch information
rickwierenga committed Nov 21, 2022
2 parents 526663d + e221c1f commit 3772080
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 2 deletions.
20 changes: 20 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Global options:

[mypy]
warn_return_any = True
warn_unused_configs = True
check_untyped_defs = True

# Per-module options:

[mypy-usb.*]
ignore_missing_imports = True

[mypy-wtforms.*]
ignore_missing_imports = True

[mypy-wtforms_json.*]
ignore_missing_imports = True

[mypy-ot_api.*]
ignore_missing_imports = True
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
""" Tests for the simulation backend. """

import json
import time
import unittest

import pytest
Expand Down Expand Up @@ -32,6 +33,8 @@ def test_setup_stop(self):
def setup_stop_single():
backend.setup()
self.assertIsNotNone(backend.loop)
# wait for the server to start
time.sleep(1)
backend.stop()
self.assertFalse(backend.has_connection())

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import List, Literal
import sys
from typing import List
import unittest

from pylabrobot.liquid_handling.resources.abstract import (
Expand All @@ -8,6 +9,11 @@
create_equally_spaced
)

if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal


class TestItemizedResource(unittest.TestCase):
""" Tests for ItemizedResource """
Expand Down
2 changes: 1 addition & 1 deletion pylabrobot/liquid_handling/resources/ml_star/tip_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
#: High volume tip without a filter (`tt04` in venus)
high_volume_tip_no_filter = TipType(
has_filter=False,
total_tip_length=59.9,
total_tip_length=95.1,
maximal_volume=1000,
tip_size=TipSize.HIGH_VOLUME,
pick_up_method=TipPickupMethod.OUT_OF_RACK
Expand Down
10 changes: 10 additions & 0 deletions pylabrobot/utils/optionals.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from typing import TypeVar, Optional

T = TypeVar("T")


def force_unwrap(v: Optional[T]) -> T: # like in Swift
""" Force unwrap an optional value. """
if v is None:
raise ValueError("Optional is None")
return v

0 comments on commit 3772080

Please sign in to comment.