httpstan.services_stub

Call and process output of stan::services functions.

Functions here perform the menial task of calling (from Python) a named C++ function in stan::services given a specific Stan model. The output of the stan::services function is routed from stan::callbacks writers into Python via a Unix domain socket.

Module Contents

Functions

init_worker() → None

_make_lazy_function_wrapper_helper(function_basename: str, model_name: str, *args: Any, **kwargs: Any) → Callable

_make_lazy_function_wrapper(function_basename: str, model_name: str) → Callable

call(function_name: str, model_name: str, fit_name: str, logger_callback: Optional[Callable] = None, **kwargs: dict) → None

Call stan::services function.

Attributes

executor

logger

httpstan.services_stub.init_worker() None[source]
httpstan.services_stub.executor
httpstan.services_stub.logger
httpstan.services_stub._make_lazy_function_wrapper_helper(function_basename: str, model_name: str, *args: Any, **kwargs: Any) Callable[source]
httpstan.services_stub._make_lazy_function_wrapper(function_basename: str, model_name: str) Callable[source]
async httpstan.services_stub.call(function_name: str, model_name: str, fit_name: str, logger_callback: Optional[Callable] = None, **kwargs: dict) None[source]

Call stan::services function.

Yields (asynchronously) messages from the stan::callbacks writers which are written to by the stan::services function.

This is a coroutine function.

Parameters
  • function_name – full name of function in stan::services

  • services_module (module) – model-specific services extension module

  • fit_name – Name of fit, used for saving length-prefixed messages

  • logger_callback – Callback function for logger messages, including sampling progress messages

  • kwargs – named stan::services function arguments, see CmdStan documentation.