Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sha issues for versioned RDFs #608

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ Made with [contrib.rocks](https://contrib.rocks).

### bioimageio.spec Python package

#### bioimageio.spec 0.5.3post2

* fix SHA-256 value when resolving a RDF version from the bioimage.io collection that is not the latest

#### bioimageio.spec 0.5.3post1

* bump patch version during loading for model 0.5.x
Expand Down
2 changes: 1 addition & 1 deletion bioimageio/spec/VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.5.3post1"
"version": "0.5.3post2"
}
17 changes: 13 additions & 4 deletions bioimageio/spec/_internal/io_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 +181,27 @@ def _get_one_collection(url: str):
for raw_entry in collection:
assert isinstance(raw_entry, dict), type(raw_entry)
v: Any
sha: Any
d: Any
try:
for i, (v, d) in enumerate(zip(raw_entry["versions"], raw_entry["dois"])):
for i, (v, sha, d) in enumerate(
zip(
raw_entry["versions"],
raw_entry["versions_sha256"],
raw_entry["dois"],
)
):
entry = CollectionEntry(
id=raw_entry["id"],
emoji=raw_entry.get("id_emoji", raw_entry.get("nickname_icon", "")),
url=raw_entry["rdf_source"],
sha256=raw_entry["rdf_sha256"],
url=raw_entry["rdf_source"].replace(
f"/{raw_entry['versions'][0]}/", f"/{v}/"
),
sha256=sha,
version=v,
doi=d,
)
ret[f"{raw_entry['id']}/{v}"] = entry
ret[v] = entry
if i == 0:
# latest version
ret[raw_entry["id"]] = entry
Expand Down
Loading