Skip to content

Commit

Permalink
Add more typing_extensions for lower Python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
golmschenk committed Feb 6, 2024
1 parent 05880de commit 8f0f8b9
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 7 deletions.
5 changes: 4 additions & 1 deletion src/qusi/finite_standard_light_curve_dataset.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from dataclasses import dataclass
from functools import partial
from typing import List, Callable, Any, Self
try:
from typing import List, Callable, Any, Self
except ImportError:
from typing_extensions import List, Callable, Any, Self

import numpy as np
from torch.utils.data import Dataset
Expand Down
5 changes: 4 additions & 1 deletion src/qusi/finite_test_session.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from typing import List
try:
from typing import List
except ImportError:
from typing_extensions import List

import torch
from torch.nn import Module
Expand Down
5 changes: 4 additions & 1 deletion src/qusi/infer_session.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from typing import List
try:
from typing import List
except ImportError:
from typing_extensions import List

import numpy as np
import torch
Expand Down
5 changes: 4 additions & 1 deletion src/qusi/light_curve_transforms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from typing import Tuple
try:
from typing import Tuple
except ImportError:
from typing_extensions import Tuple

import torch
import numpy.typing as npt
Expand Down
5 changes: 4 additions & 1 deletion src/qusi/train_logging_configuration.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
from dataclasses import dataclass
from typing import Any, Dict
try:
from typing import Any, Dict
except ImportError:
from typing_extensions import Any, Dict


@dataclass
Expand Down
5 changes: 4 additions & 1 deletion src/qusi/train_session.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
from pathlib import Path
from typing import List, Optional
try:
from typing import List, Optional
except ImportError:
from typing_extensions import List, Optional

import numpy as np
import stringcase
Expand Down
5 changes: 4 additions & 1 deletion src/qusi/wandb_liaison.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from typing import Any, Dict
try:
from typing import Any, Dict
except ImportError:
from typing_extensions import Any, Dict

import wandb as wandb

Expand Down

0 comments on commit 8f0f8b9

Please sign in to comment.