@@ -517,11 +517,103 @@ def test_conversion_v04_to_v05(default_multiscale: Multiscale) -> None:
517517 Test that converting a v0.4 Multiscale to v0.5 and back again results
518518 in the same model
519519 """
520- from ome_zarr_models .v05 .multiscales import Multiscale as MultiscaleV05
520+ from ome_zarr_models .v05 .axes import Axis as AxisV05
521+ from ome_zarr_models .v05 .multiscales import (
522+ Dataset as DatasetV05 ,
523+ )
524+ from ome_zarr_models .v05 .multiscales import (
525+ Multiscale as MultiscaleV05 ,
526+ )
521527
528+ assert default_multiscale == Multiscale (
529+ axes = (
530+ Axis (name = "c" , type = "channel" , unit = None ),
531+ Axis (name = "z" , type = "space" , unit = "meter" ),
532+ Axis (name = "x" , type = "space" , unit = "meter" ),
533+ Axis (name = "y" , type = "space" , unit = "meter" ),
534+ ),
535+ datasets = (
536+ Dataset (
537+ path = "path0" ,
538+ coordinateTransformations = (
539+ VectorScale (type = "scale" , scale = [1.0 , 1.0 , 1.0 , 1.0 ]),
540+ VectorTranslation (
541+ type = "translation" , translation = [0.0 , 0.0 , 0.0 , 0.0 ]
542+ ),
543+ ),
544+ ),
545+ Dataset (
546+ path = "path1" ,
547+ coordinateTransformations = (
548+ VectorScale (type = "scale" , scale = [1.0 , 1.0 , 1.0 , 1.0 ]),
549+ VectorTranslation (
550+ type = "translation" , translation = [0.0 , 0.0 , 0.0 , 0.0 ]
551+ ),
552+ ),
553+ ),
554+ Dataset (
555+ path = "path2" ,
556+ coordinateTransformations = (
557+ VectorScale (type = "scale" , scale = [1.0 , 1.0 , 1.0 , 1.0 ]),
558+ VectorTranslation (
559+ type = "translation" , translation = [0.0 , 0.0 , 0.0 , 0.0 ]
560+ ),
561+ ),
562+ ),
563+ ),
564+ coordinateTransformations = (
565+ VectorScale (type = "scale" , scale = [1.0 , 1.0 , 1.0 , 1.0 ]),
566+ ),
567+ metadata = None ,
568+ name = None ,
569+ type = None ,
570+ version = None ,
571+ )
522572 # test conversion to v05
523573 multi_v05 = default_multiscale .to_version ("0.5" )
524- assert isinstance (multi_v05 , MultiscaleV05 )
574+ assert multi_v05 == MultiscaleV05 (
575+ axes = (
576+ AxisV05 (name = "c" , type = "channel" , unit = None ),
577+ AxisV05 (name = "z" , type = "space" , unit = "meter" ),
578+ AxisV05 (name = "x" , type = "space" , unit = "meter" ),
579+ AxisV05 (name = "y" , type = "space" , unit = "meter" ),
580+ ),
581+ datasets = (
582+ DatasetV05 (
583+ path = "path0" ,
584+ coordinateTransformations = (
585+ VectorScale (type = "scale" , scale = [1.0 , 1.0 , 1.0 , 1.0 ]),
586+ VectorTranslation (
587+ type = "translation" , translation = [0.0 , 0.0 , 0.0 , 0.0 ]
588+ ),
589+ ),
590+ ),
591+ DatasetV05 (
592+ path = "path1" ,
593+ coordinateTransformations = (
594+ VectorScale (type = "scale" , scale = [1.0 , 1.0 , 1.0 , 1.0 ]),
595+ VectorTranslation (
596+ type = "translation" , translation = [0.0 , 0.0 , 0.0 , 0.0 ]
597+ ),
598+ ),
599+ ),
600+ DatasetV05 (
601+ path = "path2" ,
602+ coordinateTransformations = (
603+ VectorScale (type = "scale" , scale = [1.0 , 1.0 , 1.0 , 1.0 ]),
604+ VectorTranslation (
605+ type = "translation" , translation = [0.0 , 0.0 , 0.0 , 0.0 ]
606+ ),
607+ ),
608+ ),
609+ ),
610+ coordinateTransformations = (
611+ VectorScale (type = "scale" , scale = [1.0 , 1.0 , 1.0 , 1.0 ]),
612+ ),
613+ metadata = None ,
614+ name = None ,
615+ type = None ,
616+ )
525617
526618 # ...and back to v04
527619 multi_v04 = multi_v05 .to_version ("0.4" )
0 commit comments