Numba caching tools#
Classes:
|
Cache with file hash |
|
Cache with file hash in (more) shareable location. |
- class cmomy.cache.HashCacheLocator(py_func, py_file)[source]#
Bases:
UserProvidedCacheLocatorCache with file hash
Use this with
NUMBA_CACHE_DIRandNUMBA_CACHE_LOCATOR_CLASS="cmomy.cache.HashCacheLocator". Cache location is identical to default, but with cache key(NUMBA_CACHE_TOOLS_MAGIC, file-hash)wherefile-hashis the sha256 of the file.Methods:
Get a timestamp representing the source code's freshness.
Bases:
HashCacheLocatorCache with file hash in (more) shareable location.
Like
HashCacheLocator, but location is calculated asNUMBA_CACHE_DIR / directory-magic-package-package_version-systemwheresystemis a combination of the numba version, python version, platform, and machine.Methods:
get_suitable_cache_subpath(py_file)Given the Python file path, compute a suitable path inside the cache directory.
Given the Python file path, compute a suitable path inside the cache directory.
This will reduce a file path that is too long, which can be a problem on some operating system (i.e. Windows 7).