Skip to content
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

Latest Release breaks compatibility with Python 3.7 #6

Closed
JacksonBurns opened this issue Apr 24, 2023 · 2 comments
Closed

Latest Release breaks compatibility with Python 3.7 #6

JacksonBurns opened this issue Apr 24, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@JacksonBurns
Copy link

The latest changes in v2 are no longer compatible with Python 3.7. Run this example in an environment with Python 3.7 installed to reproduce the error:

>>> from kennard_stone import train_test_split
>>> import numpy as np

>>> train_test_split(np.array([1,2,3]).reshape(-1, 1))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jackson/mambaforge/envs/py37/lib/python3.7/site-packages/kennard_stone/kennard_stone.py", line 142, in train_test_split
    train, test = next(cv.split(X=arrays[0]))
  File "/home/jackson/mambaforge/envs/py37/lib/python3.7/site-packages/sklearn/model_selection/_split.py", line 1600, in split
    for train, test in self._iter_indices(X, y, groups):
  File "/home/jackson/mambaforge/envs/py37/lib/python3.7/site-packages/kennard_stone/kennard_stone.py", line 75, in _iter_indices
    indexes = ks.get_indexes(X)[0]
  File "/home/jackson/mambaforge/envs/py37/lib/python3.7/site-packages/kennard_stone/kennard_stone.py", line 194, in get_indexes
    X=X, lst_idx_selected=lst_idx_selected, idx_remaining=idx_remaining
  File "/home/jackson/mambaforge/envs/py37/lib/python3.7/site-packages/kennard_stone/kennard_stone.py", line 211, in _sort
    sum(lst_idx_selected, start=[])
TypeError: sum() takes no keyword arguments

This change in the call to sum should be reverted, or Python 3.7 should be dropped from the list of supported Python versions.

@JacksonBurns JacksonBurns changed the title Latest Release break compatibility with Python 3.7 Latest Release breaks compatibility with Python 3.7 Apr 24, 2023
@yu9824 yu9824 added the bug Something isn't working label Apr 25, 2023
@yu9824
Copy link
Owner

yu9824 commented Apr 25, 2023

Thank you very much for your report. I had missed the bug.

I've fixed the bug and performed pytest on each version.
https://github.com/yu9824/kennard_stone/actions/runs/4798295831

I will release the fixed version soon.
Best regards

@yu9824 yu9824 closed this as completed in d85a077 Apr 25, 2023
@yu9824
Copy link
Owner

yu9824 commented Apr 26, 2023

I have released a modified version (v2.0.1) on both PyPI and Anaconda.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants