scikit-base 0.12.3__py3-none-any.whl → 0.12.4__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.
- {scikit_base-0.12.3.dist-info → scikit_base-0.12.4.dist-info}/METADATA +3 -3
- {scikit_base-0.12.3.dist-info → scikit_base-0.12.4.dist-info}/RECORD +9 -9
- skbase/__init__.py +1 -1
- skbase/testing/test_all_objects.py +30 -11
- skbase/utils/dependencies/_dependencies.py +10 -7
- {scikit_base-0.12.3.dist-info → scikit_base-0.12.4.dist-info}/WHEEL +0 -0
- {scikit_base-0.12.3.dist-info → scikit_base-0.12.4.dist-info}/licenses/LICENSE +0 -0
- {scikit_base-0.12.3.dist-info → scikit_base-0.12.4.dist-info}/top_level.txt +0 -0
- {scikit_base-0.12.3.dist-info → scikit_base-0.12.4.dist-info}/zip-safe +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: scikit-base
|
3
|
-
Version: 0.12.
|
3
|
+
Version: 0.12.4
|
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
|
@@ -115,7 +115,7 @@ Dynamic: license-file
|
|
115
115
|
`skbase` provides base classes for creating scikit-learn-like parametric objects,
|
116
116
|
along with tools to make it easier to build your own packages that follow these design patterns.
|
117
117
|
|
118
|
-
:rocket: Version 0.12.
|
118
|
+
:rocket: Version 0.12.4 is now available. Check out our
|
119
119
|
[release notes](https://skbase.readthedocs.io/en/latest/changelog.html).
|
120
120
|
|
121
121
|
| Overview | |
|
@@ -140,7 +140,7 @@ To learn more about the package check out:
|
|
140
140
|
For trouble shooting or more information, see our
|
141
141
|
[detailed installation instructions](https://skbase.readthedocs.io/en/latest/user_documentation/installation.html).
|
142
142
|
|
143
|
-
- **Operating system**: macOS
|
143
|
+
- **Operating system**: macOS · Linux · Windows 8.1 or higher
|
144
144
|
- **Python version**: Python 3.9, 3.10, 3.11, 3.12, and 3.13
|
145
145
|
- **Package managers**: [pip]
|
146
146
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
docs/source/conf.py,sha256=kFc-4qkb0ZGD5cDej5KPJhMePp9kpVu6ZqFoF0fgovg,9951
|
2
|
-
scikit_base-0.12.
|
3
|
-
skbase/__init__.py,sha256=
|
2
|
+
scikit_base-0.12.4.dist-info/licenses/LICENSE,sha256=W2h8EYZ_G_mvCmCmXTTYqv66QF5NgSMbzLYJdk8qHVg,1525
|
3
|
+
skbase/__init__.py,sha256=SSuVEJ4jQKo2pbpPhWtofru43_qntvjHCgJDThnAYqI,346
|
4
4
|
skbase/_exceptions.py,sha256=asAhMbBeMwRBU_HDPFzwVCz8sb9_itG_6JVq3v_RZv8,1100
|
5
5
|
skbase/_nopytest_tests.py,sha256=NnFa4WPrjxUCcBvIlkCh7q-4WfMFVErSEPMK4OJPFtY,1078
|
6
6
|
skbase/base/__init__.py,sha256=5ZLlwJeyfKDA1lAylBJgZd3t5JY25xsgQB4waQnroa8,751
|
@@ -19,7 +19,7 @@ skbase/lookup/_lookup.py,sha256=FCEqbvPGEgm94IcGwY6EPEmpknnZTquDb5VInUPqj3A,4372
|
|
19
19
|
skbase/lookup/tests/__init__.py,sha256=MVqGlWsUV-gQ4qzW_TqE3UmKO9IQ9mwdDlsIHaGt3bc,68
|
20
20
|
skbase/lookup/tests/test_lookup.py,sha256=kAgsGyp4EYrXZnqezya-PI14m9mm8-ePoR0Wf-Cu-oo,39782
|
21
21
|
skbase/testing/__init__.py,sha256=OdwR-aEU2KzGrU-O0gtNSMNGmF2mtgBmjAnMzcgwe6w,351
|
22
|
-
skbase/testing/test_all_objects.py,sha256=
|
22
|
+
skbase/testing/test_all_objects.py,sha256=oorMT6FyPMl0TlUeBhdS13JS_udxwQS3TqivoPUXf0E,36866
|
23
23
|
skbase/testing/utils/__init__.py,sha256=kaLuqQwJsCunRWsUb1JwTVG-iqXbzdUobuYHNHsBlQQ,113
|
24
24
|
skbase/testing/utils/_conditional_fixtures.py,sha256=QwI7K28Lsy6RAkDP94goo8uWWvMzKKNOmXRFtc9RNtI,9890
|
25
25
|
skbase/testing/utils/inspect.py,sha256=e6F7AIuDhBTpgK8KKmiuwxeggrMjC7DHuSAKA1jOU2A,761
|
@@ -44,7 +44,7 @@ skbase/utils/deep_equals/__init__.py,sha256=1II3GWV1c1s43y62IidMiTjjyOnE9MFysQ5A
|
|
44
44
|
skbase/utils/deep_equals/_common.py,sha256=O0ODPJGwdq6G-KdeGoHgyote53tNcxu3y2jHvej3bdQ,1273
|
45
45
|
skbase/utils/deep_equals/_deep_equals.py,sha256=zKJx6xPUOHCYrqJh322TA9BW2c10gLgmbrHqKW6siqk,19225
|
46
46
|
skbase/utils/dependencies/__init__.py,sha256=cCUa_P-RiDs4pW6cw51uYeoBMaMa9iycwiFkwqkIizc,419
|
47
|
-
skbase/utils/dependencies/_dependencies.py,sha256=
|
47
|
+
skbase/utils/dependencies/_dependencies.py,sha256=Mndy1FSHDPWNwzbSr3U_XIJyqnj1Jof1JUZiimIA_tU,27944
|
48
48
|
skbase/utils/dependencies/_import.py,sha256=PoaZE6WiCTp-vuvrkrM6EO2wWvX6owanQ0uESFhqLtQ,802
|
49
49
|
skbase/utils/dependencies/tests/__init__.py,sha256=UqE6wenG-HffjT2Z974OLzmXG-M8PNOP9nUnNfqtfT4,74
|
50
50
|
skbase/utils/dependencies/tests/test_check_dependencies.py,sha256=IBErD_ejAqE16Y9GL_frLOoHzZz0UgVZueHGbKch1Sk,6933
|
@@ -62,8 +62,8 @@ skbase/validate/_types.py,sha256=riVEVlj8ipErZX07OVbzv6zdGKssfegHyMr8XwaBm6M,121
|
|
62
62
|
skbase/validate/tests/__init__.py,sha256=wunQBy6rajyrDymKvuFVajsBjj90VP5IFey5b6ZIRCk,70
|
63
63
|
skbase/validate/tests/test_iterable_named_objects.py,sha256=NaEwdmtQJJy4GXMSh9ULOaR4ua7R11BcE6Khz5RKWUk,7438
|
64
64
|
skbase/validate/tests/test_type_validations.py,sha256=oIysbDxRlbBMcCOrDMW6MM6VqhhMWJxNP6NO9Id9Q5g,14133
|
65
|
-
scikit_base-0.12.
|
66
|
-
scikit_base-0.12.
|
67
|
-
scikit_base-0.12.
|
68
|
-
scikit_base-0.12.
|
69
|
-
scikit_base-0.12.
|
65
|
+
scikit_base-0.12.4.dist-info/METADATA,sha256=r-rLOCSkS480DrIowNrIu33UBdVvGR62Le90PpGUPfM,8792
|
66
|
+
scikit_base-0.12.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
67
|
+
scikit_base-0.12.4.dist-info/top_level.txt,sha256=FbRMsZcP-O6pMLGZpxA5pQ-ClfRzoB6Yr-hTViYqwT0,57
|
68
|
+
scikit_base-0.12.4.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
69
|
+
scikit_base-0.12.4.dist-info/RECORD,,
|
skbase/__init__.py
CHANGED
@@ -12,6 +12,7 @@ from typing import List
|
|
12
12
|
|
13
13
|
import numpy as np
|
14
14
|
import pytest
|
15
|
+
from _pytest.outcomes import Skipped
|
15
16
|
|
16
17
|
from skbase.base import BaseObject
|
17
18
|
from skbase.lookup import all_objects
|
@@ -83,7 +84,7 @@ class BaseFixtureGenerator:
|
|
83
84
|
|
84
85
|
# list of tests to exclude
|
85
86
|
# expected type: dict of lists, key:str, value: List[str]
|
86
|
-
# keys are class names of
|
87
|
+
# keys are class names of objects, values are lists of test names to exclude
|
87
88
|
excluded_tests = None
|
88
89
|
|
89
90
|
# list of valid tags
|
@@ -226,7 +227,7 @@ class BaseFixtureGenerator:
|
|
226
227
|
@pytest.fixture(scope="function")
|
227
228
|
def object_instance(self, request):
|
228
229
|
"""object_instance fixture definition for indirect use."""
|
229
|
-
#
|
230
|
+
# object_instance is cloned at the start of every test
|
230
231
|
return request.param.clone()
|
231
232
|
|
232
233
|
|
@@ -241,6 +242,7 @@ class QuickTester:
|
|
241
242
|
fixtures_to_run=None,
|
242
243
|
tests_to_exclude=None,
|
243
244
|
fixtures_to_exclude=None,
|
245
|
+
verbose=False,
|
244
246
|
):
|
245
247
|
"""Run all tests on one single object.
|
246
248
|
|
@@ -256,24 +258,32 @@ class QuickTester:
|
|
256
258
|
Parameters
|
257
259
|
----------
|
258
260
|
obj : object class or object instance
|
261
|
+
|
259
262
|
raise_exceptions : bool, optional, default=False
|
260
263
|
whether to return exceptions/failures in the results dict, or raise them
|
261
264
|
if False: returns exceptions in returned `results` dict
|
262
265
|
if True: raises exceptions as they occur
|
266
|
+
|
263
267
|
tests_to_run : str or list of str, names of tests to run. default = all tests
|
264
268
|
sub-sets tests that are run to the tests given here.
|
269
|
+
|
265
270
|
fixtures_to_run : str or list of str, pytest test-fixture combination codes.
|
266
271
|
which test-fixture combinations to run. Default = run all of them.
|
267
272
|
sub-sets tests and fixtures to run to the list given here.
|
268
273
|
If both tests_to_run and fixtures_to_run are provided, runs the *union*,
|
269
274
|
i.e., all test-fixture combinations for tests in tests_to_run,
|
270
275
|
plus all test-fixture combinations in fixtures_to_run.
|
276
|
+
|
271
277
|
tests_to_exclude : str or list of str, names of tests to exclude. default = None
|
272
278
|
removes tests that should not be run, after subsetting via tests_to_run.
|
279
|
+
|
273
280
|
fixtures_to_exclude : str or list of str, fixtures to exclude. default = None
|
274
281
|
removes test-fixture combinations that should not be run.
|
275
282
|
This is done after subsetting via fixtures_to_run.
|
276
283
|
|
284
|
+
verbose : bool, optional, default=False
|
285
|
+
whether to print the results of the tests as they are run
|
286
|
+
|
277
287
|
Returns
|
278
288
|
-------
|
279
289
|
results : dict of results of the tests in self
|
@@ -403,6 +413,10 @@ class QuickTester:
|
|
403
413
|
pytest_fixture_names,
|
404
414
|
)
|
405
415
|
|
416
|
+
def print_if_verbose(msg):
|
417
|
+
if verbose:
|
418
|
+
print(msg) # noqa: T001, T201
|
419
|
+
|
406
420
|
# loop B: for each test, we loop over all fixtures
|
407
421
|
for params, fixt_name in zip(fixture_prod, fixture_names):
|
408
422
|
# this is needed because pytest unwraps 1-tuples automatically
|
@@ -419,15 +433,20 @@ class QuickTester:
|
|
419
433
|
if fixtures_to_exclude is not None and key in fixtures_to_exclude:
|
420
434
|
continue
|
421
435
|
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
results[key] = "PASSED"
|
426
|
-
except Exception as err:
|
427
|
-
results[key] = err
|
428
|
-
else:
|
436
|
+
print_if_verbose(f"{key}")
|
437
|
+
|
438
|
+
try:
|
429
439
|
test_fun(**deepcopy(args))
|
430
440
|
results[key] = "PASSED"
|
441
|
+
print_if_verbose("PASSED")
|
442
|
+
except Skipped as err:
|
443
|
+
results[key] = f"SKIPPED: {err.msg}"
|
444
|
+
print_if_verbose(f"SKIPPED: {err.msg}")
|
445
|
+
except Exception as err:
|
446
|
+
results[key] = err
|
447
|
+
print_if_verbose(f"FAILED: {err}")
|
448
|
+
if raise_exceptions:
|
449
|
+
raise err
|
431
450
|
|
432
451
|
return results
|
433
452
|
|
@@ -531,7 +550,7 @@ class TestAllObjects(BaseFixtureGenerator, QuickTester):
|
|
531
550
|
|
532
551
|
Tests that:
|
533
552
|
|
534
|
-
* create_test_instance results in an instance of
|
553
|
+
* create_test_instance results in an instance of object_class
|
535
554
|
* `__init__` calls `super.__init__`
|
536
555
|
* `_tags_dynamic` attribute for tag inspection is present after construction
|
537
556
|
"""
|
@@ -779,7 +798,7 @@ class TestAllObjects(BaseFixtureGenerator, QuickTester):
|
|
779
798
|
# Ensure that init does nothing but set parameters
|
780
799
|
# No logic/interaction with other parameters
|
781
800
|
def param_filter(p):
|
782
|
-
"""Identify hyper parameters of an
|
801
|
+
"""Identify hyper parameters of an object."""
|
783
802
|
return p.name != "self" and p.kind not in [p.VAR_KEYWORD, p.VAR_POSITIONAL]
|
784
803
|
|
785
804
|
init_params = [
|
@@ -158,6 +158,8 @@ def _check_soft_dependencies(
|
|
158
158
|
-------
|
159
159
|
package_version_req: SpecifierSet
|
160
160
|
version requirement object from package string
|
161
|
+
package_name: str
|
162
|
+
name of package, PEP 440 compatible specifier string, e.g., "scikit-learn"
|
161
163
|
pkg_env_version: Version
|
162
164
|
version object of package in python environment
|
163
165
|
"""
|
@@ -177,11 +179,11 @@ def _check_soft_dependencies(
|
|
177
179
|
package_name = req.name
|
178
180
|
package_version_req = req.specifier
|
179
181
|
|
180
|
-
pkg_env_version = _get_pkg_version(package_name
|
182
|
+
pkg_env_version = _get_pkg_version(package_name)
|
181
183
|
if normalize_reqs:
|
182
184
|
pkg_env_version = _normalize_version(pkg_env_version)
|
183
185
|
|
184
|
-
return package_version_req, pkg_env_version
|
186
|
+
return package_version_req, package_name, pkg_env_version
|
185
187
|
|
186
188
|
# each element of the list "package" must be satisfied
|
187
189
|
for package_req in packages:
|
@@ -205,13 +207,15 @@ def _check_soft_dependencies(
|
|
205
207
|
|
206
208
|
pkg_version_reqs = []
|
207
209
|
pkg_env_versions = []
|
210
|
+
pkg_names = []
|
208
211
|
nontrivital_bound = []
|
209
212
|
req_sat = []
|
210
213
|
|
211
214
|
for package in package_req:
|
212
|
-
pkg_version_req, pkg_env_version = _get_pkg_version_and_req(package)
|
215
|
+
pkg_version_req, pkg_nm, pkg_env_version = _get_pkg_version_and_req(package)
|
213
216
|
pkg_version_reqs.append(pkg_version_req)
|
214
217
|
pkg_env_versions.append(pkg_env_version)
|
218
|
+
pkg_names.append(pkg_nm)
|
215
219
|
nontrivital_bound.append(pkg_version_req != SpecifierSet(""))
|
216
220
|
req_sat.append(_is_version_req_satisfied(pkg_env_version, pkg_version_req))
|
217
221
|
|
@@ -250,10 +254,9 @@ def _check_soft_dependencies(
|
|
250
254
|
|
251
255
|
# now we check compatibility with the version specifier if non-empty
|
252
256
|
if not any(req_sat):
|
253
|
-
|
254
|
-
|
255
|
-
]
|
256
|
-
actual_vers = [f"{x[0]} {x[1]}" for x in reqs_not_satisfied]
|
257
|
+
zp = zip(package_req, pkg_names, pkg_env_versions, req_sat)
|
258
|
+
reqs_not_satisfied = [x for x in zp if x[3] is False]
|
259
|
+
actual_vers = [f"{x[1]} {x[2]}" for x in reqs_not_satisfied]
|
257
260
|
pkg_env_version_str = ", ".join(actual_vers)
|
258
261
|
|
259
262
|
msg = (
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|