From effd5bad28fc8f777b08cb4ec44cd365b19a9f74 Mon Sep 17 00:00:00 2001 From: adrinjalali Date: Mon, 3 Jun 2024 17:46:25 +0200 Subject: [PATCH 1/8] MNT refresh expired token --- skops/hub_utils/tests/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skops/hub_utils/tests/common.py b/skops/hub_utils/tests/common.py index 4903c6bf..f06f3b6a 100644 --- a/skops/hub_utils/tests/common.py +++ b/skops/hub_utils/tests/common.py @@ -1,2 +1,2 @@ # This is the token for the skops user on the hub, used for the CI. -HF_HUB_TOKEN = "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" +HF_HUB_TOKEN = "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" From 361f566ddf7a732a5a9d083b29e491060f9d8cb3 Mon Sep 17 00:00:00 2001 From: adrinjalali Date: Tue, 4 Jun 2024 16:33:52 +0200 Subject: [PATCH 2/8] fix matplotlib deprecation --- skops/card/_model_card.py | 5 +++-- skops/utils/_fixes.py | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 skops/utils/_fixes.py diff --git a/skops/card/_model_card.py b/skops/card/_model_card.py index 02cd8000..558ccc8b 100644 --- a/skops/card/_model_card.py +++ b/skops/card/_model_card.py @@ -22,6 +22,7 @@ from skops.card._templates import CONTENT_PLACEHOLDER, SKOPS_TEMPLATE, Templates from skops.io import load from skops.utils.importutils import import_or_raise +from skops.utils._fixes import boxplot if sys.version_info >= (3, 11): from typing import Self @@ -1225,9 +1226,9 @@ def add_permutation_importances( ) sorted_importances_idx = permutation_importances.importances_mean.argsort() _, ax = plt.subplots() - ax.boxplot( + boxplot(ax, x=permutation_importances.importances[sorted_importances_idx].T, - labels=columns[sorted_importances_idx], + tick_labels=columns[sorted_importances_idx], vert=False, ) ax.set_title(plot_name) diff --git a/skops/utils/_fixes.py b/skops/utils/_fixes.py new file mode 100644 index 00000000..f0cd4838 --- /dev/null +++ b/skops/utils/_fixes.py @@ -0,0 +1,6 @@ +def boxplot(ax,*, tick_labels, **kwargs): + """A function to handle labels->tick_labels deprecation.""" + try: + return ax.boxplot(tick_labels=tick_labels, **kwargs) + except TypeError: + return ax.boxplot(labels=tick_labels, **kwargs) \ No newline at end of file From d4c8ef13ec56edb0a2a5769b98172306d25f1be9 Mon Sep 17 00:00:00 2001 From: adrinjalali Date: Tue, 4 Jun 2024 16:40:34 +0200 Subject: [PATCH 3/8] reformat --- skops/card/_model_card.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/skops/card/_model_card.py b/skops/card/_model_card.py index 558ccc8b..0f7ffaf4 100644 --- a/skops/card/_model_card.py +++ b/skops/card/_model_card.py @@ -21,21 +21,19 @@ from skops.card._templates import CONTENT_PLACEHOLDER, SKOPS_TEMPLATE, Templates from skops.io import load -from skops.utils.importutils import import_or_raise from skops.utils._fixes import boxplot +from skops.utils.importutils import import_or_raise if sys.version_info >= (3, 11): from typing import Self else: from typing_extensions import Self - # Repr attributes can be used to control the behavior of repr aRepr = Repr() aRepr.maxother = 79 aRepr.maxstring = 79 - VALID_TEMPLATES = {item.value for item in Templates} NEED_SECTION_ERR_MSG = ( "You are trying to {action} but you're using a custom template, please pass the " @@ -1226,7 +1224,8 @@ def add_permutation_importances( ) sorted_importances_idx = permutation_importances.importances_mean.argsort() _, ax = plt.subplots() - boxplot(ax, + boxplot( + ax, x=permutation_importances.importances[sorted_importances_idx].T, tick_labels=columns[sorted_importances_idx], vert=False, From 665f1a23c4b90cdbb3724645240370e02e7affad Mon Sep 17 00:00:00 2001 From: adrinjalali Date: Tue, 4 Jun 2024 16:42:45 +0200 Subject: [PATCH 4/8] reformat --- skops/utils/_fixes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skops/utils/_fixes.py b/skops/utils/_fixes.py index f0cd4838..ca6dbba1 100644 --- a/skops/utils/_fixes.py +++ b/skops/utils/_fixes.py @@ -1,6 +1,6 @@ -def boxplot(ax,*, tick_labels, **kwargs): +def boxplot(ax, *, tick_labels, **kwargs): """A function to handle labels->tick_labels deprecation.""" try: return ax.boxplot(tick_labels=tick_labels, **kwargs) except TypeError: - return ax.boxplot(labels=tick_labels, **kwargs) \ No newline at end of file + return ax.boxplot(labels=tick_labels, **kwargs) From d58abfb767629b81cbe1e42f5c61843809b838ba Mon Sep 17 00:00:00 2001 From: adrinjalali Date: Tue, 4 Jun 2024 16:45:58 +0200 Subject: [PATCH 5/8] add version comment --- skops/utils/_fixes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/skops/utils/_fixes.py b/skops/utils/_fixes.py index ca6dbba1..212cb08f 100644 --- a/skops/utils/_fixes.py +++ b/skops/utils/_fixes.py @@ -1,5 +1,7 @@ def boxplot(ax, *, tick_labels, **kwargs): - """A function to handle labels->tick_labels deprecation.""" + """A function to handle labels->tick_labels deprecation. + labels is deprecated in 3.9 and removed in 3.11. + """ try: return ax.boxplot(tick_labels=tick_labels, **kwargs) except TypeError: From 21e8065cebf812c5834394e0281f2f2538ab66b3 Mon Sep 17 00:00:00 2001 From: adrinjalali Date: Tue, 4 Jun 2024 16:54:12 +0200 Subject: [PATCH 6/8] add codecov token --- .codecov.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.codecov.yml b/.codecov.yml index 26aa1c1a..a245a6e8 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -2,6 +2,7 @@ comment: false codecov: branch: main require_ci_to_pass: true + token: 2b8d4d69-6de6-4e1d-840a-5ccf9d849565 notify: after_n_builds: 12 wait_for_ci: true From cf75a71d9eba053283bd9a560de023155599fab0 Mon Sep 17 00:00:00 2001 From: adrinjalali Date: Tue, 4 Jun 2024 17:01:09 +0200 Subject: [PATCH 7/8] token changed? --- .codecov.yml | 1 - .github/workflows/build-test.yml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index a245a6e8..26aa1c1a 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -2,7 +2,6 @@ comment: false codecov: branch: main require_ci_to_pass: true - token: 2b8d4d69-6de6-4e1d-840a-5ccf9d849565 notify: after_n_builds: 12 wait_for_ci: true diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 8bc21b89..2c6f0a86 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -101,4 +101,4 @@ jobs: # the coverage is uploaded with or without a token. This only helps with some # codecov errors. It's a recommended action from here: # https://github.com/codecov/codecov-action/issues/837#issuecomment-1453877750 - token: 79395387-e193-4b18-b2ee-74a3b8dce269 + token: 2b8d4d69-6de6-4e1d-840a-5ccf9d849565 From 5ee9da0402816b3828f54dea9c2b6b2133b1c343 Mon Sep 17 00:00:00 2001 From: adrinjalali Date: Tue, 4 Jun 2024 17:10:57 +0200 Subject: [PATCH 8/8] revert to codecov uploader v3 --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 2c6f0a86..86aa2aaf 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -90,7 +90,7 @@ jobs: python -m pytest -s -v -m "inference" skops/ - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v3 with: env_vars: OS,PYTHON fail_ci_if_error: true