Skip to content

Commit

Permalink
[python] make dump_text() private (#2434)
Browse files Browse the repository at this point in the history
* make dump_text() private

* updated test
  • Loading branch information
StrikerRUS authored and guolinke committed Sep 26, 2019
1 parent 2bf9a0f commit a0a117a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python-package/lightgbm/basic.py
Expand Up @@ -1588,7 +1588,7 @@ def add_features_from(self, other):
_safe_call(_LIB.LGBM_DatasetAddFeaturesFrom(self.handle, other.handle))
return self

def dump_text(self, filename):
def _dump_text(self, filename):
"""Save Dataset to a text file.
This format cannot be loaded back in by LightGBM, but is useful for debugging purposes.
Expand Down
4 changes: 2 additions & 2 deletions tests/python_package_test/test_basic.py
Expand Up @@ -127,11 +127,11 @@ def test_add_features_equal_data_on_alternating_used_unused(self):
d1.add_features_from(d2)
with tempfile.NamedTemporaryFile() as f:
d1name = f.name
d1.dump_text(d1name)
d1._dump_text(d1name)
d = lgb.Dataset(X, feature_name=names).construct()
with tempfile.NamedTemporaryFile() as f:
dname = f.name
d.dump_text(dname)
d._dump_text(dname)
with open(d1name, 'rt') as d1f:
d1txt = d1f.read()
with open(dname, 'rt') as df:
Expand Down

0 comments on commit a0a117a

Please sign in to comment.