-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use lax validation by default (#159)
* fix: use lax validation * style: [pre-commit.ci] auto fixes [...] * fix autogen, fix tests * xfail round trip * test: update test Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
520b90f
commit d14a7a0
Showing
5 changed files
with
127 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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"> | ||
<Image ID="Image:0" Name="P_t00000,W_s00_0"> | ||
<Pixels BigEndian="false" DimensionOrder="XYZTC" ID="Pixels:0" Interleaved="false" PhysicalSizeX="0.08850000022125" PhysicalSizeXUnit="µm" PhysicalSizeY="0.08850000022125" PhysicalSizeYUnit="µm" PhysicalSizeZ="1.0" PhysicalSizeZUnit="µm" SignificantBits="16" SizeC="2" SizeT="11" SizeX="171" SizeY="196" SizeZ="5" Type="uint16"> | ||
<Channel ID="Channel:0:0" SamplesPerPixel="1"> | ||
<LightPath/> | ||
</Channel> | ||
<Channel ID="Channel:0:1" SamplesPerPixel="1"> | ||
<LightPath/> | ||
</Channel> | ||
<MetadataOnly/> | ||
</Pixels> | ||
</Image> | ||
<StructuredAnnotations> | ||
<XMLAnnotation ID="XMLAnnotation:0"> | ||
<Value> | ||
<SpimData version="0.2"> | ||
<BasePath type="relative">.</BasePath> | ||
<SequenceDescription> | ||
<ImageLoader format="bdv.hdf5"> | ||
<hdf5 type="relative">xyzct_16bit__mitosis.h5</hdf5> | ||
</ImageLoader> | ||
<ViewSetups> | ||
<ViewSetup> | ||
<id>0</id> | ||
<name>channel 1</name> | ||
<size>171 196 5</size> | ||
<voxelSize> | ||
<unit>µm</unit> | ||
<size>0.08850000022125 0.08850000022125 1.0</size> | ||
</voxelSize> | ||
<attributes> | ||
<channel>1</channel> | ||
</attributes> | ||
</ViewSetup> | ||
<ViewSetup> | ||
<id>1</id> | ||
<name>channel 2</name> | ||
<size>171 196 5</size> | ||
<voxelSize> | ||
<unit>µm</unit> | ||
<size>0.08850000022125 0.08850000022125 1.0</size> | ||
</voxelSize> | ||
<attributes> | ||
<channel>2</channel> | ||
</attributes> | ||
</ViewSetup> | ||
<Attributes name="channel"> | ||
<Channel> | ||
<id>1</id> | ||
<name>1</name> | ||
</Channel> | ||
<Channel> | ||
<id>2</id> | ||
<name>2</name> | ||
</Channel> | ||
</Attributes> | ||
</ViewSetups> | ||
<Timepoints type="range"> | ||
<first>0</first> | ||
<last>10</last> | ||
</Timepoints> | ||
</SequenceDescription> | ||
<ViewRegistrations> | ||
<ViewRegistration setup="0" timepoint="0"> | ||
<ViewTransform type="affine"> | ||
<affine>0.08850000022125 0.0 0.0 0.0 0.0 0.08850000022125 0.0 0.0 0.0 0.0 1.0 | ||
0.0</affine> | ||
</ViewTransform> | ||
</ViewRegistration> | ||
</ViewRegistrations> | ||
</SpimData> | ||
</Value> | ||
</XMLAnnotation> | ||
</StructuredAnnotations> | ||
</OME> |
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,15 @@ | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
from ome_types import from_xml | ||
|
||
DATA = Path(__file__).parent / "data" | ||
|
||
|
||
def test_bad_xml_annotation() -> None: | ||
"""Test that a bad XML annotation is not imported""" | ||
with pytest.warns(match="Casting invalid AnnotationID"): | ||
ome = from_xml(DATA / "invalid_xml_annotation.ome.xml") | ||
assert len(ome.images) == 1 | ||
assert ome.structured_annotations[0].id == "Annotation:0" |
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