diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d2eee06f..4ee54f84 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -52,7 +52,7 @@ repos: rev: v2.3.1 hooks: - id: mypy - additional_dependencies: [types-setuptools] + additional_dependencies: [types-setuptools, xgboost] - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.16.4 hooks: diff --git a/ops/conda_env/dev.yml b/ops/conda_env/dev.yml index 37b55e4b..76441ef4 100644 --- a/ops/conda_env/dev.yml +++ b/ops/conda_env/dev.yml @@ -2,7 +2,7 @@ name: dev channels: - conda-forge dependencies: -- python=3.12 +- python=3.13 - numpy - scipy - pandas @@ -13,7 +13,7 @@ dependencies: - coverage - codecov - ninja -- lcov +- lcov<2.0 - cmake - llvm-openmp - cython diff --git a/ops/cpp-python-coverage.sh b/ops/cpp-python-coverage.sh index db5eb2f4..69aa550d 100755 --- a/ops/cpp-python-coverage.sh +++ b/ops/cpp-python-coverage.sh @@ -2,9 +2,6 @@ set -euo pipefail -echo "##[section]Installing lcov and Ninja..." -sudo apt-get install lcov ninja-build - echo "##[section]Building Treelite..." mkdir build/ cd build/ diff --git a/python/treelite/sklearn/importer.py b/python/treelite/sklearn/importer.py index 8b2c0bc9..1d7f3d94 100644 --- a/python/treelite/sklearn/importer.py +++ b/python/treelite/sklearn/importer.py @@ -431,9 +431,7 @@ def _import_hist_gradient_boosting(sklearn_model) -> Model: feat_remapper[n_categorical + num_idx] = i num_idx += 1 else: - feat_remapper = np.arange( - start=0, stop=sklearn_model.n_features_in_, dtype=np.int32 - ) + feat_remapper = np.arange(0, stop=sklearn_model.n_features_in_, dtype=np.int32) n_categorical_splits = known_cat_bitsets.shape[0] n_trees = 0 diff --git a/tests/python/util.py b/tests/python/util.py index f7dc7e8e..74a3258a 100644 --- a/tests/python/util.py +++ b/tests/python/util.py @@ -94,7 +94,9 @@ def to_categorical( cat_cols = (cat_cols * rough_n_categories).astype(int) # Mix categorical and numerical columns in a random order - new_col_idx = rng.choice(n_features, n_features, replace=False, shuffle=True) + new_col_idx = np.asarray( + rng.choice(n_features, n_features, replace=False, shuffle=True) + ) df_cols = {} for icol in range(n_categorical): col = cat_cols[:, icol]