Skip to content

Commit

Permalink
fix: linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tilman151 committed Jan 30, 2024
1 parent 3a9a62b commit 4c49ed4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions rul_datasets/adaption.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

import warnings
from copy import deepcopy
from typing import List, Optional, Any, Tuple, Callable, Sequence, Union, cast
from typing import List, Optional, Any, Tuple, Callable, Sequence, cast

import numpy as np
import pytorch_lightning as pl
import torch
from torch.utils.data import DataLoader, Dataset
from torch.utils.data.dataset import ConcatDataset, TensorDataset
from torch.utils.data import DataLoader, Dataset, ConcatDataset

from rul_datasets import utils
from rul_datasets.core import PairedRulDataset, RulDataModule, RulDataset


Expand Down
2 changes: 1 addition & 1 deletion rul_datasets/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ class RulDataset(Dataset):
def __init__(
self,
features: List[np.ndarray],
*targets: Tuple[List[np.ndarray]],
*targets: List[np.ndarray],
copy_tensors: bool = False,
) -> None:
"""
Expand Down
2 changes: 1 addition & 1 deletion rul_datasets/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def to_tensor(
) -> Tuple[List[torch.Tensor], ...]:
dtype = torch.float32
tensor_feats = [feature_to_tensor(f, dtype, copy) for f in features]
convert = torch.tensor if copy else torch.as_tensor
convert: Callable = torch.tensor if copy else torch.as_tensor # type: ignore
tensor_targets = [[convert(t, dtype=dtype) for t in target] for target in targets]

return tensor_feats, *tensor_targets
Expand Down

0 comments on commit 4c49ed4

Please sign in to comment.