From 22bfd3b40db106247249158020ab776a9fa92ae6 Mon Sep 17 00:00:00 2001 From: NikoOinonen Date: Mon, 11 Mar 2024 12:53:06 +0200 Subject: [PATCH] Removed NotRequired, because it's not compatible with 3.10 --- mlspm/data_generation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mlspm/data_generation.py b/mlspm/data_generation.py index 24876c2..d9135e9 100644 --- a/mlspm/data_generation.py +++ b/mlspm/data_generation.py @@ -6,7 +6,7 @@ import time from os import PathLike from pathlib import Path -from typing import Optional, TypedDict, NotRequired +from typing import Optional, TypedDict import numpy as np from PIL import Image @@ -109,7 +109,7 @@ def get_tarinfo(fname: str, file_bytes: io.BytesIO): info.mtime = time.time() return info -class TarSample(TypedDict): +class TarSample(TypedDict, total=False): """ - ``'hartree'``: Path to the Hartree potential. First item in the tuple is the path to the tar file relative to ``base_path``, and second entry is the tar file member name. @@ -118,7 +118,7 @@ class TarSample(TypedDict): - ``'rots'``: List of rotations to generate for the sample. """ hartree: tuple[str, str] - rho: NotRequired[tuple[str, str]] + rho: tuple[str, str] rots: list[np.ndarray] class TarDataGenerator: