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.
- docs/source/conf.py +299 -0
- scikit_base-0.3.0.dist-info/LICENSE +29 -0
- scikit_base-0.3.0.dist-info/METADATA +157 -0
- scikit_base-0.3.0.dist-info/RECORD +37 -0
- scikit_base-0.3.0.dist-info/WHEEL +5 -0
- scikit_base-0.3.0.dist-info/top_level.txt +2 -0
- scikit_base-0.3.0.dist-info/zip-safe +1 -0
- skbase/__init__.py +14 -0
- skbase/_exceptions.py +31 -0
- skbase/base/__init__.py +19 -0
- skbase/base/_base.py +981 -0
- skbase/base/_meta.py +591 -0
- skbase/lookup/__init__.py +31 -0
- skbase/lookup/_lookup.py +1005 -0
- skbase/lookup/tests/__init__.py +2 -0
- skbase/lookup/tests/test_lookup.py +991 -0
- skbase/testing/__init__.py +12 -0
- skbase/testing/test_all_objects.py +796 -0
- skbase/testing/utils/__init__.py +5 -0
- skbase/testing/utils/_conditional_fixtures.py +202 -0
- skbase/testing/utils/_dependencies.py +254 -0
- skbase/testing/utils/deep_equals.py +337 -0
- skbase/testing/utils/inspect.py +30 -0
- skbase/testing/utils/tests/__init__.py +2 -0
- skbase/testing/utils/tests/test_check_dependencies.py +49 -0
- skbase/testing/utils/tests/test_deep_equals.py +63 -0
- skbase/tests/__init__.py +2 -0
- skbase/tests/conftest.py +178 -0
- skbase/tests/mock_package/__init__.py +5 -0
- skbase/tests/mock_package/test_mock_package.py +74 -0
- skbase/tests/test_base.py +1069 -0
- skbase/tests/test_baseestimator.py +126 -0
- skbase/tests/test_exceptions.py +23 -0
- skbase/utils/__init__.py +10 -0
- skbase/utils/_nested_iter.py +95 -0
- skbase/validate/__init__.py +8 -0
- skbase/validate/_types.py +106 -0
@@ -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
|
+
]
|