Skip to content

Commit

Permalink
Clean up unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
CSSFrancis committed Oct 7, 2024
1 parent afe7b5e commit 25abc73
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions rsciio/dm5/_api.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
from asyncore import write
from importlib.metadata import metadata
# -*- coding: utf-8 -*-
# Copyright 2007-2023 The HyperSpy developers
#
# This file is part of RosettaSciIO.
#
# RosettaSciIO is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# RosettaSciIO is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with RosettaSciIO. If not, see <https://www.gnu.org/licenses/#GPL>.

import h5py
import dask.array as da
import numpy as np

from rsciio._docstrings import FILENAME_DOC, LAZY_DOC, RETURNS_DOC
from rsciio.hspy._api import HyperspyWriter
from logging import getLogger
_logger = getLogger(__name__)


# for some reason this is slightly different in dm4???
Expand Down Expand Up @@ -547,8 +560,6 @@ def _group2dict(group, dictionary=None):
value = value.astype("U")

Check warning on line 560 in rsciio/dm5/_api.py

View check run for this annotation

Codecov / codecov/patch

rsciio/dm5/_api.py#L560

Added line #L560 was not covered by tests
if value.dtype.str.endswith("U1"):
value = value.tolist()

Check warning on line 562 in rsciio/dm5/_api.py

View check run for this annotation

Codecov / codecov/patch

rsciio/dm5/_api.py#L562

Added line #L562 was not covered by tests
else:
value = value
dictionary[key] = value

if not isinstance(group, h5py.Dataset):
Expand Down Expand Up @@ -579,7 +590,7 @@ def file_reader(filename, lazy=False, **kwds):
pass

DM5_file = DM5(filename, mode='r')
images = DM5_file.read_images()
DM5_file.read_images()
if len(DM5_file.images) == 1:
index = 0
else:# len(DM5_file.images) > 1:
Expand Down

0 comments on commit 25abc73

Please sign in to comment.