-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix Z series values in events() output, and add individual axis …
…indices (#167) * fix: fix events z index * style(pre-commit.ci): auto fixes [...] * change hash --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
a70c051
commit f9feb42
Showing
7 changed files
with
91 additions
and
45 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
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
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,22 @@ | ||
from pathlib import Path | ||
|
||
import nd2 | ||
import pandas as pd | ||
import pytest | ||
|
||
DATA = Path(__file__).parent / "data" | ||
|
||
|
||
@pytest.mark.parametrize("fname", ["t3p3z5c3.nd2", "t3p3c3z5.nd2", "t1t1t1p3c3z5.nd2"]) | ||
def test_events(fname: str) -> None: | ||
with nd2.ND2File(DATA / fname) as f: | ||
events = f.events() | ||
|
||
df = pd.DataFrame(events) | ||
expected_coords = ([0] * 5 + [1000] * 5 + [2000] * 5) * 3 | ||
assert all(df["X Coord [µm]"] == expected_coords) | ||
assert all(df["Y Coord [µm]"] == expected_coords) | ||
assert all(df["Z-Series"] == [-1, -0.5, 0, 0.5, 1] * 9) | ||
assert all(df["T Index"] == [0] * 15 + [1] * 15 + [2] * 15) | ||
assert all(df["Z Index"] == [0, 1, 2, 3, 4] * 9) | ||
assert all(df["Position Name"] == (["p1"] * 5 + [""] * 5 + ["p3"] * 5) * 3) |
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