:py:mod:`symfem.caching` ======================== .. py:module:: symfem.caching .. autoapi-nested-parse:: Functions to cache matrices. Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: symfem.caching.load_cached_matrix symfem.caching.save_cached_matrix symfem.caching.matrix_to_string symfem.caching.matrix_from_string Attributes ~~~~~~~~~~ .. autoapisummary:: symfem.caching.CACHE_DIR symfem.caching.CACHE_FORMAT .. py:data:: CACHE_DIR .. py:data:: CACHE_FORMAT :value: '1' .. py:function:: load_cached_matrix(matrix_type: str, cache_id: str, size: Tuple[int, int]) -> Union[sympy.matrices.dense.MutableDenseMatrix, None] Load a cached matrix. :param matrix_type: The type of the matrix. This will be included in the filename. :param cache_id: The unique identifier of the matrix within this type :returns: The matrix .. py:function:: save_cached_matrix(matrix_type: str, cache_id: str, matrix: sympy.matrices.dense.MutableDenseMatrix) Save a matrix to the cache. :param matrix_type: The type of the matrix. This will be included in the filename. :param cache_id: The unique identifier of the matrix within this type :param matrix: The matrix .. py:function:: matrix_to_string(m: sympy.matrices.dense.MutableDenseMatrix) -> str Convert a matrix to a string. :param m: The matrix :returns: A representation of the matrix as a string .. py:function:: matrix_from_string(mstr: str) -> sympy.matrices.dense.MutableDenseMatrix Convert a string to a matrix. :param mstr: The string in the format output by `matrix_to_string` :returns: The matrix