& yarnabrina [MNT] move deep_equals and dependency checkers from testing to utilities to remove accidental coupling to pytest#178
Conversation
for more information, see https://pre-commit.ci
deep_equals and dependency checkers from testing to utilities to remove accidental coupling to pytestdeep_equals and dependency checkers from testing to utilities to remove accidental coupling to pytest
yarnabrina
left a comment
There was a problem hiding this comment.
I know almost nothing about how skbase works, but is it not necessary to add deep_equals to __init__.py? Or, it'd be this way during deprecation period, and then changed?
| return x | ||
|
|
||
|
|
||
| def _pandas_equals(x, y, return_msg=False): |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns
Unfortunately the module name is the same as the function name, so it would result in a clash to import the function to the same module that contains the module of the same name, no? Might be suboptimal... |
Just to be clear, I meant doing something like this in ## existing imports
from sktime.utils.deep_equals import deep_equals
## or if you accept relative imports
## from .deep_equals import deep_equals
## existing codesTried locally, and it works. >>>
>>> from skbase.utils import deep_equals as a
>>> from skbase.testing.utils.deep_equals import deep_equals as b
/path/to/skbase/fork/skbase/testing/utils/_dependencies.py:10: UserWarning: _check_soft_dependencies, _check_python_versiontesting have moved to skbase.utils.dependencies. The old location will be removed in skbase 0.6.0.
warn(
/path/to/skbase/fork/skbase/testing/utils/deep_equals.py:10: UserWarning: deep_equals has moved to skbase.utils.deep_equals. The old location will be removed in skbase 0.6.0.
warn(
>>>
>>> a
<function deep_equals at 0x7f680574b040>
>>> b
<function deep_equals at 0x7f680574b040>
>>>
>>> b is a
True
>>> ( Can you please check #181? |
for more information, see https://pre-commit.ci
…nto move-deep_equals
for more information, see https://pre-commit.ci
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #178 +/- ##
==========================================
- Coverage 82.89% 82.74% -0.16%
==========================================
Files 39 43 +4
Lines 2777 2805 +28
==========================================
+ Hits 2302 2321 +19
- Misses 475 484 +9
|
This PR moves
deep_equalsand dependency checkers fromtestingtoutilitiesto remove accidental coupling topytest.Also see here for the problem caused by this: #177 - this fixes #177
Crediting @yarnabrina for the fix as suggested in sktime/sktime#4544 (comment)