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