diff --git a/Makefile b/Makefile index c6af2e3..58e9178 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ test: build docker run --rm -it jimrybarski/nd2reader python3.4 /opt/nd2reader/tests.py docker run --rm -it jimrybarski/nd2reader python2.7 /opt/nd2reader/tests.py -functest: build +ftest: build docker run --rm -v ~/nd2s:/var/nd2s -it jimrybarski/nd2reader python3.4 /opt/nd2reader/ftests.py docker run --rm -v ~/nd2s:/var/nd2s -it jimrybarski/nd2reader python2.7 /opt/nd2reader/ftests.py diff --git a/nd2reader/interface.py b/nd2reader/interface.py index a0d1d4f..997bfc1 100644 --- a/nd2reader/interface.py +++ b/nd2reader/interface.py @@ -28,7 +28,7 @@ class Nd2(object): def __repr__(self): return "\n".join(["" % self._filename, - "Created: %s" % self.date, + "Created: %s" % (self.date if self.date is not None else "Unknown"), "Image size: %sx%s (HxW)" % (self.height, self.width), "Frames: %s" % len(self.frames), "Channels: %s" % ", ".join(["'%s'" % str(channel) for channel in self.channels]), diff --git a/nd2reader/model/metadata.py b/nd2reader/model/metadata.py index 11a0164..536f0b9 100644 --- a/nd2reader/model/metadata.py +++ b/nd2reader/model/metadata.py @@ -35,7 +35,7 @@ class Metadata(object): """ The date and time when acquisition began. - :rtype: datetime.datetime() + :rtype: datetime.datetime() or None """ return self._date diff --git a/nd2reader/parser/v3.py b/nd2reader/parser/v3.py index f8bc7fd..e71c3c1 100644 --- a/nd2reader/parser/v3.py +++ b/nd2reader/parser/v3.py @@ -59,7 +59,7 @@ class V3Parser(BaseParser): """ The date and time when acquisition began. - :rtype: datetime.datetime() + :rtype: datetime.datetime() or None """ for line in metadata_dict[six.b('ImageTextInfo')][six.b('SLxImageTextInfo')].values(): @@ -78,7 +78,7 @@ class V3Parser(BaseParser): if not absolute_start_12 and not absolute_start_24: continue return absolute_start_12 if absolute_start_12 else absolute_start_24 - raise ValueError("This ND2 has no recorded start time. This is probably a bug.") + return None def _parse_channels(self, metadata_dict): """