pisces.models.stars.polytropes.PolytropicStarModel.has_hook#

classmethod PolytropicStarModel.has_hook(hook: BaseHook | str) bool#

Check if a given hook is mixed into the model (regardless of activation status).

The hook may be specified either as a class (subclass of BaseHook) or as a string name. When a string is provided, it is matched against both the symbolic name (_<HookClassName>_NAME) and the class name.

Parameters:

hook (type or str) – A hook class or hook name to test for.

Returns:

True if the hook is present in the model’s MRO, False otherwise.

Return type:

bool