Skip to content

Commit

Permalink
Adjust Dict Types for ompatibility with Python < 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbhr committed Nov 25, 2024
1 parent a259edf commit 9fefaf0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
15 changes: 8 additions & 7 deletions saenopy/gui/spheroid/modules/result.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
import io
from typing import List, TypedDict, Tuple
from typing import List, TypedDict, Tuple, Union
import traceback
from natsort import natsorted
import re
Expand All @@ -17,20 +17,21 @@ class Mesh2D:
pass



class PivParametersDict(TypedDict):
window_size: int
overlap: int
n_min: int | None
n_max: int | None
n_min: Union[int, None]
n_max: Union[int, None]
thresh_segmentation: float
continuous_segmentation: bool


class ForceParametersDict(TypedDict):
lookup_table: str | None
r_min: float | None
r_max: float | None

lookup_table: Union[str, None]
r_min: Union[float, None]
r_max: Union[float, None]

class SegmentationDict(TypedDict):
mask: np.ndarray
Expand Down
12 changes: 7 additions & 5 deletions saenopy/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@
import natsort
import numpy as np
import pandas as pd
from typing import Tuple, List, TypedDict
from typing import Tuple, List, TypedDict, Union
import tifffile
import imageio

from saenopy.saveable import Saveable

class CropDict(TypedDict, total=False):
x: Tuple[int | None, int | None]
y: Tuple[int | None, int | None]
z: Tuple[int | None, int | None]
t: Tuple[int | None, int | None]
x: Tuple[Union[int, None], Union[int, None]]
y: Tuple[Union[int, None], Union[int, None]]
z: Tuple[Union[int, None], Union[int, None]]
t: Tuple[Union[int, None], Union[int, None]]





Expand Down

0 comments on commit 9fefaf0

Please sign in to comment.