visisipy.analysis.base#
Base functionality for optical analyses.
This module provides the analysis decorator for optical analyses.
Functions#
|
Decorator for analysis functions. |
Module Contents#
- visisipy.analysis.base.analysis(function: collections.abc.Callable[Ellipsis, T1 | tuple[T1, T2]]) collections.abc.Callable#
Decorator for analysis functions.
This decorator is used to mark a function as an analysis function. Analysis functions are used to perform various analyses on the optical system. This decorator passes the model and backend to the function and ensures the model is built. Furthermore, it validates the function signature to ensure it has the correct parameters.
Every analysis must have at least the following parameters:
- model: EyeModel | None must be the first parameter. If not specified by the user, the eye model that is currently
built in the backend will be used.
- return_raw_result: bool must be a keyword-only parameter. If True, the function will return a tuple with the
result and the raw result returned by the backend.
- backend: BaseBackend must be a keyword-only parameter. If not specified by the user, the currently configured
backend will be used.
- Parameters:
- functionCallable
The analysis function.
- Returns:
- Callable
The analysis function.