-
-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python3.12: Two tests are failing with AssertionError #369
Comments
Thanks for reporting. It appears that the Line 301 in 7923141
Can you please try running the following? from pingouin.utils import _flatten_list
x = ['X1', ['M1', 'M2'], 'Y1', None]
_flatten_list(x) My output: ['X1', 'M1', 'M2', 'Y1'] |
You are correct. Running this in the build environment results in: ['X1', 'M1', 'M2', 'Y1', None] |
Thanks @penguinpee — can you please run the following code in your test env? import collections.abc
def _flatten_list(x, include_tuple=False):
"""Flatten an arbitrarily nested list into a new list.
"""
# If x is not iterable, return x
if not isinstance(x, collections.abc.Iterable):
return x
# Initialize empty output variable
result = []
# Loop over items in x
for el in x:
# Check if element is iterable
el_is_iter = isinstance(el, collections.abc.Iterable)
if el_is_iter:
if not isinstance(el, (str, tuple)):
result.extend(_flatten_list(el))
else:
if isinstance(el, tuple) and include_tuple:
result.extend(_flatten_list(el))
else:
result.append(el)
else:
result.append(el)
# Remove None from output
result = [r for r in result if r is not None]
return result
x = ['X1', ['M1', 'M2', None], 'Y1', None]
_flatten_list(x) # Expected output: ['X1', 'M1', 'M2', 'Y1'] |
Yes, that prints the expected output: Out[1]: ['X1', 'M1', 'M2', 'Y1'] |
Thanks! Created a PR: #370 |
Python 3.12 was unleashed recently in Fedora. Building pingouin against Python 3.12 results in two tests failing:
pingouin/requirements-test.txt
Line 6 in 7923141
Fedora currently has numpy 1.24 across all branches. But since the package builds fine with all tests passing using numpy 1.24 and Python 3.11, I suspect some issues (removed deprecations?) in relation to Python 3.12.
The text was updated successfully, but these errors were encountered: