Skip to content

Commit

Permalink
fix some tests, add more data
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Jun 30, 2023
1 parent db76f52 commit 30eea00
Show file tree
Hide file tree
Showing 23 changed files with 36,049 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/ome_types/_mixins/_base_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ def _validate_id(cls, value: Any) -> Any:
*name, v_id = value.rsplit(":", 1)
if not re.match(id_regex, value):
warnings.warn(f"Casting invalid {id_name}ID", stacklevel=2)
return v_id if v_id.isnumeric() else _AUTO_SEQUENCE
return cls._validate_id(
int(v_id) if v_id.isnumeric() else _AUTO_SEQUENCE
)

with contextlib.suppress(ValueError):
_COUNTERS[cls] = max(current_count, int(v_id))
Expand Down
11 changes: 10 additions & 1 deletion src/ome_types/model/simple_types.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from enum import Enum

from ome_types.model.ome_2016_06 import (
Binning,
Marker,
Expand Down Expand Up @@ -78,7 +80,6 @@
PercentFraction = float
PositiveFloat = float
PositiveInt = int
UnitsAngle = str
UniversallyUniqueIdentifier = str

# IDs
Expand Down Expand Up @@ -111,3 +112,11 @@
ShapeID = str
WellID = str
WellSampleID = str


class UnitsAngle(Enum):
"""The units used to represent an angle."""

DEGREE = "deg"
GRADIAN = "gon"
RADIAN = "rad"
330 changes: 330 additions & 0 deletions tests/data/aics/3d-cell-viewer.ome.xml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tests/data/aics/OverViewScan2-aics.ome.xml

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions tests/data/aics/actk.ome.xml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tests/data/aics/actk_ome_tiff_tiles.ome.xml

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><OME xmlns="http://www.openmicroscopy.org/Schemas/OME/2016-06" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2016-06 http://www.openmicroscopy.org/Schemas/OME/2016-06/ome.xsd"><BinaryOnly MetadataFile="image_stack_tpzc_50tp_2p_5z_3c_512k_1_MMStack_2-Pos000_000.ome.tif" UUID="urn:uuid:659dc8f0-3839-4594-bd3e-41625b4736ef"/></OME>
6,544 changes: 6,544 additions & 0 deletions tests/data/aics/pipeline-4.ome.xml

Large diffs are not rendered by default.

5,843 changes: 5,843 additions & 0 deletions tests/data/aics/pre-variance-cfe.ome.xml

Large diffs are not rendered by default.

312 changes: 312 additions & 0 deletions tests/data/aics/pre-variance-cfe_ome_tiff_tiles.ome.xml

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions tests/data/aics/s_1_t_1_c_10_z_1.ome.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version='1.0' encoding='utf-8'?>
<OME xmlns="http://www.openmicroscopy.org/Schemas/ome/2013-06" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" UUID="urn:uuid:f223d28b-e7e1-4134-8bca-ead48fa8e1a2" xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2013-06 http://www.openmicroscopy.org/Schemas/OME/2012-03/ome.xsd">
<Image ID="0" Name="IMAGE0">
<AcquisitionDate>2019-08-27T14:44:13.136597</AcquisitionDate>
<Pixels BigEndian="true" DimensionOrder="XYCZT" ID="0" SizeC="10" SizeT="1" SizeX="1776" SizeY="1736" SizeZ="1" Type="uint16">
<Channel ID="Channel:0:0" Name="C:0" SamplesPerPixel="1">
<LightPath />
</Channel>
<Channel ID="Channel:0:1" Name="C:1" SamplesPerPixel="1" /><Channel ID="Channel:0:2" Name="C:2" SamplesPerPixel="1" /><Channel ID="Channel:0:3" Name="C:3" SamplesPerPixel="1" /><Channel ID="Channel:0:4" Name="C:4" SamplesPerPixel="1" /><Channel ID="Channel:0:5" Name="C:5" SamplesPerPixel="1" /><Channel ID="Channel:0:6" Name="C:6" SamplesPerPixel="1" /><Channel ID="Channel:0:7" Name="C:7" SamplesPerPixel="1" /><Channel ID="Channel:0:8" Name="C:8" SamplesPerPixel="1" /><Channel ID="Channel:0:9" Name="C:9" SamplesPerPixel="1" /><TiffData FirstC="0" FirstT="0" FirstZ="0" IFD="0" PlaneCount="1" /><TiffData FirstC="1" FirstT="0" FirstZ="0" IFD="1" PlaneCount="1" /><TiffData FirstC="2" FirstT="0" FirstZ="0" IFD="2" PlaneCount="1" /><TiffData FirstC="3" FirstT="0" FirstZ="0" IFD="3" PlaneCount="1" /><TiffData FirstC="4" FirstT="0" FirstZ="0" IFD="4" PlaneCount="1" /><TiffData FirstC="5" FirstT="0" FirstZ="0" IFD="5" PlaneCount="1" /><TiffData FirstC="6" FirstT="0" FirstZ="0" IFD="6" PlaneCount="1" /><TiffData FirstC="7" FirstT="0" FirstZ="0" IFD="7" PlaneCount="1" /><TiffData FirstC="8" FirstT="0" FirstZ="0" IFD="8" PlaneCount="1" /><TiffData FirstC="9" FirstT="0" FirstZ="0" IFD="9" PlaneCount="1" /></Pixels>
</Image>
</OME>
1 change: 1 addition & 0 deletions tests/data/aics/s_1_t_1_c_10_z_1_ome_tiff_tiles.ome.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><!-- Warning: this comment is an OME-XML metadata block, which contains crucial dimensional parameters and other important metadata. Please edit cautiously (if at all), and back up the original data before doing so. For more information, see the OME-TIFF web site: https://docs.openmicroscopy.org/latest/ome-model/ome-tiff/. --><OME xmlns="http://www.openmicroscopy.org/Schemas/OME/2016-06" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Creator="OME Bio-Formats 6.8.1" UUID="urn:uuid:3a5b72cf-24e2-40d2-8a5f-7ebb292ab6a4" xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2016-06 http://www.openmicroscopy.org/Schemas/OME/2016-06/ome.xsd"><Image ID="Image:0" Name="s_1_t_1_c_10_z_1_ome_tiff_tiles.ome.tif"><AcquisitionDate>2019-08-27T14:44:13.136</AcquisitionDate><Pixels BigEndian="false" DimensionOrder="XYZCT" ID="Pixels:0" Interleaved="false" SignificantBits="16" SizeC="10" SizeT="1" SizeX="1776" SizeY="1736" SizeZ="1" Type="uint16"><Channel Color="-1" ID="Channel:0:0" Name="C:0" SamplesPerPixel="1"/><Channel Color="-1" ID="Channel:0:1" Name="C:1" SamplesPerPixel="1"/><Channel Color="-1" ID="Channel:0:2" Name="C:2" SamplesPerPixel="1"/><Channel Color="-1" ID="Channel:0:3" Name="C:3" SamplesPerPixel="1"/><Channel Color="-1" ID="Channel:0:4" Name="C:4" SamplesPerPixel="1"/><Channel Color="-1" ID="Channel:0:5" Name="C:5" SamplesPerPixel="1"/><Channel Color="-1" ID="Channel:0:6" Name="C:6" SamplesPerPixel="1"/><Channel Color="-1" ID="Channel:0:7" Name="C:7" SamplesPerPixel="1"/><Channel Color="-1" ID="Channel:0:8" Name="C:8" SamplesPerPixel="1"/><Channel Color="-1" ID="Channel:0:9" Name="C:9" SamplesPerPixel="1"/><TiffData FirstC="0" FirstT="0" FirstZ="0" IFD="0" PlaneCount="1"><UUID FileName="s_1_t_1_c_10_z_1_ome_tiff_tiles.ome.tif">urn:uuid:3a5b72cf-24e2-40d2-8a5f-7ebb292ab6a4</UUID></TiffData><TiffData FirstC="1" FirstT="0" FirstZ="0" IFD="1" PlaneCount="1"><UUID FileName="s_1_t_1_c_10_z_1_ome_tiff_tiles.ome.tif">urn:uuid:3a5b72cf-24e2-40d2-8a5f-7ebb292ab6a4</UUID></TiffData><TiffData FirstC="2" FirstT="0" FirstZ="0" IFD="2" PlaneCount="1"><UUID FileName="s_1_t_1_c_10_z_1_ome_tiff_tiles.ome.tif">urn:uuid:3a5b72cf-24e2-40d2-8a5f-7ebb292ab6a4</UUID></TiffData><TiffData FirstC="3" FirstT="0" FirstZ="0" IFD="3" PlaneCount="1"><UUID FileName="s_1_t_1_c_10_z_1_ome_tiff_tiles.ome.tif">urn:uuid:3a5b72cf-24e2-40d2-8a5f-7ebb292ab6a4</UUID></TiffData><TiffData FirstC="4" FirstT="0" FirstZ="0" IFD="4" PlaneCount="1"><UUID FileName="s_1_t_1_c_10_z_1_ome_tiff_tiles.ome.tif">urn:uuid:3a5b72cf-24e2-40d2-8a5f-7ebb292ab6a4</UUID></TiffData><TiffData FirstC="5" FirstT="0" FirstZ="0" IFD="5" PlaneCount="1"><UUID FileName="s_1_t_1_c_10_z_1_ome_tiff_tiles.ome.tif">urn:uuid:3a5b72cf-24e2-40d2-8a5f-7ebb292ab6a4</UUID></TiffData><TiffData FirstC="6" FirstT="0" FirstZ="0" IFD="6" PlaneCount="1"><UUID FileName="s_1_t_1_c_10_z_1_ome_tiff_tiles.ome.tif">urn:uuid:3a5b72cf-24e2-40d2-8a5f-7ebb292ab6a4</UUID></TiffData><TiffData FirstC="7" FirstT="0" FirstZ="0" IFD="7" PlaneCount="1"><UUID FileName="s_1_t_1_c_10_z_1_ome_tiff_tiles.ome.tif">urn:uuid:3a5b72cf-24e2-40d2-8a5f-7ebb292ab6a4</UUID></TiffData><TiffData FirstC="8" FirstT="0" FirstZ="0" IFD="8" PlaneCount="1"><UUID FileName="s_1_t_1_c_10_z_1_ome_tiff_tiles.ome.tif">urn:uuid:3a5b72cf-24e2-40d2-8a5f-7ebb292ab6a4</UUID></TiffData><TiffData FirstC="9" FirstT="0" FirstZ="0" IFD="9" PlaneCount="1"><UUID FileName="s_1_t_1_c_10_z_1_ome_tiff_tiles.ome.tif">urn:uuid:3a5b72cf-24e2-40d2-8a5f-7ebb292ab6a4</UUID></TiffData></Pixels></Image></OME>
Loading

0 comments on commit 30eea00

Please sign in to comment.