AbstractDiffer
Bases: ABC
Source code in library_analyzer/processing/migration/model/_differ.py
apiv1: API
class-attribute
¶
apiv2: API
class-attribute
¶
previous_base_differ: Optional[AbstractDiffer]
class-attribute
¶
previous_mappings: list[Mapping]
class-attribute
¶
compute_attribute_similarity(attributev1, attributev2)
abstractmethod
¶
Computes similarity between attributes from apiv1 and apiv2. :param attributev1: attribute from apiv1 :param attributev2: attribute from apiv2 :return: value between 0 and 1, where 1 means that the elements are equal
Source code in library_analyzer/processing/migration/model/_differ.py
compute_class_similarity(classv1, classv2)
abstractmethod
¶
Computes similarity between classes from apiv1 and apiv2. :param classv1: class from apiv1 :param classv2: class from apiv2 :return: value between 0 and 1, where 1 means that the elements are equal
Source code in library_analyzer/processing/migration/model/_differ.py
compute_function_similarity(functionv1, functionv2)
abstractmethod
¶
Computes similarity between functions from apiv1 and apiv2. :param functionv1: function from apiv1 :param functionv2: function from apiv2 :return: value between 0 and 1, where 1 means that the elements are equal
Source code in library_analyzer/processing/migration/model/_differ.py
compute_parameter_similarity(parameterv1, parameterv2)
abstractmethod
¶
Computes similarity between parameters from apiv1 and apiv2. :param parameterv1: parameter from apiv1 :param parameterv2: parameter from apiv2 :return: value between 0 and 1, where 1 means that the elements are equal
Source code in library_analyzer/processing/migration/model/_differ.py
compute_result_similarity(resultv1, resultv2)
abstractmethod
¶
Computes similarity between results from apiv1 and apiv2. :param resultv1: result from apiv1 :param resultv2: result from apiv2 :return: value between 0 and 1, where 1 means that the elements are equal
Source code in library_analyzer/processing/migration/model/_differ.py
get_additional_mappings()
abstractmethod
¶
This method allows the differ to add further mappings from previous differs :return: additional mappings that should be included in the result of the differentiation
Source code in library_analyzer/processing/migration/model/_differ.py
get_related_mappings()
abstractmethod
¶
Indicates whether all api elements should be compared with each other or just the ones that are mapped to each other. :return: a list of Mappings if only previously mapped api elements should be mapped to each other or else None.
Source code in library_analyzer/processing/migration/model/_differ.py
notify_new_mapping(mappings)
abstractmethod
¶
If previous mappings returns None, the differ will be notified about a new mapping. Thereby the differ can calculate the similarity with more information. :param mappings: a list of mappings new appended mappings.