Skip to content

Commit ad2a5c2

Browse files
committed
Remove IPython as a dependency
1 parent 31159b3 commit ad2a5c2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

darts/utils/utils.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,18 @@
1010

1111
import numpy as np
1212
import pandas as pd
13-
from IPython import get_ipython
1413
from joblib import Parallel, delayed
1514
from tqdm import tqdm
1615
from tqdm.notebook import tqdm as tqdm_notebook
1716

1817
from darts import TimeSeries
1918
from darts.logging import get_logger, raise_if, raise_if_not, raise_log
2019

20+
try:
21+
from IPython import get_ipython
22+
except ModuleNotFoundError:
23+
get_ipython = None
24+
2125
logger = get_logger(__name__)
2226

2327

@@ -88,6 +92,8 @@ def _build_tqdm_iterator(iterable, verbose, **kwargs):
8892
"""
8993

9094
def _isnotebook():
95+
if get_ipython is None:
96+
return False
9197
try:
9298
shell = get_ipython().__class__.__name__
9399
if shell == "ZMQInteractiveShell":

requirements/core.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
catboost>=1.0.6
22
holidays>=0.11.1
3-
ipython>=5.0.0
43
joblib>=0.16.0
54
lightgbm>=3.2.0
65
matplotlib>=3.3.0

0 commit comments

Comments
 (0)