Skip to content

Commit

Permalink
Merge branch 'master' into python-3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored Jan 6, 2025
2 parents c1a5a72 + e0c34e7 commit 9f3d1e5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ name: 'Lock Inactive Threads'

on:
schedule:
# midnight UTC, every Wednesday
# midnight UTC, every Wednesday, for Issues
- cron: '0 0 * * 3'
# midnight UTC, every Thursday, for PRs
- cron: '0 0 * * 4'
# allow manual triggering from GitHub UI
workflow_dispatch:

Expand Down Expand Up @@ -42,4 +44,4 @@ jobs:
# what should the locking status be?
issue-lock-reason: 'resolved'
pr-lock-reason: 'resolved'
process-only: 'issues, prs'
process-only: ${{ github.event.schedule == '0 0 * * 3' && 'issues' || 'prs' }}
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ repos:
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
args: ["--strict"]
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.3
Expand Down
14 changes: 14 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# default config: https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration
extends: default

rules:
document-start: disable
line-length:
max: 999 # temporarily increase allowed line length
truthy:
# prevent treating GitHub Workflow "on" key as boolean value
check-keys: false

# temporarily disabled rules
indentation: disable
comments-indentation: disable
6 changes: 6 additions & 0 deletions tests/python_package_test/test_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -3909,12 +3909,14 @@ def test_predict_regression_output_shape():
# 1-round model
bst = lgb.train(params, dtrain, num_boost_round=1)
assert bst.predict(X).shape == (n_samples,)
assert bst.predict(X, raw_score=True).shape == (n_samples,)
assert bst.predict(X, pred_contrib=True).shape == (n_samples, n_features + 1)
assert bst.predict(X, pred_leaf=True).shape == (n_samples, 1)

# 2-round model
bst = lgb.train(params, dtrain, num_boost_round=2)
assert bst.predict(X).shape == (n_samples,)
assert bst.predict(X, raw_score=True).shape == (n_samples,)
assert bst.predict(X, pred_contrib=True).shape == (n_samples, n_features + 1)
assert bst.predict(X, pred_leaf=True).shape == (n_samples, 2)

Expand All @@ -3929,12 +3931,14 @@ def test_predict_binary_classification_output_shape():
# 1-round model
bst = lgb.train(params, dtrain, num_boost_round=1)
assert bst.predict(X).shape == (n_samples,)
assert bst.predict(X, raw_score=True).shape == (n_samples,)
assert bst.predict(X, pred_contrib=True).shape == (n_samples, n_features + 1)
assert bst.predict(X, pred_leaf=True).shape == (n_samples, 1)

# 2-round model
bst = lgb.train(params, dtrain, num_boost_round=2)
assert bst.predict(X).shape == (n_samples,)
assert bst.predict(X, raw_score=True).shape == (n_samples,)
assert bst.predict(X, pred_contrib=True).shape == (n_samples, n_features + 1)
assert bst.predict(X, pred_leaf=True).shape == (n_samples, 2)

Expand All @@ -3950,12 +3954,14 @@ def test_predict_multiclass_classification_output_shape():
# 1-round model
bst = lgb.train(params, dtrain, num_boost_round=1)
assert bst.predict(X).shape == (n_samples, n_classes)
assert bst.predict(X, raw_score=True).shape == (n_samples, n_classes)
assert bst.predict(X, pred_contrib=True).shape == (n_samples, n_classes * (n_features + 1))
assert bst.predict(X, pred_leaf=True).shape == (n_samples, n_classes)

# 2-round model
bst = lgb.train(params, dtrain, num_boost_round=2)
assert bst.predict(X).shape == (n_samples, n_classes)
assert bst.predict(X, raw_score=True).shape == (n_samples, n_classes)
assert bst.predict(X, pred_contrib=True).shape == (n_samples, n_classes * (n_features + 1))
assert bst.predict(X, pred_leaf=True).shape == (n_samples, n_classes * 2)

Expand Down

0 comments on commit 9f3d1e5

Please sign in to comment.