From 813c06f5fcc9604d8e445bd4992f53c4855cc7cb Mon Sep 17 00:00:00 2001 From: "Jackson L. Lee" Date: Tue, 30 Jun 2020 07:30:46 -0500 Subject: [PATCH] [PARO-779] Prep for v2.2.1 release; remove six dependency (#65) * RM no more six dependency * MAINT version bump to 2.2.1 * MAINT update changelog --- CHANGELOG.md | 5 +++++ glmnet/linear.py | 8 ++++---- glmnet/logistic.py | 8 ++++---- glmnet/scorer.py | 5 ++--- glmnet/tests/__init__.py | 0 glmnet/tests/test_linear.py | 2 +- glmnet/tests/test_logistic.py | 2 +- glmnet/tests/test_pandas.py | 2 +- glmnet/util.py | 2 +- setup.py | 2 +- 10 files changed, 20 insertions(+), 16 deletions(-) create mode 100644 glmnet/tests/__init__.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 37fac16..39ebca2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## Unreleased +## 2.2.1 - 2020-06-30 +### Fix +* [#65](https://github.com/civisanalytics/python-glmnet/pull/65) + Remove `six` dependency entirely. + ## 2.2.0 - 2020-06-29 ### Changed * [#57](https://github.com/civisanalytics/python-glmnet/pull/57) diff --git a/glmnet/linear.py b/glmnet/linear.py index b672f31..30ae747 100644 --- a/glmnet/linear.py +++ b/glmnet/linear.py @@ -10,10 +10,10 @@ from .errors import _check_error_flag from _glmnet import elnet, spelnet, solns -from .util import (_fix_lambda_path, - _check_user_lambda, - _interpolate_model, - _score_lambda_path) +from glmnet.util import (_fix_lambda_path, + _check_user_lambda, + _interpolate_model, + _score_lambda_path) class ElasticNet(BaseEstimator): diff --git a/glmnet/logistic.py b/glmnet/logistic.py index d1dc181..cc8a190 100644 --- a/glmnet/logistic.py +++ b/glmnet/logistic.py @@ -12,10 +12,10 @@ from .errors import _check_error_flag from _glmnet import lognet, splognet, lsolns -from .util import (_fix_lambda_path, - _check_user_lambda, - _interpolate_model, - _score_lambda_path) +from glmnet.util import (_fix_lambda_path, + _check_user_lambda, + _interpolate_model, + _score_lambda_path) class LogitNet(BaseEstimator): diff --git a/glmnet/scorer.py b/glmnet/scorer.py index ae2bc05..1f93413 100644 --- a/glmnet/scorer.py +++ b/glmnet/scorer.py @@ -21,10 +21,9 @@ roc_auc_score, average_precision_score, precision_score, recall_score, log_loss) from sklearn.utils.multiclass import type_of_target -import six -class _BaseScorer(six.with_metaclass(ABCMeta, object)): +class _BaseScorer(metaclass=ABCMeta): def __init__(self, score_func, sign, kwargs): self._kwargs = kwargs self._score_func = score_func @@ -173,7 +172,7 @@ def _factory_args(self): def get_scorer(scoring): - if isinstance(scoring, six.string_types): + if isinstance(scoring, str): try: scorer = SCORERS[scoring] except KeyError: diff --git a/glmnet/tests/__init__.py b/glmnet/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/glmnet/tests/test_linear.py b/glmnet/tests/test_linear.py index 1983b15..988f4fc 100644 --- a/glmnet/tests/test_linear.py +++ b/glmnet/tests/test_linear.py @@ -9,7 +9,7 @@ from sklearn.utils import estimator_checks from sklearn.utils.testing import ignore_warnings -from util import sanity_check_regression +from glmnet.tests.util import sanity_check_regression from glmnet import ElasticNet diff --git a/glmnet/tests/test_logistic.py b/glmnet/tests/test_logistic.py index a58e131..9067c4e 100644 --- a/glmnet/tests/test_logistic.py +++ b/glmnet/tests/test_logistic.py @@ -10,7 +10,7 @@ from sklearn.utils import estimator_checks, class_weight from sklearn.utils.testing import ignore_warnings -from util import sanity_check_logistic +from glmnet.tests.util import sanity_check_logistic from glmnet import LogitNet diff --git a/glmnet/tests/test_pandas.py b/glmnet/tests/test_pandas.py index 8f7fe48..7b6fe07 100644 --- a/glmnet/tests/test_pandas.py +++ b/glmnet/tests/test_pandas.py @@ -3,7 +3,7 @@ from sklearn.datasets import make_regression, make_classification from glmnet import LogitNet, ElasticNet -from util import sanity_check_logistic, sanity_check_regression +from glmnet.tests.util import sanity_check_logistic, sanity_check_regression pd = None try: diff --git a/glmnet/util.py b/glmnet/util.py index c708a85..c469fb8 100644 --- a/glmnet/util.py +++ b/glmnet/util.py @@ -9,7 +9,7 @@ from sklearn.exceptions import UndefinedMetricWarning from joblib import Parallel, delayed -from .scorer import check_scoring +from glmnet.scorer import check_scoring def _score_lambda_path(est, X, y, groups, sample_weight, relative_penalties, diff --git a/setup.py b/setup.py index c591d58..347bbca 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ " \n $ pip install numpy") -_VERSION = "2.2.0" +_VERSION = "2.2.1" f_compile_args = ['-ffixed-form', '-fdefault-real-8']