Skip to content
Open
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: 3 additions & 1 deletion src/pyrecest/stability.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from collections.abc import Callable, Iterable
from dataclasses import asdict, dataclass
from typing import Final, Literal, ParamSpec, TypeVar
from typing import Any, Final, Literal, ParamSpec, TypeVar

from pyrecest.backend_support._pytorch_allclose_device_contract import (
patch_pytorch_allclose_device_contract as _patch_pytorch_allclose_device_contract,
Expand Down Expand Up @@ -101,6 +101,8 @@ def decorator(obj: Callable[P, R]) -> Callable[P, R]:

def get_public_api_status(name: str) -> PublicAPIStatus | None:
"""Return registered stability metadata for a public API name."""
if not isinstance(name, str):
return None
return _PUBLIC_API_STATUS.get(name)


Expand Down
4 changes: 4 additions & 0 deletions tests/test_stability.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ def example_function():
assert status.notes == "example"


def test_get_public_api_status_returns_none_for_non_string_names():
assert get_public_api_status(["KalmanFilter"]) is None


def test_registered_public_api_status_rows_have_valid_levels():
rows = list(iter_public_api_status())

Expand Down
Loading