pca-tools 0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pca_tools/__init__.py ADDED
File without changes
@@ -0,0 +1,39 @@
1
+ class NotDataFrameError(TypeError):
2
+ """
3
+ Exception raised when the input data is not a pandas DataFrame.
4
+ """
5
+ def __init__(self, input_type):
6
+ message = f"Data must be of type pandas DataFrame, not {input_type}."
7
+ super().__init__(message)
8
+
9
+ class ModelNotFittedError(ValueError):
10
+ """
11
+ Exception raised when attempting to use a model's method that requires the model to be fitted, but the model is not.
12
+ """
13
+ def __init__(self):
14
+ message = "The model has not been fitted yet. Please use the fit method before predicting."
15
+ super().__init__(message)
16
+
17
+ class NotAListError(TypeError):
18
+ """
19
+ Exception raised when the input data is not a list
20
+ """
21
+ def __init__(self, input_type):
22
+ message = f"Data must be of type list, not {input_type}"
23
+ super().__init__(message)
24
+
25
+ class NotBoolError(TypeError):
26
+ """
27
+ Exception raised when a boolean parameter receives a different type
28
+ """
29
+ def __init__(self):
30
+ message = f"Data must be of type bool"
31
+ super().__init__(message)
32
+
33
+ class NComponentsError(ValueError):
34
+ """
35
+ Exception raised when the number of components is invalid
36
+ """
37
+ def __init__(self, data_vars):
38
+ message = f'The number of components must be between 0 and {data_vars}'
39
+ super().__init__(message)