Allow specifying distance metric from arguments