Skip to content

Abstract Base Classes

nplinker.scoring.abc

ScoringBase

Bases: ABC

Abstract base class of scoring methods.

Attributes:

  • name (str) –

    The name of the scoring method.

  • npl (NPLinker | None) –

    The NPLinker object.

name class-attribute instance-attribute

name: str = 'ScoringBase'

npl class-attribute instance-attribute

npl: NPLinker | None = None

setup abstractmethod classmethod

setup(npl: NPLinker)

Setup class level attributes.

Source code in src/nplinker/scoring/abc.py
@classmethod
@abstractmethod
def setup(cls, npl: NPLinker):
    """Setup class level attributes."""
get_links(*objects, **parameters) -> LinkGraph

Get links information for the given objects.

Parameters:

  • objects

    A list of objects to get links for.

  • parameters

    The parameters used for scoring.

Returns:

Source code in src/nplinker/scoring/abc.py
@abstractmethod
def get_links(
    self,
    *objects,
    **parameters,
) -> LinkGraph:
    """Get links information for the given objects.

    Args:
        objects: A list of objects to get links for.
        parameters: The parameters used for scoring.

    Returns:
        The LinkGraph object.
    """