Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
06a1ee25
Unverified
Commit
06a1ee25
authored
Nov 04, 2022
by
Madnex
Committed by
GitHub
Nov 04, 2022
Browse files
[python-package] prefix several internal functions with _ (#5545)
parent
0c5f46f8
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
68 deletions
+68
-68
python-package/lightgbm/basic.py
python-package/lightgbm/basic.py
+64
-64
tests/python_package_test/test_basic.py
tests/python_package_test/test_basic.py
+4
-4
No files found.
python-package/lightgbm/basic.py
View file @
06a1ee25
This diff is collapsed.
Click to expand it.
tests/python_package_test/test_basic.py
View file @
06a1ee25
...
@@ -609,17 +609,17 @@ def test_list_to_1d_numpy(collection, dtype):
...
@@ -609,17 +609,17 @@ def test_list_to_1d_numpy(collection, dtype):
y
=
pd_Series
(
y
)
y
=
pd_Series
(
y
)
if
isinstance
(
y
,
np
.
ndarray
)
and
len
(
y
.
shape
)
==
2
:
if
isinstance
(
y
,
np
.
ndarray
)
and
len
(
y
.
shape
)
==
2
:
with
pytest
.
warns
(
UserWarning
,
match
=
'column-vector'
):
with
pytest
.
warns
(
UserWarning
,
match
=
'column-vector'
):
lgb
.
basic
.
list_to_1d_numpy
(
y
)
lgb
.
basic
.
_
list_to_1d_numpy
(
y
)
return
return
elif
isinstance
(
y
,
list
)
and
isinstance
(
y
[
0
],
list
):
elif
isinstance
(
y
,
list
)
and
isinstance
(
y
[
0
],
list
):
with
pytest
.
raises
(
TypeError
):
with
pytest
.
raises
(
TypeError
):
lgb
.
basic
.
list_to_1d_numpy
(
y
)
lgb
.
basic
.
_
list_to_1d_numpy
(
y
)
return
return
elif
isinstance
(
y
,
pd_Series
)
and
y
.
dtype
==
object
:
elif
isinstance
(
y
,
pd_Series
)
and
y
.
dtype
==
object
:
with
pytest
.
raises
(
ValueError
):
with
pytest
.
raises
(
ValueError
):
lgb
.
basic
.
list_to_1d_numpy
(
y
)
lgb
.
basic
.
_
list_to_1d_numpy
(
y
)
return
return
result
=
lgb
.
basic
.
list_to_1d_numpy
(
y
,
dtype
=
dtype
)
result
=
lgb
.
basic
.
_
list_to_1d_numpy
(
y
,
dtype
=
dtype
)
assert
result
.
size
==
10
assert
result
.
size
==
10
assert
result
.
dtype
==
dtype
assert
result
.
dtype
==
dtype
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment