Skip to content

Commit 3fcc254

Browse files
Move is_processed into BaseDataset
1 parent c69bb49 commit 3fcc254

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

mantidimaging/core/data/dataset.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,6 @@ def set_stack(self, file_type: FILE_TYPES, image_stack: ImageStack) -> None:
174174
else:
175175
raise AttributeError(f"StrictDataset does not have an attribute for {attr_name}")
176176

177-
178-
class MixedDataset(BaseDataset):
179-
pass
180-
181-
182-
class StrictDataset(BaseDataset):
183-
184177
@property
185178
def is_processed(self) -> bool:
186179
"""
@@ -192,6 +185,14 @@ def is_processed(self) -> bool:
192185
return False
193186

194187

188+
class MixedDataset(BaseDataset):
189+
pass
190+
191+
192+
class StrictDataset(BaseDataset):
193+
pass
194+
195+
195196
def _get_stack_data_type(stack_id: uuid.UUID, dataset: BaseDataset) -> str:
196197
"""
197198
Find the data type as a string of a stack.

mantidimaging/core/data/test/dataset_test.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,3 +279,12 @@ def test_set_stack_by_type_180(self):
279279
ds.set_stack(FILE_TYPES.PROJ_180, stack)
280280

281281
self.assertEqual(ds.proj180deg, stack)
282+
283+
def test_processed_is_true(self):
284+
ds = BaseDataset(sample=generate_images())
285+
ds.sample.record_operation("", "")
286+
self.assertTrue(ds.is_processed)
287+
288+
def test_processed_is_false(self):
289+
ds = BaseDataset(sample=generate_images())
290+
self.assertFalse(ds.is_processed)

0 commit comments

Comments
 (0)