Skip to content

Commit bf5b247

Browse files
committed
adapt for new status valid-format
1 parent c0ff94b commit bf5b247

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

bioimageio/core/_resource_tests.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,19 +514,22 @@ def load_description_and_test(
514514
enable_determinism(determinism, weight_formats=weight_formats)
515515
for w in weight_formats:
516516
_test_model_inference(rd, w, devices, **deprecated)
517-
if stop_early and rd.validation_summary.status != "passed":
517+
if stop_early and rd.validation_summary.status == "failed":
518518
break
519519

520520
if not isinstance(rd, v0_4.ModelDescr):
521521
_test_model_inference_parametrized(
522522
rd, w, devices, stop_early=stop_early
523523
)
524-
if stop_early and rd.validation_summary.status != "passed":
524+
if stop_early and rd.validation_summary.status == "failed":
525525
break
526526

527527
# TODO: add execution of jupyter notebooks
528528
# TODO: add more tests
529529

530+
if rd.validation_summary.status == "valid-format":
531+
rd.validation_summary.status = "passed"
532+
530533
return rd
531534

532535

bioimageio/core/cli.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,11 @@ def descr(self):
162162

163163
def run(self):
164164
self.log(self.descr)
165-
sys.exit(0 if self.descr.validation_summary.status == "passed" else 1)
165+
sys.exit(
166+
0
167+
if self.descr.validation_summary.status in ("valid-format", "passed")
168+
else 1
169+
)
166170

167171

168172
class TestCmd(CmdBase, WithSource, WithSummaryLogging):

bioimageio/core/commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def validate_format(
6363
descr: a bioimageio resource description
6464
"""
6565
_ = descr.validation_summary.save(summary)
66-
return 0 if descr.validation_summary.status == "passed" else 1
66+
return 0 if descr.validation_summary.status in ("valid-format", "passed") else 1
6767

6868

6969
# TODO: absorb into `save_bioimageio_package`

tests/test_any_model_fixture.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
def test_model(any_model: str):
55
summary = load_description_and_validate_format_only(any_model)
6-
assert summary.status == "passed", summary.display()
6+
assert summary.status == "valid-format", summary.display()

0 commit comments

Comments
 (0)