Skip to content

Commit a851f5d

Browse files
Remove unused is_dataset_strict methods
1 parent 404665c commit a851f5d

File tree

6 files changed

+0
-42
lines changed

6 files changed

+0
-42
lines changed

mantidimaging/gui/windows/main/model.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -256,15 +256,3 @@ def recon_list_ids(self) -> list[uuid.UUID]:
256256

257257
def get_recon_list_id(self, parent_id: uuid.UUID) -> uuid.UUID:
258258
return self.datasets[parent_id].recons.id
259-
260-
def is_dataset_strict(self, ds_id: uuid.UUID) -> bool:
261-
"""
262-
:param ds_id: The dataset ID
263-
:return: True if the dataset is Strict, False otherwise
264-
"""
265-
for ds in self.datasets.values():
266-
if ds.id == ds_id:
267-
if isinstance(ds, StrictDataset):
268-
return True
269-
return False
270-
raise RuntimeError(f"Unable to find dataset with ID {ds_id}")

mantidimaging/gui/windows/main/presenter.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -843,9 +843,6 @@ def _create_strict_dataset_stack_name(stack_type: str, dataset_name: str) -> str
843843
"""
844844
return f"{stack_type} {dataset_name}"
845845

846-
def is_dataset_strict(self, ds_id: uuid.UUID) -> bool:
847-
return self.model.is_dataset_strict(ds_id)
848-
849846
def do_update_UI(self) -> None:
850847
if settings.value('use_os_defaults', defaultValue='True') == 'True':
851848
extra_style = settings.value('extra_style_default')

mantidimaging/gui/windows/main/test/model_test.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -538,17 +538,3 @@ def test_do_nexus_save_success(self, nexus_save):
538538

539539
self.model.do_nexus_saving(sd.id, path, sample_name, save_as_float)
540540
nexus_save.assert_called_once_with(sd, path, sample_name, save_as_float)
541-
542-
def test_is_dataset_strict_returns_true(self):
543-
strict_ds = StrictDataset(sample=generate_images())
544-
self.model.add_dataset_to_model(strict_ds)
545-
self.assertTrue(self.model.is_dataset_strict(strict_ds.id))
546-
547-
def test_is_dataset_strict_returns_false(self):
548-
mixed_ds = MixedDataset(stacks=[generate_images()])
549-
self.model.add_dataset_to_model(mixed_ds)
550-
self.assertFalse(self.model.is_dataset_strict(mixed_ds.id))
551-
552-
def test_is_dataset_strict_raises(self):
553-
with self.assertRaises(RuntimeError):
554-
self.model.is_dataset_strict(uuid.uuid4())

mantidimaging/gui/windows/main/test/presenter_test.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,11 +1060,6 @@ def test_move_stack_to_strict_dataset(self):
10601060
self.assertNotIn(stack_to_move, origin_dataset)
10611061
assert stack_to_move.name == new_stack_name
10621062

1063-
def test_is_dataset_strict(self):
1064-
ds_id = "ds-id"
1065-
self.presenter.is_dataset_strict(ds_id)
1066-
self.model.is_dataset_strict.assert_called_once_with(ds_id)
1067-
10681063

10691064
if __name__ == '__main__':
10701065
unittest.main()

mantidimaging/gui/windows/main/test/view_test.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -515,11 +515,6 @@ def test_show_move_stack_dialog(self):
515515
stack_data_type)
516516
move_stack_mock.return_value.show.assert_called_once()
517517

518-
def test_is_dataset_strict(self):
519-
ds_id = "ds-id"
520-
self.view.is_dataset_strict(ds_id)
521-
self.presenter.is_dataset_strict.assert_called_once_with(ds_id)
522-
523518
@mock.patch("PyQt5.QtWidgets.QFileDialog.getExistingDirectory")
524519
@mock.patch("mantidimaging.gui.windows.main.MainWindowView.show_live_viewer")
525520
def test_live_viewer_asks_for_data_dir(self, mock_show_live_viewer, mock_get_existing_dir):

mantidimaging/gui/windows/main/view.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,3 @@ def show_move_stack_dialog(self, origin_dataset_id: uuid.UUID, stack_id: uuid.UU
776776
self.move_stack_dialog = MoveStackDialog(self, origin_dataset_id, stack_id, origin_dataset_name,
777777
stack_data_type)
778778
self.move_stack_dialog.show()
779-
780-
def is_dataset_strict(self, ds_id: UUID) -> bool:
781-
return self.presenter.is_dataset_strict(ds_id)

0 commit comments

Comments
 (0)