diff --git a/deepsensor/data/loader.py b/deepsensor/data/loader.py index 17ef8de9..bce3fd39 100644 --- a/deepsensor/data/loader.py +++ b/deepsensor/data/loader.py @@ -18,7 +18,7 @@ class TaskLoader: def __init__( self, - task_loader_ID: str | None = None, + task_loader_ID: Union[str, None] = None, context: Union[ xr.DataArray, xr.Dataset, @@ -35,7 +35,7 @@ def __init__( ] = None, aux_at_contexts: Union[xr.DataArray, xr.Dataset, str] = None, aux_at_targets: Union[xr.DataArray, xr.Dataset, str] = None, - links: List[Tuple[int, int]] | None = None, + links: Union[List[Tuple[int, int]], None] = None, context_delta_t: Union[int, List[int]] = 0, target_delta_t: Union[int, List[int]] = 0, time_freq: str = "D", diff --git a/deepsensor/data/processor.py b/deepsensor/data/processor.py index d3f106d2..841104fe 100644 --- a/deepsensor/data/processor.py +++ b/deepsensor/data/processor.py @@ -20,12 +20,12 @@ class DataProcessor: def __init__( self, - folder: str | None = None, + folder: Union[str, None] = None, time_name: str = "time", x1_name: str = "x1", x2_name: str = "x2", - x1_map: tuple | None = None, - x2_map: tuple | None = None, + x1_map: Union[tuple, None] = None, + x2_map: Union[tuple, None] = None, deepcopy: bool = True, verbose: bool = False, ): diff --git a/deepsensor/model/defaults.py b/deepsensor/model/defaults.py index ddd1b5af..e85088dc 100644 --- a/deepsensor/model/defaults.py +++ b/deepsensor/model/defaults.py @@ -9,6 +9,8 @@ compute_pandas_data_resolution, ) +from typing import List + def gen_ppu(task_loader: TaskLoader) -> int: """Computes data-informed settings for the model's internal grid density (ppu, points per unit) @@ -55,7 +57,7 @@ def gen_decoder_scale(model_ppu: int) -> float: return 1 / model_ppu -def gen_encoder_scales(model_ppu: int, task_loader: TaskLoader) -> list[float]: +def gen_encoder_scales(model_ppu: int, task_loader: TaskLoader) -> List[float]: """Computes data-informed settings for the encoder SetConv scale for each context set This sets the length scale of the Gaussian basis functions used to encode the context sets.