def METHOD_NAME(val):
    """Convert a unit quantity to a hashable value."""
    if isinstance(val, u.unyt_quantity):
        return val.value * conversion_factor(val.units)
    else:
        return None