scikit-base 0.7.6__py3-none-any.whl → 0.7.8__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: scikit-base
3
- Version: 0.7.6
3
+ Version: 0.7.8
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
@@ -75,7 +75,7 @@ Requires-Dist: nbsphinx >=0.8.6 ; extra == 'docs'
75
75
  Requires-Dist: numpydoc ; extra == 'docs'
76
76
  Requires-Dist: pydata-sphinx-theme ; extra == 'docs'
77
77
  Requires-Dist: sphinx-issues <5.0.0 ; extra == 'docs'
78
- Requires-Dist: sphinx-gallery <0.16.0 ; extra == 'docs'
78
+ Requires-Dist: sphinx-gallery <0.17.0 ; extra == 'docs'
79
79
  Requires-Dist: sphinx-panels ; extra == 'docs'
80
80
  Requires-Dist: sphinx-design <0.6.0 ; extra == 'docs'
81
81
  Requires-Dist: Sphinx !=7.2.0,<8.0.0 ; extra == 'docs'
@@ -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.6 is now available. Check out our
117
+ :rocket: Version 0.7.8 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** | [![Tests](https://github.com/sktime/skbase/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/sktime/skbase/actions/workflows/test.yml) [![codecov](https://codecov.io/gh/sktime/skbase/branch/main/graph/badge.svg?token=2J424NLO82)](https://codecov.io/gh/sktime/skbase) [![Documentation Status](https://readthedocs.org/projects/skbase/badge/?version=latest)](https://skbase.readthedocs.io/en/latest/?badge=latest) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/sktime/skbase/main.svg)](https://results.pre-commit.ci/latest/github/sktime/skbase/main) |
123
123
  | **Code** | [![!pypi](https://img.shields.io/pypi/v/scikit-base?color=orange)](https://pypi.org/project/scikit-base/) [![!python-versions](https://img.shields.io/pypi/pyversions/scikit-base)](https://www.python.org/) [![!black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit) |
124
- | **Downloads**| [![Downloads](https://static.pepy.tech/personalized-badge/scikit-base?period=week&units=international_system&left_color=grey&right_color=blue&left_text=weekly%20(pypi))](https://pepy.tech/project/scikit-base) [![Downloads](https://static.pepy.tech/personalized-badge/scikit-base?period=month&units=international_system&left_color=grey&right_color=blue&left_text=monthly%20(pypi))](https://pepy.tech/project/scikit-base) [![Downloads](https://static.pepy.tech/personalized-badge/scikit-base?period=total&units=international_system&left_color=grey&right_color=blue&left_text=cumulative%20(pypi))](https://pepy.tech/project/scikit-base) |
124
+ | **Downloads** | [![Downloads](https://static.pepy.tech/personalized-badge/scikit-base?period=week&units=international_system&left_color=grey&right_color=blue&left_text=weekly%20(pypi))](https://pepy.tech/project/scikit-base) [![Downloads](https://static.pepy.tech/personalized-badge/scikit-base?period=month&units=international_system&left_color=grey&right_color=blue&left_text=monthly%20(pypi))](https://pepy.tech/project/scikit-base) [![Downloads](https://static.pepy.tech/personalized-badge/scikit-base?period=total&units=international_system&left_color=grey&right_color=blue&left_text=cumulative%20(pypi))](https://pepy.tech/project/scikit-base) |
125
+ | **Citation** | [![DOI](https://zenodo.org/badge/494649836.svg)](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
  [![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors)
@@ -1,5 +1,5 @@
1
1
  docs/source/conf.py,sha256=kFc-4qkb0ZGD5cDej5KPJhMePp9kpVu6ZqFoF0fgovg,9951
2
- skbase/__init__.py,sha256=CKmrUi1UR6s2fjgX9ojllx8YrEDY76KgwJ_AeS4pZ5E,345
2
+ skbase/__init__.py,sha256=Ab3YMPkln7mapnxZqpr62oT-wBkvDnVIudmtwXuMOkc,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
@@ -16,12 +16,12 @@ skbase/lookup/_lookup.py,sha256=7L1JIMCzpMdSF5ZqHNDeIaHu4QRwXoLJ4DgM1Z_uFts,3986
16
16
  skbase/lookup/tests/__init__.py,sha256=MVqGlWsUV-gQ4qzW_TqE3UmKO9IQ9mwdDlsIHaGt3bc,68
17
17
  skbase/lookup/tests/test_lookup.py,sha256=_VDReGKnJF52UtFbvg_D2vlAkVvREypwM-9jR7DPAXQ,38218
18
18
  skbase/testing/__init__.py,sha256=OdwR-aEU2KzGrU-O0gtNSMNGmF2mtgBmjAnMzcgwe6w,351
19
- skbase/testing/test_all_objects.py,sha256=loDy2Zqqlg6_zmUg2EknNMxRljPKtB-k6XM2cihjJ5E,36167
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
- skbase/testing/utils/_inspect.py,sha256=XcPdm1-J3YXCTxsrqeJlStPvbC0vH1cgaApN5lzRI2c,741
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=L58JDizS0AZrdk7y-3VJ0P1iBK8e2IRJtmodHayiRt8,9263
24
+ skbase/tests/conftest.py,sha256=2vK_pJVsHIyArS7TEMOkwNW84vtCEw_c5v6FLGZDB5k,9330
25
25
  skbase/tests/test_base.py,sha256=-kyVDOQRdXYsBmSTqNjZ06mjnt_OWoY2i2i71qx3TF8,50648
26
26
  skbase/tests/test_baseestimator.py,sha256=fuzpwxjYzyl-Vrte1va4AWdbYElhWnED8W10236Xprc,4731
27
27
  skbase/tests/test_exceptions.py,sha256=wOdk7Gp8pvbhucna3_9FxTk9xFLjC9XNsGsVabQLYEE,629
@@ -36,7 +36,7 @@ skbase/utils/_utils.py,sha256=A6sTIUEscEy9TjBmCvXEuhk9q8ROBPyfJGhrjlSA4LY,3134
36
36
  skbase/utils/random_state.py,sha256=QxY-M2u_6my315tdml2CukKj7ZVnbqjU_T9ZzixGuq0,5127
37
37
  skbase/utils/deep_equals/__init__.py,sha256=1II3GWV1c1s43y62IidMiTjjyOnE9MFysQ5AKCXMB2g,235
38
38
  skbase/utils/deep_equals/_common.py,sha256=O0ODPJGwdq6G-KdeGoHgyote53tNcxu3y2jHvej3bdQ,1273
39
- skbase/utils/deep_equals/_deep_equals.py,sha256=XtC3GohsVpXzKtBKY8ejYoJ2q1vPqcpXnTBRqZnj0T8,18331
39
+ skbase/utils/deep_equals/_deep_equals.py,sha256=DT6nE0p1IGsLb82h3JJu24_nWeNE2HI46eL2qPlqxbo,19151
40
40
  skbase/utils/dependencies/__init__.py,sha256=cCUa_P-RiDs4pW6cw51uYeoBMaMa9iycwiFkwqkIizc,419
41
41
  skbase/utils/dependencies/_dependencies.py,sha256=P_kqwGOxbGlbTdOfQ8HFHRm-UsAcSWQF-1jcqrzo4IU,14502
42
42
  skbase/utils/dependencies/tests/__init__.py,sha256=UqE6wenG-HffjT2Z974OLzmXG-M8PNOP9nUnNfqtfT4,74
@@ -54,9 +54,9 @@ skbase/validate/_types.py,sha256=riVEVlj8ipErZX07OVbzv6zdGKssfegHyMr8XwaBm6M,121
54
54
  skbase/validate/tests/__init__.py,sha256=wunQBy6rajyrDymKvuFVajsBjj90VP5IFey5b6ZIRCk,70
55
55
  skbase/validate/tests/test_iterable_named_objects.py,sha256=NaEwdmtQJJy4GXMSh9ULOaR4ua7R11BcE6Khz5RKWUk,7438
56
56
  skbase/validate/tests/test_type_validations.py,sha256=G-qwFjXk-8WvXoeOvo2omfFKKjbpWhP-sPf6hsw8q30,14131
57
- scikit_base-0.7.6.dist-info/LICENSE,sha256=W2h8EYZ_G_mvCmCmXTTYqv66QF5NgSMbzLYJdk8qHVg,1525
58
- scikit_base-0.7.6.dist-info/METADATA,sha256=paGS65lYv7CmJ5XMvW2bjDLwCd1nE-5tyJR_Crif0Ow,8704
59
- scikit_base-0.7.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
60
- scikit_base-0.7.6.dist-info/top_level.txt,sha256=FbRMsZcP-O6pMLGZpxA5pQ-ClfRzoB6Yr-hTViYqwT0,57
61
- scikit_base-0.7.6.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
62
- scikit_base-0.7.6.dist-info/RECORD,,
57
+ scikit_base-0.7.8.dist-info/LICENSE,sha256=W2h8EYZ_G_mvCmCmXTTYqv66QF5NgSMbzLYJdk8qHVg,1525
58
+ scikit_base-0.7.8.dist-info/METADATA,sha256=rgk5oZpH5IuzFto5-MiPcfKEIj7CBozcW5BZPvh2TNY,8821
59
+ scikit_base-0.7.8.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
60
+ scikit_base-0.7.8.dist-info/top_level.txt,sha256=FbRMsZcP-O6pMLGZpxA5pQ-ClfRzoB6Yr-hTViYqwT0,57
61
+ scikit_base-0.7.8.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
62
+ scikit_base-0.7.8.dist-info/RECORD,,
skbase/__init__.py CHANGED
@@ -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.7.6"
9
+ __version__: str = "0.7.8"
@@ -18,7 +18,7 @@ from skbase.lookup import all_objects
18
18
  from skbase.testing.utils._conditional_fixtures import (
19
19
  create_conditional_fixtures_and_names,
20
20
  )
21
- from skbase.testing.utils._inspect import _get_args
21
+ from skbase.testing.utils.inspect import _get_args
22
22
  from skbase.utils.deep_equals import deep_equals
23
23
  from skbase.utils.dependencies import _check_soft_dependencies
24
24
 
@@ -1,4 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
+ # flake8: noqa A005
2
3
  """Utilities for inspection of function arguments."""
3
4
 
4
5
 
skbase/tests/conftest.py CHANGED
@@ -35,7 +35,7 @@ SKBASE_MODULES = (
35
35
  "skbase.testing.test_all_objects",
36
36
  "skbase.testing.utils",
37
37
  "skbase.testing.utils._conditional_fixtures",
38
- "skbase.testing.utils._inspect",
38
+ "skbase.testing.utils.inspect",
39
39
  "skbase.testing.utils.tests",
40
40
  "skbase.testing.utils.tests.test_deep_equals",
41
41
  "skbase.tests",
@@ -67,6 +67,7 @@ SKBASE_PUBLIC_MODULES = (
67
67
  "skbase.testing",
68
68
  "skbase.testing.test_all_objects",
69
69
  "skbase.testing.utils",
70
+ "skbase.testing.utils.inspect",
70
71
  "skbase.testing.utils.tests",
71
72
  "skbase.testing.utils.tests.test_deep_equals",
72
73
  "skbase.tests",
@@ -203,7 +204,7 @@ SKBASE_FUNCTIONS_BY_MODULE.update(
203
204
  "_check_object_types",
204
205
  "_get_module_info",
205
206
  ),
206
- "skbase.testing.utils._inspect": ("_get_args",),
207
+ "skbase.testing.utils.inspect": ("_get_args",),
207
208
  "skbase.utils._check": ("_is_scalar_nan",),
208
209
  "skbase.utils.dependencies": (
209
210
  "_check_soft_dependencies",
@@ -236,6 +237,7 @@ SKBASE_FUNCTIONS_BY_MODULE.update(
236
237
  "_numpy_equals_plugin",
237
238
  "_pandas_equals",
238
239
  "_pandas_equals_plugin",
240
+ "_safe_any_unequal",
239
241
  "_safe_len",
240
242
  "_softdep_available",
241
243
  "_tuple_equals",
@@ -503,18 +503,50 @@ def deep_equals_custom(x, y, return_msg=False, plugins=None):
503
503
  if isinstance(x == y, bool):
504
504
  return ret(x == y, f" !=, {x} != {y}")
505
505
 
506
- # check if numpy is available
507
- numpy_available = _softdep_available("numpy")
508
- if numpy_available:
509
- import numpy as np
510
-
511
506
  # deal with the case where != returns a vector
512
- if numpy_available and np.any(x != y) or np.any(_coerce_list(x != y)):
507
+ if _safe_any_unequal(x, y):
513
508
  return ret(False, f" !=, {x} != {y}")
514
509
 
515
510
  return ret(True, "")
516
511
 
517
512
 
513
+ def _safe_any_unequal(x, y):
514
+ """Return whether any of x != y, if != results in iterable, False on exception.
515
+
516
+ Written very defensively to avoid exceptions, as exceptions may be raised
517
+ since any(x != y) or the safer np.any(x != y) may not be boolean,
518
+ e.g., in pathological cases of nested objects.
519
+ """
520
+ try:
521
+ unequal = x != y
522
+ except Exception:
523
+ return False
524
+
525
+ # check if numpy is available
526
+ numpy_available = _softdep_available("numpy")
527
+
528
+ if not numpy_available:
529
+ try:
530
+ any_un = any(unequal)
531
+ if isinstance(any_un, bool):
532
+ return any_un
533
+ else:
534
+ return False
535
+ except Exception:
536
+ return False
537
+
538
+ import numpy as np
539
+
540
+ try:
541
+ any_un = np.any(x != y) or np.any(_coerce_list(x != y))
542
+ if isinstance(any_un, bool) or any_un.dtype == "bool":
543
+ return any_un
544
+ else:
545
+ return False
546
+ except Exception:
547
+ return False
548
+
549
+
518
550
  def _safe_len(x):
519
551
  """Return length of x if len(x) does not result in exception, else -1."""
520
552
  if hasattr(x, "__len__"):