Skip to content

Commit

Permalink
fix: typing imports
Browse files Browse the repository at this point in the history
  • Loading branch information
madtoinou committed Nov 8, 2024
1 parent 21b34f1 commit e9b53b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
8 changes: 1 addition & 7 deletions darts/explainability/tft_explainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"""

from collections.abc import Sequence
from typing import Optional, Union
from typing import Literal, Optional, Union

import matplotlib.axes
import matplotlib.pyplot as plt
Expand All @@ -38,12 +38,6 @@
from darts.models import TFTModel
from darts.utils.utils import generate_index

try:
from typing import Literal
except ImportError:
from typing_extensions import Literal


logger = get_logger(__name__)


Expand Down
5 changes: 3 additions & 2 deletions darts/models/forecasting/arima.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
.. [1] https://wikipedia.org/wiki/Autoregressive_integrated_moving_average
"""

import sys
from collections.abc import Sequence
from typing import Literal, Optional, Union

try:
if sys.version_info >= (3, 10):
from typing import TypeAlias
except ImportError:
else:
from typing_extensions import TypeAlias

import numpy as np
Expand Down
7 changes: 1 addition & 6 deletions darts/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
from copy import deepcopy
from inspect import signature
from io import StringIO
from typing import Any, Callable, Optional, Union
from typing import Any, Callable, Literal, Optional, Union

import matplotlib.axes
import matplotlib.pyplot as plt
Expand All @@ -60,11 +60,6 @@
n_steps_between,
)

try:
from typing import Literal
except ImportError:
from typing_extensions import Literal

if sys.version_info >= (3, 11):
from typing import Self
else:
Expand Down

0 comments on commit e9b53b5

Please sign in to comment.