Skip to content

Commit

Permalink
3.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben Verweij committed Apr 5, 2018
1 parent da10f6d commit 96922d8
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs
Submodule docs updated from 9d1833 to 1b4345
2 changes: 1 addition & 1 deletion nd2reader/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from nd2reader.reader import ND2Reader
from nd2reader.legacy import Nd2

__version__ = '3.0.8'
__version__ = '3.0.9'
9 changes: 3 additions & 6 deletions nd2reader/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,14 @@ def _check_version_supported(self):
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

Expand Down Expand Up @@ -229,7 +226,7 @@ def _calculate_frame_number(self, image_group_number, field_of_view, 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
def _channel_offset(self):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup

VERSION = '3.0.8'
VERSION = '3.0.9'

if __name__ == '__main__':
setup(
Expand Down
4 changes: 2 additions & 2 deletions sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
# 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.
Expand Down
7 changes: 1 addition & 6 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,4 @@ def test_can_open_test_file(self):
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.")

0 comments on commit 96922d8

Please sign in to comment.