scikit-base 0.3.0__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.
@@ -0,0 +1,74 @@
1
+ # -*- coding: utf-8 -*-
2
+ """Mock package for testing skbase functionality."""
3
+ from copy import deepcopy
4
+ from typing import List
5
+
6
+ from skbase.base import BaseObject
7
+
8
+ __all__: List[str] = [
9
+ "CompositionDummy",
10
+ "InheritsFromBaseObject",
11
+ "AnotherClass",
12
+ "NotABaseObject",
13
+ ]
14
+ __author__: List[str] = ["fkiraly", "RNKuhns"]
15
+
16
+
17
+ class CompositionDummy(BaseObject):
18
+ """Potentially composite object, for testing."""
19
+
20
+ def __init__(self, foo, bar=84):
21
+ self.foo = foo
22
+ self.foo_ = deepcopy(foo)
23
+ self.bar = bar
24
+
25
+ super(CompositionDummy, self).__init__()
26
+
27
+ @classmethod
28
+ def get_test_params(cls, parameter_set="default"):
29
+ """Return testing parameter settings for the estimator.
30
+
31
+ Parameters
32
+ ----------
33
+ parameter_set : str, default="default"
34
+ Name of the set of test parameters to return, for use in tests. If no
35
+ special parameters are defined for a value, will return `"default"` set.
36
+
37
+ Returns
38
+ -------
39
+ params : dict or list of dict, default = {}
40
+ Parameters to create testing instances of the class
41
+ Each dict are parameters to construct an "interesting" test instance, i.e.,
42
+ `MyClass(**params)` or `MyClass(**params[i])` creates a valid test instance.
43
+ `create_test_instance` uses the first (or only) dictionary in `params`
44
+ """
45
+ params1 = {"foo": 42}
46
+ params2 = {"foo": CompositionDummy(126)}
47
+ return [params1, params2]
48
+
49
+
50
+ class InheritsFromBaseObject(BaseObject):
51
+ """A class inheriting from BaseObject."""
52
+
53
+
54
+ class AnotherClass(BaseObject):
55
+ """Another class inheritting from BaseObject."""
56
+
57
+
58
+ class NotABaseObject:
59
+ """A class that is not a BaseObject."""
60
+
61
+ def __init__(self, a=7):
62
+ self.a = a
63
+
64
+
65
+ class _NonPublicClass(BaseObject):
66
+ """A nonpublic class inheritting from BaseObject."""
67
+
68
+
69
+ MOCK_PACKAGE_OBJECTS = [
70
+ AnotherClass,
71
+ CompositionDummy,
72
+ InheritsFromBaseObject,
73
+ _NonPublicClass,
74
+ ]