import re


def _property_tuple_to_string(property_type, substance_type):
    """Converts a tuple of a type of `PhysicalProperty` and a `SubstanceType`
    to a string which can be used as a title.

    Parameters
    ----------
    property_type: type of PhysicalProperty
        The type of physical property to include.
    substance_type: SubstanceType
    The type of substance to include.

    Returns
    -------
    str
        The formatted string.
    """

    property_name = " ".join(
        re.sub(
            "([A-Z][a-z]+)", r" \1", re.sub("([A-Z]+)", r" \1", property_type.__name__)
        ).split()
    )

    return f"{str(substance_type.value).title()} {property_name.title()}"