Skip to content

Errors

evalica.InsufficientRatingsError

Bases: ValueError

Raised when no units have at least 2 ratings.

Source code in evalica/__init__.py
53
54
55
56
57
58
class InsufficientRatingsError(ValueError):
    """Raised when no units have at least 2 ratings."""

    def __init__(self) -> None:
        """Create and return a new object."""
        super().__init__("No units have at least 2 ratings.")

__init__()

Create and return a new object.

Source code in evalica/__init__.py
56
57
58
def __init__(self) -> None:
    """Create and return a new object."""
    super().__init__("No units have at least 2 ratings.")

evalica.LengthMismatchError

Bases: ValueError

The dataset dimensions mismatched.

Source code in evalica/__init__.py
35
36
class LengthMismatchError(ValueError):
    """The dataset dimensions mismatched."""

evalica.ScoreDimensionError

Bases: ValueError

Inappropriate dimension given; it should be 1D.

Source code in evalica/__init__.py
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
class ScoreDimensionError(ValueError):
    """Inappropriate dimension given; it should be 1D."""

    def __init__(self, ndim: int) -> None:
        """
        Create and return a new object.

        Args:
            ndim: The given number of dimensions.

        """
        super().__init__(f"scores should be one-dimensional, {ndim} was provided")

__init__(ndim)

Create and return a new object.

Parameters:

Name Type Description Default
ndim int

The given number of dimensions.

required
Source code in evalica/__init__.py
1197
1198
1199
1200
1201
1202
1203
1204
1205
def __init__(self, ndim: int) -> None:
    """
    Create and return a new object.

    Args:
        ndim: The given number of dimensions.

    """
    super().__init__(f"scores should be one-dimensional, {ndim} was provided")

evalica.SolverError

Bases: RuntimeError

The requested solver is not available.

Source code in evalica/__init__.py
39
40
41
42
43
44
45
46
47
48
49
50
class SolverError(RuntimeError):
    """The requested solver is not available."""

    def __init__(self, solver: str) -> None:
        """
        Create and return a new object.

        Args:
            solver: The solver name.

        """
        super().__init__(f"The '{solver}' solver is not available")

__init__(solver)

Create and return a new object.

Parameters:

Name Type Description Default
solver str

The solver name.

required
Source code in evalica/__init__.py
42
43
44
45
46
47
48
49
50
def __init__(self, solver: str) -> None:
    """
    Create and return a new object.

    Args:
        solver: The solver name.

    """
    super().__init__(f"The '{solver}' solver is not available")

evalica.RustExtensionWarning

Bases: RuntimeWarning

The Rust extension could not be imported.

Source code in evalica/__init__.py
75
76
class RustExtensionWarning(RuntimeWarning):
    """The Rust extension could not be imported."""

evalica.UnknownDistanceError

Bases: ValueError

Raised when an unknown distance metric is specified.

Source code in evalica/__init__.py
61
62
63
64
65
66
67
68
69
70
71
72
class UnknownDistanceError(ValueError):
    """Raised when an unknown distance metric is specified."""

    def __init__(self, distance: str) -> None:
        """
        Create and return a new object.

        Args:
            distance: The distance metric name.

        """
        super().__init__(f"Unknown distance '{distance}'")

__init__(distance)

Create and return a new object.

Parameters:

Name Type Description Default
distance str

The distance metric name.

required
Source code in evalica/__init__.py
64
65
66
67
68
69
70
71
72
def __init__(self, distance: str) -> None:
    """
    Create and return a new object.

    Args:
        distance: The distance metric name.

    """
    super().__init__(f"Unknown distance '{distance}'")