From ec2f00ca731b7c6809296c920588c6a5ea94f711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Gnassounou?= <66993815+tgnassou@users.noreply.github.com> Date: Fri, 6 Dec 2024 08:50:46 +0100 Subject: [PATCH] [MRG] Remove dependance of packaging (#287) * add contributor guide * remove dependance to packaging * fix lint * add dep in pyproject --- pyproject.toml | 2 +- requirements.txt | 2 +- skada/_utils.py | 9 +-------- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c0ec499a..e92d117e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ readme = "README.md" dependencies = [ "numpy >= 1.24", "scipy >= 1.10", - "scikit-learn >= 1.4.0", + "scikit-learn >= 1.5.0", "POT >= 0.9.3", ] keywords = ["domain-adaptation", "scikit-learn", "pytorch", diff --git a/requirements.txt b/requirements.txt index b0022061..13668f35 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ numpy>=1.24 scipy>=1.10 -scikit-learn>=1.4.0 +scikit-learn>=1.5.0 pot>=0.9.0 diff --git a/skada/_utils.py b/skada/_utils.py index fb053cb3..f6c59855 100644 --- a/skada/_utils.py +++ b/skada/_utils.py @@ -10,8 +10,6 @@ from numbers import Real import numpy as np -import sklearn -from packaging.version import Version from sklearn.covariance import ( empirical_covariance, ledoit_wolf, @@ -21,8 +19,6 @@ from sklearn.utils import check_random_state from sklearn.utils.multiclass import type_of_target -_SKLEARN_OLDER_15 = Version(sklearn.__version__) >= Version("1.5.0") - _logger = logging.getLogger("skada") _logger.setLevel(logging.DEBUG) @@ -231,7 +227,4 @@ def _shuffle_arrays(*arrays, random_state=None): def _route_params(request, params, caller): - if _SKLEARN_OLDER_15: - return request._route_params(params=params, parent=caller, caller=caller) - else: - return request._route_params(params=params) + return request._route_params(params=params, parent=caller, caller=caller)