Source code for logitorch.datasets.exceptions

from typing import List


[docs] class DatasetNameError(Exception): """ An error is raised when the dataset name is wrong """ def __init__(self):
[docs] self.message = "DatasetNameError: Dataset name is wrong"
[docs] class SplitSetError(Exception): """ An error is raised when the split set is wrong """ def __init__(self, split_sets: List[str]):
[docs] self.message = ( f"SplitSetError: Dataset name is wrong\nThe split sets are: {split_sets}" )
[docs] class FileSizeError(Exception): """ An error is raised when the downloaded dataset has a wrong size """ def __init__(self):
[docs] self.message = "FileSizeError: Wrong file size"
[docs] class TaskError(Exception): """ An error is raised when the task is wrong """ def __init__(self):
[docs] self.message = "TaskError: Task is not found\n"
[docs] class AbductionClosedWorldAssumptionError(Exception): """ An error is raised when the abduction task is chosen in a closed-world assumption setting """ def __init__(self):
[docs] self.message = "AbductionClosedWolrdAssumptionError: Abduction task exists only in open-world assumption (OWA) setting"