Skip to content

Commit af95374

Browse files
committed
also accept model.yaml in place of rdf.yaml
1 parent eb7814c commit af95374

File tree

1 file changed

+10
-5
lines changed
  • bioimageio/core/resource_io

1 file changed

+10
-5
lines changed

bioimageio/core/resource_io/io_.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from bioimageio import spec
1212
from bioimageio.core.resource_io.nodes import ResourceDescription
13-
from bioimageio.spec.io_ import resolve_rdf_source
13+
from bioimageio.spec.io_ import RDF_NAMES, resolve_rdf_source
1414
from bioimageio.spec.shared import raw_nodes
1515
from bioimageio.spec.shared.common import BIOIMAGEIO_CACHE_PATH, get_class_name_from_type
1616
from bioimageio.spec.shared.raw_nodes import ResourceDescription as RawResourceDescription
@@ -37,8 +37,10 @@ def extract_resource_package(
3737
from urllib.request import urlretrieve
3838

3939
package_path = cache_folder / root.scheme / root.authority / root.path.strip("/") / root.query
40-
if (package_path / "rdf.yaml").exists():
41-
download = None
40+
for rdf_name in RDF_NAMES:
41+
if (package_path / rdf_name).exists():
42+
download = None
43+
break
4244
else:
4345
try:
4446
download, header = urlretrieve(str(root))
@@ -55,8 +57,11 @@ def extract_resource_package(
5557
with zipfile.ZipFile(local_source) as zf:
5658
zf.extractall(package_path)
5759

58-
if not (package_path / "rdf.yaml").exists():
59-
raise FileNotFoundError(f"missing 'rdf.yaml' in {root} extracted from {download}")
60+
for rdf_name in RDF_NAMES:
61+
if (package_path / rdf_name).exists():
62+
break
63+
else:
64+
raise FileNotFoundError(f"Missing 'rdf.yaml' in {root} extracted from {download}")
6065

6166
if download is not None:
6267
try:

0 commit comments

Comments
 (0)