Skip to content

Commit

Permalink
Unify datasets 10: Remove StrictDataset (#2402)
Browse files Browse the repository at this point in the history
  • Loading branch information
JackEAllen authored Nov 28, 2024
2 parents 1a1937b + 2b7887a commit e4732a8
Show file tree
Hide file tree
Showing 17 changed files with 90 additions and 411 deletions.
6 changes: 1 addition & 5 deletions mantidimaging/core/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def set_stack(self, file_type: FILE_TYPES, image_stack: ImageStack) -> None:
if hasattr(self, attr_name):
setattr(self, attr_name, image_stack)
else:
raise AttributeError(f"StrictDataset does not have an attribute for {attr_name}")
raise AttributeError(f"Dataset does not have an attribute for {attr_name}")

def set_stack_by_type_name(self, file_type_name: str, image_stack: ImageStack) -> None:
file_type_name = file_type_name.upper().replace(" ", "_")
Expand All @@ -201,10 +201,6 @@ def is_processed(self) -> bool:
return False


class StrictDataset(Dataset):
pass


def _get_stack_data_type(stack_id: uuid.UUID, dataset: Dataset) -> str:
"""
Find the data type as a string of a stack.
Expand Down
293 changes: 0 additions & 293 deletions mantidimaging/core/data/test/strictdataset_test.py

This file was deleted.

6 changes: 3 additions & 3 deletions mantidimaging/core/io/saver.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def image_save(images: ImageStack,

def nexus_save(dataset: Dataset, path: str, sample_name: str, save_as_float: bool) -> None:
"""
Uses information from a StrictDataset to create a NeXus file.
Uses information from a Dataset to create a NeXus file.
:param dataset: The dataset to save as a NeXus file.
:param path: The NeXus file path.
:param sample_name: The sample name.
Expand All @@ -204,9 +204,9 @@ def nexus_save(dataset: Dataset, path: str, sample_name: str, save_as_float: boo

def _nexus_save(nexus_file: h5py.File, dataset: Dataset, sample_name: str, save_as_float: bool) -> None:
"""
Takes a NeXus file and writes the StrictDataset information to it.
Takes a NeXus file and writes the Dataset information to it.
:param nexus_file: The NeXus file.
:param dataset: The StrictDataset.
:param dataset: The Dataset.
:param sample_name: The sample name.
"""
# Top-level group
Expand Down
Loading

0 comments on commit e4732a8

Please sign in to comment.