class_docstr: Abstract class to define a numba compatible distance metric.
class_docstr_tok: ["Abstract","class","to","define","a","numba","compatible","distance","metric","."]
docstr: Create a no_python distance.
  
  This method will validate the kwargs and ensure x and y are in the correct
  format and then return a no_python compiled distance that uses the kwargs.
  
  The no_python compiled distance will be in the form:
  Callable[[np.ndarray, np.ndarray], float]. #
  
  This can then be used to to calculate distances efficiently or can be used
  inside other no_python functions.
  
  Parameters
  ----------
  x: np.ndarray (2d array)
      First time series
  y: np.ndarray (2d array)
      Second time series
  kwargs: kwargs
      kwargs for the given distance metric
  
  Returns
  -------
  Callable[[np.ndarray, np.ndarray], float]
      Callable where two, numpy 2d arrays are taken as parameters (x and y),
      a float is then returned that represents the distance between x and y.
      This callable will be no_python compiled.
  
  Raises
  ------
  ValueError
      If x or y is not a numpy array.
      If x or y has less than or greater than 2 dimensions.
  RuntimeError
      If the distance metric could not be compiled to no_python.
docstr_tok: ["Create","a","no_python","distance",".","This","method","will","validate","the","kwargs","and","ensure","x","and","y","are","in","the","correct","format","and","then","return","a","no_python","compiled","distance","that","uses","the","kwargs",".","The","no_python","compiled","distance","will","be","in","the","form",":","Callable","[","[","np.ndarray",",","np.ndarray","]",",","float","]",".","#","This","can","then","be","used","to","to","calculate","distances","efficiently","or","can","be","used","inside","other","no_python","functions",".","Parameters","--","--","--","--","--","x",":","np.ndarray","(","2d","array",")","First","time","series","y",":","np.ndarray","(","2d","array",")","Second","time","series","kwargs",":","kwargs","kwargs","for","the","given","distance","metric","Returns","--","--","--","-","Callable","[","[","np.ndarray",",","np.ndarray","]",",","float","]","Callable","where","two",",","numpy","2d","arrays","are","taken","as","parameters","(","x","and","y",")",",","a","float","is","then","returned","that","represents","the","distance","between","x","and","y",".","This","callable","will","be","no_python","compiled",".","Raises","--","--","--","ValueError","If","x","or","y","is","not","a","numpy","array",".","If","x","or","y","has","less","than","or","greater","than","2","dimensions",".","RuntimeError","If","the","distance","metric","could","not","be","compiled","to","no_python","."]
code: def distance_factory(
      self, x: np.ndarray, y: np.ndarray, **kwargs: dict
  ) -> DistanceCallable:
      """Create a no_python distance.
  
      This method will validate the kwargs and ensure x and y are in the correct
      format and then return a no_python compiled distance that uses the kwargs.
  
      The no_python compiled distance will be in the form:
      Callable[[np.ndarray, np.ndarray], float]. #
  
      This can then be used to to calculate distances efficiently or can be used
      inside other no_python functions.
  
      Parameters
      ----------
      x: np.ndarray (2d array)
          First time series
      y: np.ndarray (2d array)
          Second time series
      kwargs: kwargs
          kwargs for the given distance metric
  
      Returns
      -------
      Callable[[np.ndarray, np.ndarray], float]
          Callable where two, numpy 2d arrays are taken as parameters (x and y),
          a float is then returned that represents the distance between x and y.
          This callable will be no_python compiled.
  
      Raises
      ------
      ValueError
          If x or y is not a numpy array.
          If x or y has less than or greater than 2 dimensions.
      RuntimeError
          If the distance metric could not be compiled to no_python.
      """
      NumbaDistance._validate_factory_timeseries(x)
      NumbaDistance._validate_factory_timeseries(y)
  
      no_python_callable = self._distance_factory(x, y, **kwargs)
  
      return no_python_callable
  
file_path: sktime/sktime/distances/base/_base.py
imports: from abc import ABC, abstractmethod
  from typing import Callable, NamedTuple, Set
  import numpy
  from sktime.distances.base._types import AlignmentPathReturn, DistanceAlignmentPathCallable, DistanceCallable
label_desc: Use image node_id 3 for calling the NumbaDistance obj's underlying member method code with example usage: obj.distance_factory(x, y) and returns: no_python_callable