scikit-base 0.8.3__py3-none-any.whl → 0.9.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.
- {scikit_base-0.8.3.dist-info → scikit_base-0.9.0.dist-info}/METADATA +2 -2
- {scikit_base-0.8.3.dist-info → scikit_base-0.9.0.dist-info}/RECORD +10 -10
- skbase/__init__.py +1 -1
- skbase/lookup/_lookup.py +5 -35
- skbase/lookup/tests/test_lookup.py +5 -4
- skbase/tests/conftest.py +16 -0
- {scikit_base-0.8.3.dist-info → scikit_base-0.9.0.dist-info}/LICENSE +0 -0
- {scikit_base-0.8.3.dist-info → scikit_base-0.9.0.dist-info}/WHEEL +0 -0
- {scikit_base-0.8.3.dist-info → scikit_base-0.9.0.dist-info}/top_level.txt +0 -0
- {scikit_base-0.8.3.dist-info → scikit_base-0.9.0.dist-info}/zip-safe +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: scikit-base
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.9.0
|
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,7 +114,7 @@ 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.
|
117
|
+
:rocket: Version 0.9.0 is now available. Check out our
|
118
118
|
[release notes](https://skbase.readthedocs.io/en/latest/changelog.html).
|
119
119
|
|
120
120
|
| Overview | |
|
@@ -1,5 +1,5 @@
|
|
1
1
|
docs/source/conf.py,sha256=kFc-4qkb0ZGD5cDej5KPJhMePp9kpVu6ZqFoF0fgovg,9951
|
2
|
-
skbase/__init__.py,sha256=
|
2
|
+
skbase/__init__.py,sha256=babaqrj4tsDMuHBzKd205fgdkP1bCL8C_5aQnov7GE0,345
|
3
3
|
skbase/_exceptions.py,sha256=KXfcVa7Xit-w-Xs_qFSJOEa_Mfp1oJeiHEC3v4Z0h1Q,1112
|
4
4
|
skbase/_nopytest_tests.py,sha256=npL5pibSgCpulEGw0NqLKcG0majh6xcdW5A4Zibf78s,1077
|
5
5
|
skbase/base/__init__.py,sha256=5ZLlwJeyfKDA1lAylBJgZd3t5JY25xsgQB4waQnroa8,751
|
@@ -12,16 +12,16 @@ skbase/base/_pretty_printing/_pprint.py,sha256=VVnw-cywGxArfiFfVWfFSV5VMJvsxpDsJ
|
|
12
12
|
skbase/base/_pretty_printing/tests/__init__.py,sha256=rakHMQAO1NfuMabw-VsqVA9Jd1YQyuSop-Oc3tgc4w0,77
|
13
13
|
skbase/base/_pretty_printing/tests/test_pprint.py,sha256=8_CFX9v41ZA-aWkAxm9UZSWcOaXt-u1sLwsNPZOSL24,731
|
14
14
|
skbase/lookup/__init__.py,sha256=RNw1mx8nXFHsn-HgnjHzWPn9AG45jSMEKl-Z0pEH7jE,1089
|
15
|
-
skbase/lookup/_lookup.py,sha256=
|
15
|
+
skbase/lookup/_lookup.py,sha256=COZhLXRVZUdisoiS53J1LZylyjlM8TX-P9erEp6bk9I,43025
|
16
16
|
skbase/lookup/tests/__init__.py,sha256=MVqGlWsUV-gQ4qzW_TqE3UmKO9IQ9mwdDlsIHaGt3bc,68
|
17
|
-
skbase/lookup/tests/test_lookup.py,sha256=
|
17
|
+
skbase/lookup/tests/test_lookup.py,sha256=kAgsGyp4EYrXZnqezya-PI14m9mm8-ePoR0Wf-Cu-oo,39782
|
18
18
|
skbase/testing/__init__.py,sha256=OdwR-aEU2KzGrU-O0gtNSMNGmF2mtgBmjAnMzcgwe6w,351
|
19
19
|
skbase/testing/test_all_objects.py,sha256=FooQ_pukjKKK7q3q7gXGH5pDcg8A4xEmkBAMcAF7jcs,36166
|
20
20
|
skbase/testing/utils/__init__.py,sha256=kaLuqQwJsCunRWsUb1JwTVG-iqXbzdUobuYHNHsBlQQ,113
|
21
21
|
skbase/testing/utils/_conditional_fixtures.py,sha256=QwI7K28Lsy6RAkDP94goo8uWWvMzKKNOmXRFtc9RNtI,9890
|
22
22
|
skbase/testing/utils/inspect.py,sha256=e6F7AIuDhBTpgK8KKmiuwxeggrMjC7DHuSAKA1jOU2A,761
|
23
23
|
skbase/tests/__init__.py,sha256=d2_OTTnt0GX5otQsBuNAb1evg8C5Fi0JjqK2VsfMtXU,37
|
24
|
-
skbase/tests/conftest.py,sha256=
|
24
|
+
skbase/tests/conftest.py,sha256=tssOYrrWIRDr__UatmRfNTWt_nPa4ShbLRG0cEyfsD0,10190
|
25
25
|
skbase/tests/test_base.py,sha256=kIhBDcTajAvrOh_BNX8gNuwDWhhGPc-jV6qGE5JPAUk,50827
|
26
26
|
skbase/tests/test_baseestimator.py,sha256=fuzpwxjYzyl-Vrte1va4AWdbYElhWnED8W10236Xprc,4731
|
27
27
|
skbase/tests/test_exceptions.py,sha256=wOdk7Gp8pvbhucna3_9FxTk9xFLjC9XNsGsVabQLYEE,629
|
@@ -57,9 +57,9 @@ skbase/validate/_types.py,sha256=riVEVlj8ipErZX07OVbzv6zdGKssfegHyMr8XwaBm6M,121
|
|
57
57
|
skbase/validate/tests/__init__.py,sha256=wunQBy6rajyrDymKvuFVajsBjj90VP5IFey5b6ZIRCk,70
|
58
58
|
skbase/validate/tests/test_iterable_named_objects.py,sha256=NaEwdmtQJJy4GXMSh9ULOaR4ua7R11BcE6Khz5RKWUk,7438
|
59
59
|
skbase/validate/tests/test_type_validations.py,sha256=oIysbDxRlbBMcCOrDMW6MM6VqhhMWJxNP6NO9Id9Q5g,14133
|
60
|
-
scikit_base-0.
|
61
|
-
scikit_base-0.
|
62
|
-
scikit_base-0.
|
63
|
-
scikit_base-0.
|
64
|
-
scikit_base-0.
|
65
|
-
scikit_base-0.
|
60
|
+
scikit_base-0.9.0.dist-info/LICENSE,sha256=W2h8EYZ_G_mvCmCmXTTYqv66QF5NgSMbzLYJdk8qHVg,1525
|
61
|
+
scikit_base-0.9.0.dist-info/METADATA,sha256=Rzmr2c5W-r-O0WPzYWmod5kmvsreXIJAT9CBjT9phCE,8482
|
62
|
+
scikit_base-0.9.0.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
|
63
|
+
scikit_base-0.9.0.dist-info/top_level.txt,sha256=FbRMsZcP-O6pMLGZpxA5pQ-ClfRzoB6Yr-hTViYqwT0,57
|
64
|
+
scikit_base-0.9.0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
65
|
+
scikit_base-0.9.0.dist-info/RECORD,,
|
skbase/__init__.py
CHANGED
skbase/lookup/_lookup.py
CHANGED
@@ -203,46 +203,16 @@ def _filter_by_tags(obj, tag_filter=None, as_dataframe=True):
|
|
203
203
|
if not hasattr(obj, "get_class_tag"):
|
204
204
|
return False
|
205
205
|
|
206
|
-
klass_tags = obj.get_class_tags().keys()
|
207
|
-
|
208
|
-
# todo 0.9.0: remove the warning message
|
209
|
-
# i.e., this message and all warnings referring to it
|
210
|
-
warn_msg = (
|
211
|
-
"The meaning of filter_tags arguments in all_objects of type str "
|
212
|
-
"and iterable of str will change from scikit-base 0.9.0. "
|
213
|
-
"Currently, str or iterable of str arguments select objects that possess the "
|
214
|
-
"tag(s) with the specified name, of any value. "
|
215
|
-
"From 0.9.0 onwards, str or iterable of str "
|
216
|
-
"will select objects that possess the tag with the specified name, "
|
217
|
-
"with the value True (boolean). See scikit-base issue #326 for the rationale "
|
218
|
-
"behind this change. "
|
219
|
-
"To retain previous behaviour, that is, "
|
220
|
-
"to select objects that possess the tag with the specified name, of any value, "
|
221
|
-
"use a dict with the tag name as key, and re.Pattern('*?') as value. "
|
222
|
-
"That is, from re import Pattern, and pass {tag_name: Pattern('*?')} "
|
223
|
-
"as filter_tags, and similarly with multiple tag names. "
|
224
|
-
)
|
225
|
-
|
226
206
|
# case: tag_filter is string
|
227
207
|
if isinstance(tag_filter, str):
|
228
|
-
|
229
|
-
warnings.warn(warn_msg, DeprecationWarning, stacklevel=2)
|
230
|
-
# todo 0.9.0: replace this line
|
231
|
-
return tag_filter in klass_tags
|
232
|
-
# by this line
|
233
|
-
# tag_filter = {tag_filter: True}
|
208
|
+
tag_filter = {tag_filter: True}
|
234
209
|
|
235
210
|
# case: tag_filter is iterable of str but not dict
|
236
211
|
# If a iterable of strings is provided, check that all are in the returned tag_dict
|
237
212
|
if isinstance(tag_filter, Iterable) and not isinstance(tag_filter, dict):
|
238
213
|
if not all(isinstance(t, str) for t in tag_filter):
|
239
214
|
raise ValueError(f"{type_msg} {tag_filter}")
|
240
|
-
|
241
|
-
warnings.warn(warn_msg, DeprecationWarning, stacklevel=2)
|
242
|
-
# todo 0.9.0: replace this line
|
243
|
-
return all(tag in klass_tags for tag in tag_filter)
|
244
|
-
# by this line
|
245
|
-
# tag_filter = {tag: True for tag in tag_filter}
|
215
|
+
tag_filter = dict.fromkeys(tag_filter, True)
|
246
216
|
|
247
217
|
# case: tag_filter is dict
|
248
218
|
# check that all keys are str
|
@@ -712,8 +682,6 @@ def get_package_metadata(
|
|
712
682
|
return module_info
|
713
683
|
|
714
684
|
|
715
|
-
# todo 0.9.0: change docstring to reflect handling of filter_tags
|
716
|
-
# in case of str or iterable of str
|
717
685
|
def all_objects(
|
718
686
|
object_types=None,
|
719
687
|
filter_tags=None,
|
@@ -760,7 +728,9 @@ def all_objects(
|
|
760
728
|
Filter used to determine if ``klass`` has tag or expected tag values.
|
761
729
|
|
762
730
|
- If a str or list of strings is provided, the return will be filtered
|
763
|
-
to keep classes that have all the tag(s) specified by the strings
|
731
|
+
to keep classes that have all the tag(s) specified by the strings,
|
732
|
+
with the tag value being True.
|
733
|
+
|
764
734
|
- If a dict is provided, the return will be filtered to keep exactly the classes
|
765
735
|
where tags satisfy all the filter conditions specified by ``filter_tags``.
|
766
736
|
Filter conditions are as follows, for ``tag_name: search_value`` pairs in
|
@@ -35,6 +35,7 @@ from skbase.tests.conftest import (
|
|
35
35
|
SKBASE_PUBLIC_CLASSES_BY_MODULE,
|
36
36
|
SKBASE_PUBLIC_FUNCTIONS_BY_MODULE,
|
37
37
|
SKBASE_PUBLIC_MODULES,
|
38
|
+
ClassWithABTrue,
|
38
39
|
Parent,
|
39
40
|
)
|
40
41
|
from skbase.tests.mock_package.test_mock_package import (
|
@@ -374,18 +375,18 @@ def test_filter_by_tags():
|
|
374
375
|
assert _filter_by_tags(NotABaseObject) is True
|
375
376
|
|
376
377
|
# Check when tag_filter is a str and present in the class
|
377
|
-
assert _filter_by_tags(
|
378
|
+
assert _filter_by_tags(ClassWithABTrue, tag_filter="A") is True
|
378
379
|
# Check when tag_filter is str and not present in the class
|
379
|
-
assert _filter_by_tags(
|
380
|
+
assert _filter_by_tags(Parent, tag_filter="A") is False
|
380
381
|
|
381
382
|
# Test functionality when tag present and object doesn't have tag interface
|
382
383
|
assert _filter_by_tags(NotABaseObject, tag_filter="A") is False
|
383
384
|
|
384
385
|
# Test functionality where tag_filter is Iterable of str
|
385
386
|
# all tags in iterable are in the class
|
386
|
-
assert _filter_by_tags(
|
387
|
+
assert _filter_by_tags(ClassWithABTrue, ("A", "B")) is True
|
387
388
|
# Some tags in iterable are in class and others aren't
|
388
|
-
assert _filter_by_tags(
|
389
|
+
assert _filter_by_tags(ClassWithABTrue, ("A", "B", "C", "D", "E")) is False
|
389
390
|
|
390
391
|
# Test functionality where tag_filter is Dict[str, Any]
|
391
392
|
# All keys in dict are in tag_filter and values all match
|
skbase/tests/conftest.py
CHANGED
@@ -314,3 +314,19 @@ class Child(Parent):
|
|
314
314
|
def some_other_method(self):
|
315
315
|
"""To be implemented in the child class."""
|
316
316
|
pass
|
317
|
+
|
318
|
+
|
319
|
+
# Fixture class for testing tag system, child overrides tags
|
320
|
+
class ClassWithABTrue(Parent):
|
321
|
+
"""Child class that sets A, B tags to True."""
|
322
|
+
|
323
|
+
_tags = {"A": True, "B": True}
|
324
|
+
__author__ = ["fkiraly", "RNKuhns"]
|
325
|
+
|
326
|
+
def some_method(self):
|
327
|
+
"""Child class' implementation."""
|
328
|
+
pass
|
329
|
+
|
330
|
+
def some_other_method(self):
|
331
|
+
"""To be implemented in the child class."""
|
332
|
+
pass
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|