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

update docstrings #671

Merged
merged 2 commits into from
Nov 29, 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
12 changes: 6 additions & 6 deletions bioimageio/spec/_internal/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
from .validation_context import ValidationContext, validation_context_var


def _node_title_generator(model: Type[Node]) -> str:
def _node_title_generator(node: Type[Node]) -> str:
return (
f"{model.implemented_type} {model.implemented_format_version}" # pyright: ignore[reportAttributeAccessIssue]
if hasattr(model, "implemented_type")
and hasattr(model, "implemented_format_version")
else model.__name__
f"{node.implemented_type} {node.implemented_format_version}" # pyright: ignore[reportAttributeAccessIssue]
if hasattr(node, "implemented_type")
and hasattr(node, "implemented_format_version")
else f"{node.__module__.replace('bioimageio.spec.', '')}.{node.__name__}"
)


Expand All @@ -38,7 +38,7 @@ class Node(
use_attribute_docstrings=True,
model_title_generator=_node_title_generator,
):
"""Subpart of a resource description"""
"""""" # empty docstring to remove all pydantic docstrings from the pdoc spec docs

@classmethod
def model_validate(
Expand Down
5 changes: 2 additions & 3 deletions bioimageio/spec/model/v0_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
from .v0_4 import ZeroMeanUnitVarianceDescr as _ZeroMeanUnitVarianceDescr_v0_4
from .v0_4 import package_weights

# unit names from https://ngff.openmicroscopy.org/latest/#axes-md
SpaceUnit = Literal[
"attometer",
"angstrom",
Expand Down Expand Up @@ -159,6 +158,7 @@
"zeptometer",
"zettameter",
]
"""Space unit compatible to the [OME-Zarr axes specification 0.5](https://ngff.openmicroscopy.org/0.5/#axes-md)"""

TimeUnit = Literal[
"attosecond",
Expand All @@ -185,6 +185,7 @@
"zeptosecond",
"zettasecond",
]
"""Time unit compatible to the [OME-Zarr axes specification 0.5](https://ngff.openmicroscopy.org/0.5/#axes-md)"""

AxisType = Literal["batch", "channel", "index", "time", "space"]

Expand Down Expand Up @@ -414,8 +415,6 @@ def _get_unit(
return axis.unit


# this Axis definition is compatible with the NGFF draft from July 10, 2023
# https://ngff.openmicroscopy.org/latest/#axes-md
class AxisBase(NodeWithExplicitlySetFields):
fields_to_set_explicitly: ClassVar[FrozenSet[LiteralString]] = frozenset({"type"})

Expand Down
Loading