:py:mod:`httpstan.services.arguments` ===================================== .. py:module:: httpstan.services.arguments .. autoapi-nested-parse:: Lookup arguments and argument default values for stan::services functions. Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: httpstan.services.arguments._pythonize_cmdstan_type httpstan.services.arguments.lookup_default httpstan.services.arguments.function_arguments Attributes ~~~~~~~~~~ .. autoapisummary:: httpstan.services.arguments.Method httpstan.services.arguments.DEFAULTS_LOOKUP .. py:data:: Method .. py:data:: DEFAULTS_LOOKUP .. py:function:: _pythonize_cmdstan_type(type_name: str) -> type Turn CmdStan C++ type name into Python type. For example, "double" becomes ``float`` (the type). .. py:function:: lookup_default(method: Method, arg: str) -> Union[float, int] Fetch default for named argument in a stan:services `function`. Uses defaults from CmdStan. The file ``cmdstan-help-all.json`` is generated with the script ``scripts/parse_cmdstan_help.py`` from the output of running a CmdStan binary with the argument ``help-all`` (e.g., `` examples/bernoulli/bernoulli help-all``) .. py:function:: function_arguments(function_name: str, services_module: types.ModuleType) -> List[str] Get function arguments for stan::services `function_name`. This function parses a function's docstring to get argument names. This is an inferior method to using `inspect.Signature.from_callable(function)`. Unfortunately, pybind11 does not support this use of `inspect`. A compiled `services_module` is required for the lookup. Only simple function arguments are returned. For example, callback writers and var_context arguments are dropped. :param function_name: Name of the function. :param services_module: Compiled model-specific services extension module. :type services_module: module :returns: Argument names for `function_name`.