-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import subprocess | ||
from pathlib import Path | ||
from tempfile import TemporaryDirectory | ||
|
||
import pooch | ||
|
||
from bioimageio.core import load_description, write_description | ||
|
||
rdf_source = "https://raw.githubusercontent.com/bioimage-io/spec-bioimage-io/pydantic_axes/example_specs/models/unet2d_nuclei_broad/rdf_v0_4_9.yaml" | ||
|
||
local_source = Path(pooch.retrieve(rdf_source, None)) # type: ignore | ||
model_as_is, summary_as_is = load_description(rdf_source, format_version="discover") | ||
assert model_as_is is not None, summary_as_is | ||
model_latest, summary_latest = load_description(rdf_source, format_version="latest") | ||
print(summary_latest) | ||
assert model_latest is not None | ||
|
||
with TemporaryDirectory() as tmp: | ||
as_is = Path(tmp) / "as_is.bioimageio.yaml" | ||
write_description(model_as_is, as_is) # write out as is to avoid sorting diff | ||
latest = Path(tmp) / "latest.bioimageio.yaml" | ||
write_description(model_latest, latest) | ||
|
||
_ = subprocess.run(f"git diff --no-index --ignore-all-space {as_is} {latest}") |