Browse Source

3.0.9

master
Ruben Verweij 7 years ago
parent
commit
96922d8f0b
6 changed files with 9 additions and 17 deletions
  1. +1
    -1
      docs
  2. +1
    -1
      nd2reader/__init__.py
  3. +3
    -6
      nd2reader/parser.py
  4. +1
    -1
      setup.py
  5. +2
    -2
      sphinx/conf.py
  6. +1
    -6
      tests/test_parser.py

+ 1
- 1
docs

@ -1 +1 @@
Subproject commit 9d1833182940461467048d753fc29be19bf4c9bd
Subproject commit 1b43456084689bad958984cf8a0cad7f63b52286

+ 1
- 1
nd2reader/__init__.py View File

@ -1,4 +1,4 @@
from nd2reader.reader import ND2Reader from nd2reader.reader import ND2Reader
from nd2reader.legacy import Nd2 from nd2reader.legacy import Nd2
__version__ = '3.0.8'
__version__ = '3.0.9'

+ 3
- 6
nd2reader/parser.py View File

@ -116,17 +116,14 @@ class Parser(object):
Returns: Returns:
bool: True on supported bool: True on supported
Raises:
InvalidVersionError: Raises an error if the version is unsupported
""" """
major_version, minor_version = get_version(self._fh) major_version, minor_version = get_version(self._fh)
supported = self.supported_file_versions.get( supported = self.supported_file_versions.get(
(major_version, minor_version)) or self.supported_file_versions.get((major_version, None)) (major_version, minor_version)) or self.supported_file_versions.get((major_version, None))
if not supported: if not supported:
raise InvalidVersionError("No parser is available for that version.")
print("Warning: No parser is available for your current ND2 version (%d.%d). " % (
major_version, minor_version) + "This might lead to unexpected behaviour.")
return supported return supported
@ -229,7 +226,7 @@ class Parser(object):
""" """
return (image_group_number - (field_of_view * len(self.metadata["z_levels"]) + z_level)) / ( return (image_group_number - (field_of_view * len(self.metadata["z_levels"]) + z_level)) / (
len(self.metadata["fields_of_view"]) * len(self.metadata["z_levels"]))
len(self.metadata["fields_of_view"]) * len(self.metadata["z_levels"]))
@property @property
def _channel_offset(self): def _channel_offset(self):


+ 1
- 1
setup.py View File

@ -1,6 +1,6 @@
from setuptools import setup from setuptools import setup
VERSION = '3.0.8'
VERSION = '3.0.9'
if __name__ == '__main__': if __name__ == '__main__':
setup( setup(


+ 2
- 2
sphinx/conf.py View File

@ -44,9 +44,9 @@ author = 'Ruben Verweij'
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '3.0.8'
version = '3.0.9'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '3.0.8'
release = '3.0.9'
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.


+ 1
- 6
tests/test_parser.py View File

@ -24,9 +24,4 @@ class TestParser(unittest.TestCase):
parser = Parser(fh) parser = Parser(fh)
self.assertTrue(parser.supported) self.assertTrue(parser.supported)
def test_cannot_open_wrong_version(self):
with ArtificialND2(self.test_file, version=('0', '0')) as _:
with open(self.test_file, 'rb') as fh:
with self.assertRaises(InvalidVersionError) as exception:
Parser(fh)
self.assertEqual(str(exception.exception), "No parser is available for that version.")

Loading…
Cancel
Save