diff --git a/docs b/docs index 9d18331..1b43456 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 9d1833182940461467048d753fc29be19bf4c9bd +Subproject commit 1b43456084689bad958984cf8a0cad7f63b52286 diff --git a/nd2reader/__init__.py b/nd2reader/__init__.py index 930bf34..e29913c 100644 --- a/nd2reader/__init__.py +++ b/nd2reader/__init__.py @@ -1,4 +1,4 @@ from nd2reader.reader import ND2Reader from nd2reader.legacy import Nd2 -__version__ = '3.0.8' +__version__ = '3.0.9' diff --git a/nd2reader/parser.py b/nd2reader/parser.py index 74a72bc..c413676 100644 --- a/nd2reader/parser.py +++ b/nd2reader/parser.py @@ -116,17 +116,14 @@ class Parser(object): Returns: bool: True on supported - - Raises: - InvalidVersionError: Raises an error if the version is unsupported - """ major_version, minor_version = get_version(self._fh) supported = self.supported_file_versions.get( (major_version, minor_version)) or self.supported_file_versions.get((major_version, None)) 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 @@ -229,7 +226,7 @@ class Parser(object): """ 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 def _channel_offset(self): diff --git a/setup.py b/setup.py index 83ccd5c..5fb6487 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup -VERSION = '3.0.8' +VERSION = '3.0.9' if __name__ == '__main__': setup( diff --git a/sphinx/conf.py b/sphinx/conf.py index a4ed196..89e9f3f 100644 --- a/sphinx/conf.py +++ b/sphinx/conf.py @@ -44,9 +44,9 @@ author = 'Ruben Verweij' # built documents. # # The short X.Y version. -version = '3.0.8' +version = '3.0.9' # 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 # for a list of supported languages. diff --git a/tests/test_parser.py b/tests/test_parser.py index 99b541f..11dba38 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -24,9 +24,4 @@ class TestParser(unittest.TestCase): parser = Parser(fh) 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.") +