File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,11 @@ def stardist04_data():
6363 return MappingProxyType (data )
6464
6565
66+ @pytest .fixture (scope = "session" )
67+ def covid_if_dataset_path () -> Path :
68+ return EXAMPLE_DESCRIPTIONS / "datasets/covid_if_training_data/bioimageio.yaml"
69+
70+
6671@pytest .fixture (scope = "session" )
6772def unet2d_path () -> Path :
6873 return UNET2D_ROOT / "bioimageio.yaml"
Original file line number Diff line number Diff line change @@ -42,3 +42,19 @@ def test_load_description_again(unet2d_data: BioimageioYamlContent):
4242 perform_io_checks = False ,
4343 )
4444 assert descr is descr2
45+
46+
47+ def test_load_dataset_description (covid_if_dataset_path : Path , tmp_path : Path ):
48+ from bioimageio .spec import load_dataset_description
49+ from bioimageio .spec ._io import save_bioimageio_yaml_only
50+ from bioimageio .spec .dataset .v0_2 import DatasetDescr
51+
52+ dataset_descr = load_dataset_description (covid_if_dataset_path )
53+ assert isinstance (dataset_descr , DatasetDescr )
54+
55+ # this example happens to consist only of the bioimageio.yaml file,
56+ # so we can test the roundtrip with `save_bioimageio_yaml_only`
57+ save_bioimageio_yaml_only (dataset_descr , tmp_path / "dataset.yaml" )
58+ dataset_descr2 = load_dataset_description (tmp_path / "dataset.yaml" )
59+ assert isinstance (dataset_descr2 , DatasetDescr ) # we cannot expect
60+ assert dataset_descr .model_dump () == dataset_descr2 .model_dump ()
You can’t perform that action at this time.
0 commit comments