Skip to content

Commit

Permalink
Remove Python 3.7 and 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
adedaran committed Jul 17, 2024
1 parent 1b9bd01 commit 6c38070
Show file tree
Hide file tree
Showing 8 changed files with 1,164 additions and 1,544 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2,653 changes: 1,146 additions & 1,507 deletions poetry.lock

Large diffs are not rendered by default.

43 changes: 10 additions & 33 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,21 @@ repository = "https://github.com/DataDome/sliceline"
documentation = "https://sliceline.readthedocs.io/en/stable/"

[tool.poetry.dependencies]
python = ">=3.7, <3.12"
numpy = [
{ version = "^1.21", python = "<3.9" },
{ version = "^1.25", python = ">=3.9" },
]
scikit-learn = [
{ version = "^1", python = "<3.8" },
{ version = "^1.3", python = ">=3.8,<3.9" },
{ version = "^1.4", python = ">=3.9" },
]
scipy = [
{ version = "^1", python = "<3.9" },
{ version = "^1.12", python = ">=3.9" },
]
python = ">=3.9, <3.12"
numpy = "^1.25"
scikit-learn = "^1.5.0"
scipy = "^1.12"

[tool.poetry.dev-dependencies]
black = [
{ version = "^23", python = "<3.8" },
{ version = "^24", python = ">=3.8" },
]
flake8 = [
{ version = "^5", python = "<3.8.1" },
{ version = "^6", python = ">=3.8.1" },
]
black = "^24"
flake8 = "^6"
jupyter = "^1.0.0"
matplotlib = [
{ version = "^3", python = "<3.8" },
{ version = "^3.7", python = ">=3.8,<3.9" },
{ version = "^3.8", python = ">=3.9" },
]
matplotlib = "^3.8"
nbconvert = "^6.5.0"
optbinning = "^0.15.0"
pandas = [
{ version = "^1", python = "<3.9" },
{ version = "^1.5", python = ">=3.9" },
]
pytest = "^6.2.5"
pytest-benchmark = "^3.4.1"
pandas = "^1.5"
pytest = "^7.2.0"
pytest-benchmark = "^4.0.0"
pytest-cov = "^3.0.0"
Sphinx = "^4.0.0"
sphinx-rtd-theme = "^1.0.0"
Expand Down
4 changes: 3 additions & 1 deletion sliceline/slicefinder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The slicefinder module implements the Slicefinder class.
"""

import logging
from typing import Tuple, Union

Expand Down Expand Up @@ -426,7 +427,8 @@ def _get_pruned_s_r(
self, slices: sp.csr_matrix, statistics: np.ndarray
) -> Tuple[sp.csr_matrix, np.ndarray]:
"""Prune invalid slices.
Do not affect overall pruning effectiveness due to handling of missing parents."""
Do not affect overall pruning effectiveness due to handling of missing parents.
"""
valid_slices_mask = (statistics[:, 3] >= self.min_sup) & (
statistics[:, 1] > 0
)
Expand Down
1 change: 0 additions & 1 deletion sliceline/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ def check_array(
estimator=None,
input_name="",
):

"""Input validation on an array, list, sparse matrix or similar.
By default, the input is checked to be a non-empty 2D array containing
Expand Down
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- basic_test_data
- experiments
"""

import numpy as np
import pytest
from scipy import sparse as sp
Expand Down Expand Up @@ -35,7 +36,7 @@ def basic_test_data():
).T

# error or label of elements
# By default, the algorithm identifies slices targeting 0 of E.
# By default, the algorithm identifies slices targeting 1 of errors.
errors = np.array([1, 1, 1, 1, 0, 0, 0, 0])

slicefinder_model = slicefinder.Slicefinder(
Expand Down
1 change: 1 addition & 0 deletions tests/experiment.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The experiment module implements the Experiment dataclass.
"""

from dataclasses import dataclass
from typing import Dict, List, Union

Expand Down
1 change: 1 addition & 0 deletions tests/test_slicefinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
The test_slicefinder module tests slicefinder class and methods.
Tests are run on different Experiments.
"""

import numpy as np
import pytest
from scipy import sparse as sp
Expand Down

0 comments on commit 6c38070

Please sign in to comment.