Skip to content

Commit

Permalink
Move is_processed into BaseDataset
Browse files Browse the repository at this point in the history
  • Loading branch information
samtygier-stfc committed Aug 7, 2024
1 parent c69bb49 commit 3fcc254
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
15 changes: 8 additions & 7 deletions mantidimaging/core/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,6 @@ def set_stack(self, file_type: FILE_TYPES, image_stack: ImageStack) -> None:
else:
raise AttributeError(f"StrictDataset does not have an attribute for {attr_name}")


class MixedDataset(BaseDataset):
pass


class StrictDataset(BaseDataset):

@property
def is_processed(self) -> bool:
"""
Expand All @@ -192,6 +185,14 @@ def is_processed(self) -> bool:
return False


class MixedDataset(BaseDataset):
pass


class StrictDataset(BaseDataset):
pass


def _get_stack_data_type(stack_id: uuid.UUID, dataset: BaseDataset) -> str:
"""
Find the data type as a string of a stack.
Expand Down
9 changes: 9 additions & 0 deletions mantidimaging/core/data/test/dataset_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,3 +279,12 @@ def test_set_stack_by_type_180(self):
ds.set_stack(FILE_TYPES.PROJ_180, stack)

self.assertEqual(ds.proj180deg, stack)

def test_processed_is_true(self):
ds = BaseDataset(sample=generate_images())
ds.sample.record_operation("", "")
self.assertTrue(ds.is_processed)

def test_processed_is_false(self):
ds = BaseDataset(sample=generate_images())
self.assertFalse(ds.is_processed)

0 comments on commit 3fcc254

Please sign in to comment.