Skip to content

Commit

Permalink
[python-package] remove unnecessary layer of try-catching in conditio…
Browse files Browse the repository at this point in the history
…nal imports
  • Loading branch information
jameslamb committed Dec 11, 2024
1 parent 186c7cd commit 186d680
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions python-package/lightgbm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,10 @@
# and its dependencies as early as possible
from .basic import Booster, Dataset, Sequence, register_logger
from .callback import EarlyStopException, early_stopping, log_evaluation, record_evaluation, reset_parameter
from .dask import DaskLGBMClassifier, DaskLGBMRanker, DaskLGBMRegressor
from .engine import CVBooster, cv, train

try:
from .sklearn import LGBMClassifier, LGBMModel, LGBMRanker, LGBMRegressor
except ImportError:
pass
try:
from .plotting import create_tree_digraph, plot_importance, plot_metric, plot_split_value_histogram, plot_tree
except ImportError:
pass
try:
from .dask import DaskLGBMClassifier, DaskLGBMRanker, DaskLGBMRegressor
except ImportError:
pass

from .plotting import create_tree_digraph, plot_importance, plot_metric, plot_split_value_histogram, plot_tree
from .sklearn import LGBMClassifier, LGBMModel, LGBMRanker, LGBMRegressor

_version_path = Path(__file__).absolute().parent / "VERSION.txt"
if _version_path.is_file():
Expand Down

0 comments on commit 186d680

Please sign in to comment.