# Path: flyingpigeon/dissimilarity.py
# def reshape_sample(x, y):
# def standardize(x, y):
# def seuclidean(x, y):
# def nearest_neighbor(x, y):
# def zech_aslan(x, y):
# def skezely_rizzo(x, y):
# def friedman_rafsky(x, y):
# def kolmogorov_smirnov(x, y):
#     def pivot(x, y):
# def kldiv(x, y, k=1):


from flyingpigeon import dissimilarity as dd
from ocgis.util.helpers import iter_array
from ocgis.calc.base import AbstractParameterizedFunction, AbstractFieldFunction
from ocgis.collection.field import Field
from ocgis.constants import NAME_DIMENSION_TEMPORAL
import numpy as np
    distributions.
    """
    key = 'dissimilarity'
    long_name = 'Dissimilarity metric comparing two samples'
    standard_name = 'dissimilarity_metric'
    description = 'Metric evaluating the dissimilarity between two ' \
                  'multivariate samples'
    parms_definition = {'dist': str, 'target': Field, 'candidate': tuple}
    required_variables = ['candidate', 'target']
    _potential_dist = metrics

    def calculate(self, target=None, candidate=None, dist='seuclidean'):
        """

        Parameters
        ----------
        target : ocgis Field
            The target distribution the different candidates are compared
            to.
        candidate : tuple
            Sequence of variable names identifying climate indices on which
            the comparison will be performed.
        dist : {'seuclidean', 'nearest_neighbor', 'zech_aslan',
           'kolmogorov_smirnov', 'friedman_rafsky', 'kldiv'}
            Name of the distance measure, or dissimilarity metric.
        """
        if dist not in self._potential_dist:
            raise ValueError("`dist` should be one of {}".format(self._potential_dist))

        # Get the function from the module.

# Path: flyingpigeon/dissimilarity.py
# def reshape_sample(x, y):
# def standardize(x, y):
# def seuclidean(x, y):
# def nearest_neighbor(x, y):
# def zech_aslan(x, y):
# def skezely_rizzo(x, y):
# def friedman_rafsky(x, y):
# def kolmogorov_smirnov(x, y):
#     def pivot(x, y):
# def kldiv(x, y, k=1):


# Path: flyingpigeon/ocgisDissimilarity.py
from flyingpigeon import dissimilarity as dd
from ocgis.util.helpers import iter_array
from ocgis.calc.base import AbstractParameterizedFunction, AbstractFieldFunction
from ocgis.collection.field import Field
from ocgis.constants import NAME_DIMENSION_TEMPORAL
import numpy as np

    distributions.
    """
    key = 'dissimilarity'
    long_name = 'Dissimilarity metric comparing two samples'
    standard_name = 'dissimilarity_metric'
    description = 'Metric evaluating the dissimilarity between two ' \
                  'multivariate samples'
    parms_definition = {'dist': str, 'target': Field, 'candidate': tuple}
    required_variables = ['candidate', 'target']
    _potential_dist = metrics

    def calculate(self, target=None, candidate=None, dist='seuclidean'):
        """

        Parameters
        ----------
        target : ocgis Field
            The target distribution the different candidates are compared
            to.
        candidate : tuple
            Sequence of variable names identifying climate indices on which
            the comparison will be performed.
        dist : {'seuclidean', 'nearest_neighbor', 'zech_aslan',
           'kolmogorov_smirnov', 'friedman_rafsky', 'kldiv'}
            Name of the distance measure, or dissimilarity metric.
        """
        if dist not in self._potential_dist:
            raise ValueError("`dist` should be one of {}".format(self._potential_dist))

        # Get the function from the module.

        metric = getattr(dd, dist)