<commit_before>"""The WaveBlocks Project

This file contains a simple function that selects the desired
matrix exponential routine.

@author: <NAME>
@copyright: Copyright (C) 2011 <NAME>
@license: Modified BSD License
"""

from functools import partial


def create_matrixexponential(description):
    """Returns the requested matrix exponential routine.

    :param description: A :py:class:`ParameterProvider` instance containing at least the
                       key ``matrix_exponential`` and depending on its values more keys.
    """
    method = description["matrix_exponential"]

    if method == "pade":
        from MatrixExponential import matrix_exp_pade
        return matrix_exp_pade
    elif method == "arnoldi":
        from MatrixExponential import matrix_exp_arnoldi
        try:
            arnoldi_steps = min(description["basis_size"], description["arnoldi_steps"])
        except:
            arnoldi_steps = description["arnoldi_steps"]
        return partial(matrix_exp_arnoldi, k=arnoldi_steps)
    else:
        raise ValueError("Unknown matrix exponential algorithm")<commit_msg>Removed obsolete configuration variable<commit_after>"""The WaveBlocks Project

This file contains a simple function that selects the desired
matrix exponential routine.

@author: <NAME>
@copyright: Copyright (C) 2011 <NAME>
@license: Modified BSD License
"""

from functools import partial


def create_matrixexponential(description):
    """Returns the requested matrix exponential routine.

    :param description: A :py:class:`ParameterProvider` instance containing at least the
                       key ``matrix_exponential`` and depending on its values more keys.
    """
    method = description["matrix_exponential"]

    if method == "pade":
        from MatrixExponential import matrix_exp_pade
        return matrix_exp_pade
    elif method == "arnoldi":
        from MatrixExponential import matrix_exp_arnoldi
        try:
            arnoldi_steps = description["arnoldi_steps"]
        except:
            arnoldi_steps = description["arnoldi_steps"]
        return partial(matrix_exp_arnoldi, k=arnoldi_steps)
    else:
        raise ValueError("Unknown matrix exponential algorithm")
{'fraction_non_alphanumeric': 0.0755656108597285, 'fraction_numerical': 0.0036199095022624436, 'mean_word_length': 3.615866388308977, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5890751', 'n_tokens_mistral': 585, 'n_tokens_neox': 552, 'n_words': 183}