scikit-base 0.7.5__tar.gz → 0.7.7__tar.gz
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.
- {scikit-base-0.7.5/scikit_base.egg-info → scikit_base-0.7.7}/PKG-INFO +4 -3
- {scikit-base-0.7.5 → scikit_base-0.7.7}/README.md +3 -2
- {scikit-base-0.7.5 → scikit_base-0.7.7}/pyproject.toml +1 -1
- {scikit-base-0.7.5 → scikit_base-0.7.7/scikit_base.egg-info}/PKG-INFO +4 -3
- {scikit-base-0.7.5 → scikit_base-0.7.7}/scikit_base.egg-info/SOURCES.txt +2 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/scikit_base.egg-info/top_level.txt +1 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/__init__.py +1 -1
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/base/_pretty_printing/_object_html_repr.py +17 -15
- scikit_base-0.7.7/skbase/base/_pretty_printing/tests/__init__.py +2 -0
- scikit_base-0.7.7/skbase/base/_pretty_printing/tests/test_pprint.py +26 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/testing/utils/inspect.py +1 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/utils/deep_equals/_deep_equals.py +13 -2
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/utils/tests/test_deep_equals.py +9 -2
- {scikit-base-0.7.5 → scikit_base-0.7.7}/LICENSE +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/docs/source/conf.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/scikit_base.egg-info/dependency_links.txt +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/scikit_base.egg-info/requires.txt +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/scikit_base.egg-info/zip-safe +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/setup.cfg +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/_exceptions.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/_nopytest_tests.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/base/__init__.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/base/_base.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/base/_meta.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/base/_pretty_printing/__init__.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/base/_pretty_printing/_pprint.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/base/_tagmanager.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/lookup/__init__.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/lookup/_lookup.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/lookup/tests/__init__.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/lookup/tests/test_lookup.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/testing/__init__.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/testing/test_all_objects.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/testing/utils/__init__.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/testing/utils/_conditional_fixtures.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/tests/__init__.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/tests/conftest.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/tests/mock_package/__init__.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/tests/mock_package/test_mock_package.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/tests/test_base.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/tests/test_baseestimator.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/tests/test_exceptions.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/tests/test_meta.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/utils/__init__.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/utils/_check.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/utils/_iter.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/utils/_nested_iter.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/utils/_utils.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/utils/deep_equals/__init__.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/utils/deep_equals/_common.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/utils/dependencies/__init__.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/utils/dependencies/_dependencies.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/utils/dependencies/tests/__init__.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/utils/dependencies/tests/test_check_dependencies.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/utils/random_state.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/utils/tests/__init__.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/utils/tests/test_check.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/utils/tests/test_iter.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/utils/tests/test_nested_iter.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/utils/tests/test_random_state.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/utils/tests/test_utils.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/validate/__init__.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/validate/_named_objects.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/validate/_types.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/validate/tests/__init__.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/validate/tests/test_iterable_named_objects.py +0 -0
- {scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/validate/tests/test_type_validations.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: scikit-base
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.7
|
4
4
|
Summary: Base classes for sklearn-like parametric objects
|
5
5
|
Author-email: sktime developers <sktime.toolbox@gmail.com>
|
6
6
|
Maintainer: Franz Király
|
@@ -114,14 +114,15 @@ Requires-Dist: scikit-learn>=0.24.0; extra == "test"
|
|
114
114
|
`skbase` provides base classes for creating scikit-learn-like parametric objects,
|
115
115
|
along with tools to make it easier to build your own packages that follow these design patterns.
|
116
116
|
|
117
|
-
:rocket: Version 0.7.
|
117
|
+
:rocket: Version 0.7.7 is now available. Check out our
|
118
118
|
[release notes](https://skbase.readthedocs.io/en/latest/changelog.html).
|
119
119
|
|
120
120
|
| Overview | |
|
121
121
|
|---|---|
|
122
122
|
| **CI/CD** | [](https://github.com/sktime/skbase/actions/workflows/test.yml) [](https://codecov.io/gh/sktime/skbase) [](https://skbase.readthedocs.io/en/latest/?badge=latest) [](https://results.pre-commit.ci/latest/github/sktime/skbase/main) |
|
123
123
|
| **Code** | [](https://pypi.org/project/scikit-base/) [](https://www.python.org/) [](https://github.com/psf/black) [](https://github.com/PyCQA/bandit) |
|
124
|
-
| **Downloads
|
124
|
+
| **Downloads** | [)](https://pepy.tech/project/scikit-base) [)](https://pepy.tech/project/scikit-base) [)](https://pepy.tech/project/scikit-base) |
|
125
|
+
| **Citation** | [](https://zenodo.org/doi/10.5281/zenodo.10980557) |
|
125
126
|
|
126
127
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
127
128
|
[](#contributors)
|
@@ -7,14 +7,15 @@
|
|
7
7
|
`skbase` provides base classes for creating scikit-learn-like parametric objects,
|
8
8
|
along with tools to make it easier to build your own packages that follow these design patterns.
|
9
9
|
|
10
|
-
:rocket: Version 0.7.
|
10
|
+
:rocket: Version 0.7.7 is now available. Check out our
|
11
11
|
[release notes](https://skbase.readthedocs.io/en/latest/changelog.html).
|
12
12
|
|
13
13
|
| Overview | |
|
14
14
|
|---|---|
|
15
15
|
| **CI/CD** | [](https://github.com/sktime/skbase/actions/workflows/test.yml) [](https://codecov.io/gh/sktime/skbase) [](https://skbase.readthedocs.io/en/latest/?badge=latest) [](https://results.pre-commit.ci/latest/github/sktime/skbase/main) |
|
16
16
|
| **Code** | [](https://pypi.org/project/scikit-base/) [](https://www.python.org/) [](https://github.com/psf/black) [](https://github.com/PyCQA/bandit) |
|
17
|
-
| **Downloads
|
17
|
+
| **Downloads** | [)](https://pepy.tech/project/scikit-base) [)](https://pepy.tech/project/scikit-base) [)](https://pepy.tech/project/scikit-base) |
|
18
|
+
| **Citation** | [](https://zenodo.org/doi/10.5281/zenodo.10980557) |
|
18
19
|
|
19
20
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
20
21
|
[](#contributors)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: scikit-base
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.7
|
4
4
|
Summary: Base classes for sklearn-like parametric objects
|
5
5
|
Author-email: sktime developers <sktime.toolbox@gmail.com>
|
6
6
|
Maintainer: Franz Király
|
@@ -114,14 +114,15 @@ Requires-Dist: scikit-learn>=0.24.0; extra == "test"
|
|
114
114
|
`skbase` provides base classes for creating scikit-learn-like parametric objects,
|
115
115
|
along with tools to make it easier to build your own packages that follow these design patterns.
|
116
116
|
|
117
|
-
:rocket: Version 0.7.
|
117
|
+
:rocket: Version 0.7.7 is now available. Check out our
|
118
118
|
[release notes](https://skbase.readthedocs.io/en/latest/changelog.html).
|
119
119
|
|
120
120
|
| Overview | |
|
121
121
|
|---|---|
|
122
122
|
| **CI/CD** | [](https://github.com/sktime/skbase/actions/workflows/test.yml) [](https://codecov.io/gh/sktime/skbase) [](https://skbase.readthedocs.io/en/latest/?badge=latest) [](https://results.pre-commit.ci/latest/github/sktime/skbase/main) |
|
123
123
|
| **Code** | [](https://pypi.org/project/scikit-base/) [](https://www.python.org/) [](https://github.com/psf/black) [](https://github.com/PyCQA/bandit) |
|
124
|
-
| **Downloads
|
124
|
+
| **Downloads** | [)](https://pepy.tech/project/scikit-base) [)](https://pepy.tech/project/scikit-base) [)](https://pepy.tech/project/scikit-base) |
|
125
|
+
| **Citation** | [](https://zenodo.org/doi/10.5281/zenodo.10980557) |
|
125
126
|
|
126
127
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
127
128
|
[](#contributors)
|
@@ -19,6 +19,8 @@ skbase/base/_tagmanager.py
|
|
19
19
|
skbase/base/_pretty_printing/__init__.py
|
20
20
|
skbase/base/_pretty_printing/_object_html_repr.py
|
21
21
|
skbase/base/_pretty_printing/_pprint.py
|
22
|
+
skbase/base/_pretty_printing/tests/__init__.py
|
23
|
+
skbase/base/_pretty_printing/tests/test_pprint.py
|
22
24
|
skbase/lookup/__init__.py
|
23
25
|
skbase/lookup/_lookup.py
|
24
26
|
skbase/lookup/tests/__init__.py
|
@@ -22,35 +22,37 @@ class _VisualBlock:
|
|
22
22
|
kind : {'serial', 'parallel', 'single'}
|
23
23
|
kind of HTML block
|
24
24
|
|
25
|
-
|
26
|
-
If kind != 'single'
|
27
|
-
|
25
|
+
estimators : list of ``BaseObject``s or ``_VisualBlock`s or a single ``BaseObject``
|
26
|
+
If ``kind != 'single'``, then ``estimators`` is a list of ``BaseObjects``.
|
27
|
+
If ``kind == 'single'``, then ``estimators`` is a single ``BaseObject``.
|
28
28
|
|
29
29
|
names : list of str, default=None
|
30
|
-
If kind != 'single'
|
31
|
-
If kind == 'single'
|
32
|
-
the single BaseObject
|
30
|
+
If ``kind != 'single'``, then ``names`` corresponds to ``BaseObjects``.
|
31
|
+
If ``kind == 'single'``, then ``names`` is a single string corresponding to
|
32
|
+
the single ``BaseObject``.
|
33
33
|
|
34
34
|
name_details : list of str, str, or None, default=None
|
35
|
-
If kind != 'single'
|
36
|
-
If kind == 'single'
|
37
|
-
corresponding to the single BaseObject
|
35
|
+
If ``kind != 'single'``, then ``name_details`` corresponds to ``names``.
|
36
|
+
If ``kind == 'single'``, then ``name_details`` is a single string
|
37
|
+
corresponding to the single ``BaseObject``.
|
38
38
|
|
39
39
|
dash_wrapped : bool, default=True
|
40
40
|
If true, wrapped HTML element will be wrapped with a dashed border.
|
41
|
-
Only active when kind != 'single'
|
41
|
+
Only active when ``kind != 'single'``.
|
42
42
|
"""
|
43
43
|
|
44
|
-
def __init__(
|
44
|
+
def __init__(
|
45
|
+
self, kind, estimators, *, names=None, name_details=None, dash_wrapped=True
|
46
|
+
):
|
45
47
|
self.kind = kind
|
46
|
-
self.
|
48
|
+
self.estimators = estimators
|
47
49
|
self.dash_wrapped = dash_wrapped
|
48
50
|
|
49
51
|
if self.kind in ("parallel", "serial"):
|
50
52
|
if names is None:
|
51
|
-
names = (None,) * len(
|
53
|
+
names = (None,) * len(estimators)
|
52
54
|
if name_details is None:
|
53
|
-
name_details = (None,) * len(
|
55
|
+
name_details = (None,) * len(estimators)
|
54
56
|
|
55
57
|
self.names = names
|
56
58
|
self.name_details = name_details
|
@@ -135,7 +137,7 @@ def _write_base_object_html(
|
|
135
137
|
|
136
138
|
kind = est_block.kind
|
137
139
|
out.write(f'<div class="sk-{kind}">')
|
138
|
-
est_infos = zip(est_block.
|
140
|
+
est_infos = zip(est_block.estimators, est_block.names, est_block.name_details)
|
139
141
|
|
140
142
|
for est, name, name_details in est_infos:
|
141
143
|
if kind == "serial":
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
# copyright: skbase developers, BSD-3-Clause License (see LICENSE file)
|
3
|
+
"""Tests for skbase pretty printing functionality."""
|
4
|
+
|
5
|
+
from skbase.base import BaseObject
|
6
|
+
|
7
|
+
|
8
|
+
class CompositionDummy(BaseObject):
|
9
|
+
"""Potentially composite object, for testing."""
|
10
|
+
|
11
|
+
def __init__(self, foo, bar=84):
|
12
|
+
self.foo = foo
|
13
|
+
self.bar = bar
|
14
|
+
|
15
|
+
super(CompositionDummy, self).__init__()
|
16
|
+
|
17
|
+
|
18
|
+
def test_sklearn_compatibility():
|
19
|
+
"""Test that the pretty printing functions are compatible with sklearn."""
|
20
|
+
from sklearn.ensemble import RandomForestRegressor
|
21
|
+
from sklearn.pipeline import make_pipeline
|
22
|
+
|
23
|
+
regressor = make_pipeline(
|
24
|
+
RandomForestRegressor(),
|
25
|
+
)
|
26
|
+
CompositionDummy(regressor)
|
@@ -122,7 +122,7 @@ def _coerce_list(x):
|
|
122
122
|
return x
|
123
123
|
|
124
124
|
|
125
|
-
def _numpy_equals_plugin(x, y, return_msg=False):
|
125
|
+
def _numpy_equals_plugin(x, y, return_msg=False, deep_equals=None):
|
126
126
|
numpy_available = _softdep_available("numpy")
|
127
127
|
|
128
128
|
if not numpy_available or not _is_npndarray(x):
|
@@ -132,10 +132,21 @@ def _numpy_equals_plugin(x, y, return_msg=False):
|
|
132
132
|
|
133
133
|
ret = _make_ret(return_msg)
|
134
134
|
|
135
|
+
if x.ndim != y.ndim:
|
136
|
+
return ret(False, f".ndim, x.ndim = {x.ndim} != y.ndim = {y.ndim}")
|
137
|
+
if x.shape != y.shape:
|
138
|
+
return ret(False, f".shape, x.shape = {x.shape} != y.shape = {y.shape}")
|
135
139
|
if x.dtype != y.dtype:
|
136
140
|
return ret(False, f".dtype, x.dtype = {x.dtype} != y.dtype = {y.dtype}")
|
137
|
-
if x.dtype
|
141
|
+
if x.dtype == "str":
|
138
142
|
return ret(np.array_equal(x, y), ".values")
|
143
|
+
elif x.dtype == "object":
|
144
|
+
x_flat = x.flatten()
|
145
|
+
y_flat = y.flatten()
|
146
|
+
for i in range(len(x_flat)):
|
147
|
+
is_equal, msg = deep_equals(x_flat[i], y_flat[i], return_msg=True)
|
148
|
+
return ret(is_equal, f"[{i}]" + msg)
|
149
|
+
return ret(True, "") # catches len(x_flat) == 0
|
139
150
|
else:
|
140
151
|
return ret(np.array_equal(x, y, equal_nan=True), ".values")
|
141
152
|
|
@@ -35,6 +35,13 @@ if _check_soft_dependencies("numpy", severity="none"):
|
|
35
35
|
np.array([0.2, 1, 4], dtype="object"),
|
36
36
|
]
|
37
37
|
|
38
|
+
# test cases with nested numpy arrays
|
39
|
+
a = np.array(["a", "b"], dtype="object")
|
40
|
+
a[0] = np.array([1, 2, 3])
|
41
|
+
b = np.array(["a", "b", 42], dtype="object")
|
42
|
+
b[1] = a
|
43
|
+
EXAMPLES += [a, b]
|
44
|
+
|
38
45
|
if _check_soft_dependencies("pandas", severity="none"):
|
39
46
|
import pandas as pd
|
40
47
|
|
@@ -80,7 +87,7 @@ def test_deep_equals_positive(fixture):
|
|
80
87
|
y = copy_except_if_sklearn(fixture)
|
81
88
|
|
82
89
|
msg = (
|
83
|
-
f"
|
90
|
+
f"deep_equals incorrectly returned False for two identical copies of "
|
84
91
|
f"the following object: {x}"
|
85
92
|
)
|
86
93
|
assert deep_equals(x, y), msg
|
@@ -99,7 +106,7 @@ def test_deep_equals_negative(fixture1, fixture2):
|
|
99
106
|
y = copy_except_if_sklearn(fixture2)
|
100
107
|
|
101
108
|
msg = (
|
102
|
-
f"
|
109
|
+
f"deep_equals incorrectly returned True when comparing "
|
103
110
|
f"the following, different objects: x={x}, y={y}"
|
104
111
|
)
|
105
112
|
assert not deep_equals(x, y), msg
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/utils/dependencies/tests/test_check_dependencies.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{scikit-base-0.7.5 → scikit_base-0.7.7}/skbase/validate/tests/test_iterable_named_objects.py
RENAMED
File without changes
|
File without changes
|