Skip to content

Commit

Permalink
Remove StrictDataset from BaseEyesTest, SpectrumViewerWindowTest, Dat…
Browse files Browse the repository at this point in the history
…asetSelectorWidgetPresenterTests, SpectrumViewerWindowPresenterTest
  • Loading branch information
samtygier-stfc committed Nov 22, 2024
1 parent 5859190 commit 2c6238d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions mantidimaging/eyes_tests/base_eyes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from PyQt5.QtWidgets import QMainWindow, QMenu, QWidget, QApplication

from mantidimaging.core.data import ImageStack
from mantidimaging.core.data.dataset import StrictDataset, Dataset
from mantidimaging.core.data.dataset import Dataset
from mantidimaging.core.io.loader import loader
from mantidimaging.core.utility.data_containers import Indices
from mantidimaging.eyes_tests.eyes_manager import EyesManager
Expand Down Expand Up @@ -101,7 +101,7 @@ def _load_strict_data_set(self, set_180: bool = False):
filename_group = FilenameGroup.from_file(Path(LOAD_SAMPLE))
filename_group.find_all_files()
image_stack = loader.load(filename_group, indices=Indices(0, 100, 2))
dataset = StrictDataset(sample=image_stack)
dataset = Dataset(sample=image_stack)
image_stack.name = "Stack 1"
self.imaging.presenter.model.add_dataset_to_model(dataset)
self.imaging.presenter._add_dataset_to_view(dataset)
Expand Down
4 changes: 2 additions & 2 deletions mantidimaging/eyes_tests/spectrum_viewer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX - License - Identifier: GPL-3.0-or-later
from __future__ import annotations
from PyQt5.QtWidgets import QApplication
from mantidimaging.core.data.dataset import StrictDataset
from mantidimaging.core.data.dataset import Dataset
from mantidimaging.test_helpers.unit_test_helper import generate_images

from mantidimaging.eyes_tests.base_eyes import BaseEyesTest
Expand All @@ -15,7 +15,7 @@ def _generate_spectrum_dataset(self):
sample_stack.name = "Sample Stack"
open_stack = generate_images(seed=666, shape=(20, 10, 10))
open_stack.name = "Open Beam Stack"
dataset = StrictDataset(sample=sample_stack, flat_before=open_stack)
dataset = Dataset(sample=sample_stack, flat_before=open_stack)
self.imaging.presenter.model.add_dataset_to_model(dataset)
QApplication.sendPostedEvents()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import unittest
from unittest import mock

from mantidimaging.core.data.dataset import StrictDataset, Dataset
from mantidimaging.core.data.dataset import Dataset
from mantidimaging.gui.widgets.dataset_selector.presenter import DatasetSelectorWidgetPresenter, Notification
from mantidimaging.gui.widgets.dataset_selector.view import DatasetSelectorWidgetView

Expand All @@ -29,9 +29,9 @@ def setUp(self) -> None:
self.img3.name = "Image 3"
self.img4 = mock.Mock(id="img4")
self.img4.name = "Image 4"
self.ds1 = StrictDataset(sample=self.img1)
self.ds1 = Dataset(sample=self.img1)
self.ds1.name = "Dataset 1"
self.ds2 = StrictDataset(sample=self.img2, flat_before=self.img3)
self.ds2 = Dataset(sample=self.img2, flat_before=self.img3)
self.ds2.name = "Dataset 2"
self.ds3 = Dataset(stacks=[self.img4])
self.ds3.name = "Dataset 3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from PyQt5.QtWidgets import QPushButton, QActionGroup, QGroupBox, QAction, QCheckBox, QTabWidget
from parameterized import parameterized

from mantidimaging.core.data.dataset import StrictDataset, Dataset
from mantidimaging.core.data.dataset import Dataset
from mantidimaging.core.utility.sensible_roi import SensibleROI
from mantidimaging.gui.windows.main import MainWindowView
from mantidimaging.gui.windows.spectrum_viewer import SpectrumViewerWindowView, SpectrumViewerWindowPresenter
Expand Down Expand Up @@ -54,7 +54,7 @@ def test_get_dataset_id_for_stack(self):

def test_handle_sample_change_has_flat_before(self):
self.presenter.get_dataset_id_for_stack = mock.Mock(return_value=uuid.uuid4())
new_dataset = StrictDataset(sample=generate_images([10, 11, 12]), flat_before=generate_images())
new_dataset = Dataset(sample=generate_images([10, 11, 12]), flat_before=generate_images())
new_dataset.flat_before.name = 'Flat_before'
self.presenter.main_window.get_dataset = mock.Mock(return_value=new_dataset)
self.presenter.main_window.get_stack = mock.Mock(return_value=generate_images())
Expand All @@ -68,7 +68,7 @@ def test_handle_sample_change_has_flat_before(self):

def test_handle_sample_change_has_flat_after(self):
self.presenter.get_dataset_id_for_stack = mock.Mock(return_value=uuid.uuid4())
new_dataset = StrictDataset(sample=generate_images(), flat_after=generate_images())
new_dataset = Dataset(sample=generate_images(), flat_after=generate_images())
new_dataset.flat_after.name = 'Flat_after'
self.presenter.main_window.get_dataset = mock.Mock(return_value=new_dataset)
self.presenter.main_window.get_stack = mock.Mock(return_value=generate_images())
Expand Down Expand Up @@ -118,7 +118,7 @@ def test_handle_sample_change_to_dataset_no_sample(self):

def test_handle_sample_change_no_flat(self):
self.presenter.get_dataset_id_for_stack = mock.Mock(return_value=uuid.uuid4())
new_dataset = StrictDataset(sample=generate_images())
new_dataset = Dataset(sample=generate_images())
self.presenter.main_window.get_dataset = mock.Mock(return_value=new_dataset)
self.presenter.main_window.get_stack = mock.Mock(return_value=generate_images())
self.presenter.show_new_sample = mock.Mock()
Expand Down

0 comments on commit 2c6238d

Please sign in to comment.