Skip to content

Commit 7a115e1

Browse files
authored
Merge branch 'master' into use-auditwheel
2 parents 74b2443 + 4040edf commit 7a115e1

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

.github/workflows/release_drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
pull-requests: read
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: release-drafter/release-drafter@v6.1.0
18+
- uses: release-drafter/release-drafter@v6.2.0
1919
with:
2020
config-name: release-drafter.yml
2121
disable-autolabeler: true

tests/python_package_test/test_plotting.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,28 @@ def test_plot_importance(params, breast_cancer_split, train_data):
9999
with pytest.raises(TypeError, match="xlim must be a tuple of 2 elements."):
100100
lgb.plot_importance(gbm0, title=None, xlabel=None, ylabel=None, xlim="not a tuple")
101101

102+
ax5 = lgb.plot_importance(gbm0, title=None, xlabel=None, ylabel=None, ylim=(0, 30))
103+
assert isinstance(ax5, matplotlib.axes.Axes)
104+
assert ax5.get_title() == ""
105+
assert ax5.get_xlabel() == ""
106+
assert ax5.get_ylabel() == ""
107+
assert ax5.get_ylim() == (0, 30)
108+
assert len(ax5.patches) <= 30
109+
110+
with pytest.raises(TypeError, match="ylim must be a tuple of 2 elements."):
111+
lgb.plot_importance(gbm0, title=None, xlabel=None, ylabel=None, ylim="not a tuple")
112+
113+
ax6 = lgb.plot_importance(gbm0, title=None, xlabel=None, ylabel=None, figsize=(0, 30))
114+
assert isinstance(ax6, matplotlib.axes.Axes)
115+
assert ax6.get_title() == ""
116+
assert ax6.get_xlabel() == ""
117+
assert ax6.get_ylabel() == ""
118+
assert list(ax6.get_figure().get_size_inches()) == [0, 30]
119+
assert len(ax6.patches) <= 30
120+
121+
with pytest.raises(TypeError, match="figsize must be a tuple of 2 elements."):
122+
lgb.plot_importance(gbm0, title=None, xlabel=None, ylabel=None, figsize="not a tuple")
123+
102124
gbm2 = lgb.LGBMClassifier(n_estimators=10, num_leaves=3, verbose=-1, importance_type="gain")
103125
gbm2.fit(X_train, y_train)
104126

0 commit comments

Comments
 (0)