SPPAS 4.22

https://sppas.org/

Module sppas.src.structs

Class sppasBaseCompare

Description

Base class for comparisons.

Constructor

Constructor of a sppasBaseCompare.

View Source
def __init__(self):
    """Constructor of a sppasBaseCompare."""
    self.methods = dict()

Public functions

get

Return the function of the given name.

Parameters
  • name: (str) Simple name of a method of this class
View Source
def get(self, name):
    """Return the function of the given name.

        :param name: (str) Simple name of a method of this class

        """
    if name in self.methods:
        return self.methods[name]
    raise sppasValueError(name, 'function name')

get_function_names

Return the list of comparison functions.

View Source
def get_function_names(self):
    """Return the list of comparison functions."""
    return list(self.methods.keys())