Skip to content

Commit

Permalink
improve validate_format docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
FynnBe committed Nov 28, 2024
1 parent 36e2bdc commit e681c3b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion bioimageio/spec/_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,21 @@ def validate_format(
format_version: Union[Literal["discover", "latest"], str] = DISCOVER,
context: Optional[ValidationContext] = None,
) -> ValidationSummary:
"""validate a bioimageio.yaml file (RDF)"""
"""Validate a dictionary holding a boiimageio description
(see `bioimagieo.spec.load_description_and_validate_format_only`
to validate a file source).
Args:
data: dict holding raw bioimageio.yaml content
format_version: format version to (update to and) use for validation
context: validation context, see `bioimagieo.spec.ValidationContext`
Note: Use `bioimagieo.spec.load_description_and_validate_format_only` to validate a
file source instead of loading the YAML content and createing the appropriate
`ValidationContext`.
Or use `bioimagieo.spec.load_description` and access the `validation_summary`
attribute of the returned object.
"""
with context or validation_context_var.get():
rd = build_description(data, format_version=format_version)

Expand Down

0 comments on commit e681c3b

Please sign in to comment.