Skip to content

Commit

Permalink
test: update
Browse files Browse the repository at this point in the history
  • Loading branch information
fdrgsp committed Sep 1, 2023
1 parent 09d32c3 commit d0a3b7a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def test_num_position_error() -> None:
(0.4110535042865755, 0.2244159149844842),
(-0.30538080264438117, 0.7294705653332807),
]
expected_circle = [
expected_ellipse = [
(-1.1833701700089627, -1.272217607180939),
(1.2886747534938614, -0.5343419915023853),
(-1.2180986624660364, -0.4016429267523442),
Expand All @@ -131,7 +131,7 @@ def test_random_points(n_points: int, shape: str, seed: Optional[int]) -> None:
)

if n_points == 3:
expected = expected_rectangle if shape == "rectangle" else expected_circle
expected = expected_rectangle if shape == "rectangle" else expected_ellipse
if seed is None:
assert [(g.x, g.y) for g in rp] != expected
else:
Expand Down
36 changes: 36 additions & 0 deletions tests/test_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
MDAEvent,
MDASequence,
Position,
RandomPoints,
TDurationLoops,
TIntervalDuration,
TIntervalLoops,
Expand Down Expand Up @@ -103,6 +104,41 @@
GridPosition(x=0.0, y=0.0, row=1, col=0, is_relative=False),
],
),
(
RandomPoints(
num_points=3,
max_width=4,
max_height=5,
fov_height=0.5,
fov_width=0.5,
shape="ellipse",
allow_overlap=False,
random_seed=0,
),
[
GridPosition(
x=-1.1833701700089627,
y=-1.272217607180939,
row=0,
col=0,
is_relative=True,
),
GridPosition(
x=1.2886747534938614,
y=-0.5343419915023853,
row=0,
col=0,
is_relative=True,
),
GridPosition(
x=-1.2180986624660364,
y=-0.4016429267523442,
row=0,
col=0,
is_relative=True,
),
],
),
]

all_orders = ["".join(i) for i in itertools.permutations("tpgcz")]
Expand Down

0 comments on commit d0a3b7a

Please sign in to comment.