Skip to content

Commit

Permalink
Old python type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
multimeric committed Aug 15, 2024
1 parent 91c7ea9 commit 2512d3c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/lls_core/models/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from lls_core.writers import RoiIndex, Writer
from lls_core.workflow import RawWorkflowOutput
from pandas import DataFrame, Series
from collections.abc import Iterable

if TYPE_CHECKING:
from lls_core.models.lattice_data import LatticeData
Expand Down Expand Up @@ -79,7 +78,7 @@ def save_image(self):
DataFrame
]

class WorkflowSlices(ProcessedSlices[Tuple[RawWorkflowOutput] | RawWorkflowOutput]):
class WorkflowSlices(ProcessedSlices[Union[Tuple[RawWorkflowOutput], RawWorkflowOutput]]):
"""
The counterpart of `ImageSlices`, but for workflow outputs.
This is needed because workflows have vastly different outputs that may include regular
Expand All @@ -94,7 +93,7 @@ def process(self) -> Iterable[Tuple[RoiIndex, ProcessedWorkflowOutput]]:

# Handle each ROI separately
for roi, roi_results in groupby(self.slices, key=lambda it: it.roi_index):
values: list[Writer | list] = []
values: list[Union[Writer, list]] = []
for result in roi_results:
# If the user didn't return a tuple, put it into one
data = result.data if isinstance(result.data, (tuple, list)) else (result.data,)
Expand Down

0 comments on commit 2512d3c

Please sign in to comment.