diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 8bc21b89..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 @@ -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 diff --git a/skops/card/_model_card.py b/skops/card/_model_card.py index 02cd8000..0f7ffaf4 100644 --- a/skops/card/_model_card.py +++ b/skops/card/_model_card.py @@ -21,6 +21,7 @@ from skops.card._templates import CONTENT_PLACEHOLDER, SKOPS_TEMPLATE, Templates from skops.io import load +from skops.utils._fixes import boxplot from skops.utils.importutils import import_or_raise if sys.version_info >= (3, 11): @@ -28,13 +29,11 @@ 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 " @@ -1225,9 +1224,10 @@ 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/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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" diff --git a/skops/utils/_fixes.py b/skops/utils/_fixes.py new file mode 100644 index 00000000..212cb08f --- /dev/null +++ b/skops/utils/_fixes.py @@ -0,0 +1,8 @@ +def boxplot(ax, *, tick_labels, **kwargs): + """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: + return ax.boxplot(labels=tick_labels, **kwargs)