-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
5 changed files
with
64 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from pydantic_zarr.v2 import ArraySpec, GroupSpec | ||
|
||
from ome_zarr_models._v05.base import BaseGroupv05, BaseOMEAttrs | ||
from ome_zarr_models.v04.well import WellAttrs | ||
|
||
__all__ = ["Well", "WellAttrs"] | ||
|
||
|
||
class OMEWellAttrs(BaseOMEAttrs): | ||
ome: WellAttrs | ||
|
||
|
||
class Well(GroupSpec[OMEWellAttrs, ArraySpec | GroupSpec], BaseGroupv05): # type: ignore[misc] | ||
""" | ||
An OME-Zarr well dataset. | ||
""" |
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,3 @@ | ||
from ome_zarr_models.v04.well_types import WellImage, WellMeta | ||
|
||
__all__ = ["WellImage", "WellMeta"] |
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,25 @@ | ||
{ | ||
"ome": { | ||
"version": "0.5", | ||
"well": { | ||
"images": [ | ||
{ | ||
"acquisition": 1, | ||
"path": "0" | ||
}, | ||
{ | ||
"acquisition": 1, | ||
"path": "1" | ||
}, | ||
{ | ||
"acquisition": 2, | ||
"path": "2" | ||
}, | ||
{ | ||
"acquisition": 2, | ||
"path": "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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from ome_zarr_models._v05.well import Well, WellAttrs | ||
from ome_zarr_models._v05.well_types import WellImage, WellMeta | ||
from tests.v05.conftest import json_to_zarr_group | ||
|
||
|
||
def test_well() -> None: | ||
zarr_group = json_to_zarr_group(json_fname="well_example.json") | ||
ome_group = Well.from_zarr(zarr_group) | ||
assert ome_group.ome_attributes == WellAttrs( | ||
well=WellMeta( | ||
images=[ | ||
WellImage(path="0", acquisition=1), | ||
WellImage(path="1", acquisition=1), | ||
WellImage(path="2", acquisition=2), | ||
WellImage(path="3", acquisition=2), | ||
], | ||
version=None, | ||
), | ||
version="0.5", | ||
) |