:py:mod:`httpstan.cache` ======================== .. py:module:: httpstan.cache .. autoapi-nested-parse:: Cache management. Functions in this module manage the Stan model cache and related caches. Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: httpstan.cache.cache_directory httpstan.cache.model_directory httpstan.cache.fit_path httpstan.cache.delete_model_directory httpstan.cache.dump_services_extension_module_compiler_output httpstan.cache.load_services_extension_module_compiler_output httpstan.cache.list_model_names httpstan.cache.dump_stanc_warnings httpstan.cache.load_stanc_warnings httpstan.cache.dump_fit httpstan.cache.load_fit httpstan.cache.delete_fit Attributes ~~~~~~~~~~ .. autoapisummary:: httpstan.cache.logger .. py:data:: logger .. py:function:: cache_directory() -> pathlib.Path Get httpstan cache path. .. py:function:: model_directory(model_name: str) -> pathlib.Path Get the path to a model's directory. Directory may not exist. .. py:function:: fit_path(fit_name: str) -> pathlib.Path Get the path to a fit file. File may not exist. .. py:function:: delete_model_directory(model_name: str) -> None Delete the directory in which a model and associated fits are stored. .. py:function:: dump_services_extension_module_compiler_output(compiler_output: str, model_name: str) -> None Dump compiler output from building a model-specific stan::services extension module. .. py:function:: load_services_extension_module_compiler_output(model_name: str) -> str Load compiler output from building a model-specific stan::services extension module. .. py:function:: list_model_names() -> List[str] Return model names (e.g., `models/dyeicfn2`) for models in cache. .. py:function:: dump_stanc_warnings(stanc_warnings: str, model_name: str) -> None Dump stanc warnings associated with a model. .. py:function:: load_stanc_warnings(model_name: str) -> str Load stanc output associated with a model. .. py:function:: dump_fit(fit_bytes: bytes, name: str) -> None Store Stan fit in filesystem-based cache. The Stan fit is passed via ``fit_bytes``. The content must already be compressed. :param name: Stan fit name :param fit_bytes: gzip-compressed messages associated with Stan fit. .. py:function:: load_fit(name: str) -> bytes Load Stan fit from the filesystem-based cache. :param name: Stan fit name :param model_name: Stan model name Returns gzip-compressed messages associated with Stan fit. .. py:function:: delete_fit(name: str) -> None Delete Stan fit from the filesystem-based cache. :param name: Stan fit name