scikit-base 0.12.3__tar.gz → 0.12.4__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.
Files changed (74) hide show
  1. {scikit_base-0.12.3/scikit_base.egg-info → scikit_base-0.12.4}/PKG-INFO +3 -3
  2. {scikit_base-0.12.3 → scikit_base-0.12.4}/README.md +2 -2
  3. {scikit_base-0.12.3 → scikit_base-0.12.4}/pyproject.toml +1 -1
  4. {scikit_base-0.12.3 → scikit_base-0.12.4/scikit_base.egg-info}/PKG-INFO +3 -3
  5. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/__init__.py +1 -1
  6. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/testing/test_all_objects.py +30 -11
  7. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/dependencies/_dependencies.py +10 -7
  8. {scikit_base-0.12.3 → scikit_base-0.12.4}/LICENSE +0 -0
  9. {scikit_base-0.12.3 → scikit_base-0.12.4}/docs/source/conf.py +0 -0
  10. {scikit_base-0.12.3 → scikit_base-0.12.4}/scikit_base.egg-info/SOURCES.txt +0 -0
  11. {scikit_base-0.12.3 → scikit_base-0.12.4}/scikit_base.egg-info/dependency_links.txt +0 -0
  12. {scikit_base-0.12.3 → scikit_base-0.12.4}/scikit_base.egg-info/requires.txt +0 -0
  13. {scikit_base-0.12.3 → scikit_base-0.12.4}/scikit_base.egg-info/top_level.txt +0 -0
  14. {scikit_base-0.12.3 → scikit_base-0.12.4}/scikit_base.egg-info/zip-safe +0 -0
  15. {scikit_base-0.12.3 → scikit_base-0.12.4}/setup.cfg +0 -0
  16. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/_exceptions.py +0 -0
  17. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/_nopytest_tests.py +0 -0
  18. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/base/__init__.py +0 -0
  19. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/base/_base.py +0 -0
  20. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/base/_clone_base.py +0 -0
  21. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/base/_clone_plugins.py +0 -0
  22. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/base/_meta.py +0 -0
  23. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/base/_pretty_printing/__init__.py +0 -0
  24. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/base/_pretty_printing/_object_html_repr.py +0 -0
  25. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/base/_pretty_printing/_pprint.py +0 -0
  26. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/base/_pretty_printing/tests/__init__.py +0 -0
  27. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/base/_pretty_printing/tests/test_pprint.py +0 -0
  28. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/base/_tagmanager.py +0 -0
  29. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/lookup/__init__.py +0 -0
  30. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/lookup/_lookup.py +0 -0
  31. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/lookup/tests/__init__.py +0 -0
  32. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/lookup/tests/test_lookup.py +0 -0
  33. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/testing/__init__.py +0 -0
  34. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/testing/utils/__init__.py +0 -0
  35. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/testing/utils/_conditional_fixtures.py +0 -0
  36. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/testing/utils/inspect.py +0 -0
  37. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/tests/__init__.py +0 -0
  38. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/tests/conftest.py +0 -0
  39. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/tests/mock_package/__init__.py +0 -0
  40. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/tests/mock_package/test_mock_package.py +0 -0
  41. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/tests/test_base.py +0 -0
  42. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/tests/test_baseestimator.py +0 -0
  43. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/tests/test_exceptions.py +0 -0
  44. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/tests/test_meta.py +0 -0
  45. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/__init__.py +0 -0
  46. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/_check.py +0 -0
  47. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/_iter.py +0 -0
  48. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/_nested_iter.py +0 -0
  49. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/_utils.py +0 -0
  50. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/deep_equals/__init__.py +0 -0
  51. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/deep_equals/_common.py +0 -0
  52. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/deep_equals/_deep_equals.py +0 -0
  53. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/dependencies/__init__.py +0 -0
  54. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/dependencies/_import.py +0 -0
  55. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/dependencies/tests/__init__.py +0 -0
  56. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/dependencies/tests/test_check_dependencies.py +0 -0
  57. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/doctest_run.py +0 -0
  58. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/random_state.py +0 -0
  59. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/stderr_mute.py +0 -0
  60. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/stdout_mute.py +0 -0
  61. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/tests/__init__.py +0 -0
  62. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/tests/test_check.py +0 -0
  63. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/tests/test_deep_equals.py +0 -0
  64. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/tests/test_iter.py +0 -0
  65. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/tests/test_nested_iter.py +0 -0
  66. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/tests/test_random_state.py +0 -0
  67. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/tests/test_std_mute.py +0 -0
  68. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/utils/tests/test_utils.py +0 -0
  69. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/validate/__init__.py +0 -0
  70. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/validate/_named_objects.py +0 -0
  71. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/validate/_types.py +0 -0
  72. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/validate/tests/__init__.py +0 -0
  73. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/validate/tests/test_iterable_named_objects.py +0 -0
  74. {scikit_base-0.12.3 → scikit_base-0.12.4}/skbase/validate/tests/test_type_validations.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scikit-base
3
- Version: 0.12.3
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.3 is now available. Check out our
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 X · Linux · Windows 8.1 or higher
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
 
@@ -7,7 +7,7 @@
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.12.3 is now available. Check out our
10
+ :rocket: Version 0.12.4 is now available. Check out our
11
11
  [release notes](https://skbase.readthedocs.io/en/latest/changelog.html).
12
12
 
13
13
  | Overview | |
@@ -32,7 +32,7 @@ To learn more about the package check out:
32
32
  For trouble shooting or more information, see our
33
33
  [detailed installation instructions](https://skbase.readthedocs.io/en/latest/user_documentation/installation.html).
34
34
 
35
- - **Operating system**: macOS X · Linux · Windows 8.1 or higher
35
+ - **Operating system**: macOS · Linux · Windows 8.1 or higher
36
36
  - **Python version**: Python 3.9, 3.10, 3.11, 3.12, and 3.13
37
37
  - **Package managers**: [pip]
38
38
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "scikit-base"
3
- version = "0.12.3"
3
+ version = "0.12.4"
4
4
  description = "Base classes for sklearn-like parametric objects"
5
5
  authors = [
6
6
  {name = "sktime developers", email = "sktime.toolbox@gmail.com"},
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scikit-base
3
- Version: 0.12.3
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.3 is now available. Check out our
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 X · Linux · Windows 8.1 or higher
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
 
@@ -6,4 +6,4 @@
6
6
  The included functionality makes it easy to reuse scikit-learn and
7
7
  sktime design principles in your project.
8
8
  """
9
- __version__: str = "0.12.3"
9
+ __version__: str = "0.12.4"
@@ -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 estimators, values are lists of test names to exclude
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
- # estimator_instance is cloned at the start of every test
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
- if not raise_exceptions:
423
- try:
424
- test_fun(**deepcopy(args))
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 estimator_class
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 estimator."""
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, case_sensitive=case_sensitive)
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
- reqs_not_satisfied = [
254
- x for x in zip(package_req, pkg_env_versions, req_sat) if x[2] is False
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