Skip to content
Snippets Groups Projects
Commit cd6fab30 authored by Valerio Mariani's avatar Valerio Mariani
Browse files

Fixed some code analysis complaints from PyCharm

parent 83314092
No related branches found
No related tags found
No related merge requests found
...@@ -31,8 +31,8 @@ import numpy ...@@ -31,8 +31,8 @@ import numpy
_CXISimpleEntry = namedtuple('SimpleEntry', ['path', 'data', 'overwrite']) _CXISimpleEntry = namedtuple('SimpleEntry', ['path', 'data', 'overwrite'])
def _assign_data_type(data):
def _assign_data_type(data):
if isinstance(data, numpy.ndarray): if isinstance(data, numpy.ndarray):
data_type = data.dtype data_type = data.dtype
elif isinstance(data, bytes): elif isinstance(data, bytes):
...@@ -42,6 +42,7 @@ def _assign_data_type(data): ...@@ -42,6 +42,7 @@ def _assign_data_type(data):
return data_type return data_type
class _Stack: class _Stack:
def __init__(self, path, data, axes, compression, chunk_size): def __init__(self, path, data, axes, compression, chunk_size):
...@@ -72,7 +73,7 @@ class _Stack: ...@@ -72,7 +73,7 @@ class _Stack:
def write_initial_slice(self, file_handle, max_num_slices): def write_initial_slice(self, file_handle, max_num_slices):
file_handle.create_dataset(self.path, shape=(max_num_slices,) + self._data_shape, file_handle.create_dataset(self.path, shape=(max_num_slices,) + self._data_shape,
dtype = self._data_type, dtype=self._data_type,
maxshape=(max_num_slices,) + self._data_shape, maxshape=(max_num_slices,) + self._data_shape,
compression=self._compression, chunks=self._chunk_size) compression=self._compression, chunks=self._chunk_size)
...@@ -123,7 +124,6 @@ class _Stack: ...@@ -123,7 +124,6 @@ class _Stack:
def _validate_data(data): def _validate_data(data):
if not isinstance(data, (bytes, int, float, numpy.ndarray)): if not isinstance(data, (bytes, int, float, numpy.ndarray)):
raise RuntimeError('The CXI Writer only accepts numpy objects, numbers and ascii strings.') raise RuntimeError('The CXI Writer only accepts numpy objects, numbers and ascii strings.')
...@@ -354,7 +354,6 @@ class CXIWriter: ...@@ -354,7 +354,6 @@ class CXIWriter:
self._fh[path] = link_target self._fh[path] = link_target
def create_link_to_group(self, group, path, overwrite=False): def create_link_to_group(self, group, path, overwrite=False):
"""Creates a link to an HDF5 group. """Creates a link to an HDF5 group.
...@@ -384,7 +383,6 @@ class CXIWriter: ...@@ -384,7 +383,6 @@ class CXIWriter:
self._fh[path] = link_target self._fh[path] = link_target
def initialize_stacks(self): def initialize_stacks(self):
"""Initializes the stacks. """Initializes the stacks.
...@@ -521,4 +519,3 @@ class CXIWriter: ...@@ -521,4 +519,3 @@ class CXIWriter:
self._fh.close() self._fh.close()
self._file_is_open = False self._file_is_open = False
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment