-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
15aabfb
commit d988f5d
Showing
7 changed files
with
160 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import pytest | ||
|
||
from useq import MDASequence | ||
|
||
|
||
@pytest.fixture | ||
def mda1() -> MDASequence: | ||
return MDASequence( | ||
axis_order="tpcz", | ||
metadata={"some info": "something"}, | ||
stage_positions=[ | ||
(10, 20), | ||
{ | ||
"x": 10, | ||
"y": 20, | ||
"z": 50, | ||
"name": "test_name", | ||
"z_plan": {"above": 10, "below": 0, "step": 1}, | ||
}, | ||
], | ||
channels=[ | ||
{"config": "Cy5", "exposure": 50}, | ||
{"config": "FITC", "exposure": 100.0}, | ||
{"config": "DAPI", "do_stack": False, "acquire_every": 3}, | ||
], | ||
time_plan=[ | ||
{"interval": 3, "loops": 3}, | ||
{"duration": {"minutes": 40}, "interval": 10}, | ||
], | ||
z_plan={"range": 1.0, "step": 0.5}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{ | ||
"axis_order": "tpcz", | ||
"channels": [ | ||
{ | ||
"acquire_every": 1, | ||
"camera": null, | ||
"config": "Cy5", | ||
"do_stack": true, | ||
"exposure": 50.0, | ||
"group": "Channel", | ||
"z_offset": 0.0 | ||
}, | ||
{ | ||
"acquire_every": 1, | ||
"camera": null, | ||
"config": "FITC", | ||
"do_stack": true, | ||
"exposure": 100.0, | ||
"group": "Channel", | ||
"z_offset": 0.0 | ||
}, | ||
{ | ||
"acquire_every": 3, | ||
"camera": null, | ||
"config": "DAPI", | ||
"do_stack": false, | ||
"exposure": null, | ||
"group": "Channel", | ||
"z_offset": 0.0 | ||
} | ||
], | ||
"metadata": { | ||
"some info": "something" | ||
}, | ||
"stage_positions": [ | ||
{ | ||
"name": null, | ||
"x": 10.0, | ||
"y": 20.0, | ||
"z": null, | ||
"z_plan": { | ||
"go_up": true | ||
} | ||
}, | ||
{ | ||
"name": "test_name", | ||
"x": 10.0, | ||
"y": 20.0, | ||
"z": 50.0, | ||
"z_plan": { | ||
"above": 10.0, | ||
"below": 0.0, | ||
"go_up": true, | ||
"step": 1.0 | ||
} | ||
} | ||
], | ||
"time_plan": { | ||
"phases": [ | ||
{ | ||
"interval": 3.0, | ||
"loops": 3, | ||
"prioritize_duration": false | ||
}, | ||
{ | ||
"duration": 2400.0, | ||
"interval": 10.0, | ||
"prioritize_duration": true | ||
} | ||
], | ||
"prioritize_duration": false | ||
}, | ||
"z_plan": { | ||
"go_up": true, | ||
"range": 1.0, | ||
"step": 0.5 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
axis_order: tpcz | ||
channels: | ||
- config: Cy5 | ||
exposure: 50.0 | ||
- config: FITC | ||
exposure: 100.0 | ||
- acquire_every: 3 | ||
config: DAPI | ||
do_stack: false | ||
metadata: | ||
some info: something | ||
stage_positions: | ||
- x: 10.0 | ||
y: 20.0 | ||
- name: test_name | ||
x: 10.0 | ||
y: 20.0 | ||
z: 50.0 | ||
z_plan: | ||
above: 10.0 | ||
below: 0.0 | ||
step: 1.0 | ||
time_plan: | ||
phases: | ||
- interval: 0:00:03 | ||
loops: 3 | ||
- duration: 0:40:00 | ||
interval: 0:00:10 | ||
z_plan: | ||
range: 1.0 | ||
step: 0.5 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import json | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
from useq import MDASequence | ||
|
||
|
||
@pytest.mark.parametrize("ext", ["json", "yaml"]) | ||
def test_serialization(mda1: MDASequence, ext: str) -> None: | ||
FILE = Path(__file__).parent / "fixtures" / f"mda.{ext}" | ||
text = FILE.read_text() | ||
mda = MDASequence.parse_file(str(FILE)) | ||
assert mda == mda1 | ||
if ext == "json": | ||
assert json.loads(mda.json(exclude={"uid"})) == json.loads(text) | ||
else: | ||
assert mda.yaml() == text |
This file was deleted.
Oops, something went wrong.