def totalTransformationEntropy(H_of_transformations, lower_temperature,
    upper_temperature):
    """
    Computes the total transformation entropy between two temperatures

    Parameters
    ----------
    H_of_transformations : dictionary or None or False
        If 'None' or 'False' then the function returs zero, as it is understood
        that no phase transition happens (or is known) for this substance. If
        this argument is a dictionary then each key of the dictionary must be
        an integer or float representing the temperature were the transition
        occurs (temperature is expected to be in Kelvin) and the value of each
        key must be the enthalpy of transformation during heating (expected to
        be in J/mol), represented as an integer or float. See notes for an
        example.

    lower_temperature : integer or float
        Lower temperature range (expected to be in Kelvin) to be considered for
        the calculation. If 'lower_temperature' is higher than
        'upper_temperature' the function raises a ValueError.

    upper_temperature : integer or float
        Upper temperature range (expected to be in Kelvin) to be considered for
        the calculation. If 'lower_temperature' is higher than
        'upper_temperature' the function raises a ValueError.

    Returns
    -------
    total_transformation_entropy : float
        Sum of all the transformation entropy that happens between
        'lower_temperature' and 'upper_temperature'.

    Notes
    -----
    See below an example of the dictionary format for 'H_of_transformation' for
    Silica (SiO2, see page 1505 in Ref. [1]).

    H_of_transformations_SiO2 = {
        847: 728.0,  # from low quartz to high quartz (J/mol)
        1079: 1995.8,  # from high quartz to high cristobalite (J/mol)
    }

    References
    ----------
    [1] Barin, I. (1995). Thermochemical data of pure substances.

    """
    total_transformation_entropy = 0
    if isinstance(H_of_transformations, dict):
        if lower_temperature > upper_temperature:
            raise ValueError(
                'lower_temperature is higher than upper_temperature')
        for temperature in H_of_transformations:
            if lower_temperature <= temperature <= upper_temperature:
                total_transformation_entropy += H_of_transformations[
                    temperature] / temperature
    return total_transformation_entropy
