Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions ops/conda_env/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: dev
channels:
- conda-forge
dependencies:
- python=3.12
- python=3.13
- numpy
- scipy
- pandas
Expand All @@ -13,7 +13,7 @@ dependencies:
- coverage
- codecov
- ninja
- lcov
- lcov<2.0
- cmake
- llvm-openmp
- cython
Expand Down
3 changes: 0 additions & 3 deletions ops/cpp-python-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
4 changes: 1 addition & 3 deletions python/treelite/sklearn/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The start parameter in np.arange is now a positional-only argument. See numpy/numpy#30368 (comment)


n_categorical_splits = known_cat_bitsets.shape[0]
n_trees = 0
Expand Down
4 changes: 3 additions & 1 deletion tests/python/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Comment on lines +97 to +99

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mypy is conservative and assuming int return type for rng.choice(). We explicitly annotate the return type (np.ndarray) here.

df_cols = {}
for icol in range(n_categorical):
col = cat_cols[:, icol]
Expand Down
Loading