Skip to content

Commit 0f09879

Browse files
committed
Clean up some historical import locations
1 parent fdb5e17 commit 0f09879

File tree

3 files changed

+7
-24
lines changed

3 files changed

+7
-24
lines changed

Stoner/HDF5.py

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
1111
"""
1212

13-
__all__ = ["HDF5Folder", "HDFFileManager"]
13+
__all__ = ["HDF5Folder"]
1414
import importlib
1515
import os
1616
import os.path as path
@@ -20,7 +20,7 @@
2020
from .compat import bytes2str, get_filedialog, path_types
2121
from .core.exceptions import StonerLoadError
2222
from .folders import DataFolder
23-
from .tools.file import HDFFileManager
23+
from .core.data import Data
2424

2525

2626
def get_hdf_loader(f, default_loader=lambda *args, **kargs: None):
@@ -49,17 +49,11 @@ def get_hdf_loader(f, default_loader=lambda *args, **kargs: None):
4949
return getattr(globals()[typ], "read_hdf5", default_loader)
5050

5151

52-
class HDF5FolderMixin:
53-
"""Provides a method to load and save data from a single HDF5 file with groups.
54-
55-
See :py:class:`Stoner.Folders.DataFolder` for documentation on constructor.
56-
57-
Datalayout consistns of sub-groups that are either instances of HDF5Files (i.e. have a type attribute that
58-
contains 'HDF5File') or are themsleves HDF5Folder instances (with a type attribute that reads 'HDF5Folder').
59-
"""
52+
class HDF5Folder(DataFolder):
53+
"""Just enforces the loader attriobute to be an HDF5File."""
6054

6155
def __init__(self, *args, **kargs):
62-
"""Initialise the File aatribute."""
56+
"""Ensure the loader routine is set for HDF5Files."""
6357
self.File = None
6458
super().__init__(*args, **kargs)
6559

@@ -244,12 +238,3 @@ def save(self, root=None):
244238
self.File.close()
245239
self.File = None
246240
return self
247-
248-
249-
class HDF5Folder(HDF5FolderMixin, DataFolder):
250-
"""Just enforces the loader attriobute to be an HDF5File."""
251-
252-
def __init__(self, *args, **kargs):
253-
"""Ensure the loader routine is set for HDF5Files."""
254-
# self.loader = HDF5File
255-
super().__init__(*args, **kargs)

Stoner/formats/attocube.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616
from ..compat import bytes2str, string_types
1717
from ..core.base import TypeHintedDict
1818
from ..core.exceptions import StonerLoadError
19-
from ..HDF5 import HDFFileManager
2019
from ..Image import ImageArray, ImageFile, ImageStack
21-
from ..tools.file import FileManager, get_filename
20+
from ..tools.file import FileManager, get_filename, HDFFileManager
2221

2322
PARAM_RE = re.compile(r"^([\d\\.eE\+\-]+)\s*([\%A-Za-z]\S*)?$")
2423
SCAN_NO = re.compile(r"SC_(\d+)")

Stoner/formats/maximus.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515

1616
# Imports for use in Stoner package
1717
from ..core.exceptions import StonerLoadError
18-
from ..HDF5 import HDFFileManager
1918
from ..Image import ImageArray, ImageFile, ImageStack
20-
from ..tools.file import FileManager, get_filename
19+
from ..tools.file import FileManager, get_filename, HDFFileManager
2120

2221
SCAN_NO = re.compile(r"MPI_(\d+)")
2322

0 commit comments

Comments
 (0)