From 64679f9426ddeaba0782ccbdd69661431e64b3e7 Mon Sep 17 00:00:00 2001 From: Gabriele Girelli Date: Fri, 1 Nov 2019 10:13:59 +0100 Subject: [PATCH] Update raw_metadata.py Changed isinstance to is. Fixed condition triggering warning. --- nd2reader/raw_metadata.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nd2reader/raw_metadata.py b/nd2reader/raw_metadata.py index 72720f7..a37497a 100644 --- a/nd2reader/raw_metadata.py +++ b/nd2reader/raw_metadata.py @@ -164,11 +164,11 @@ class RawMetadata(object): z_levels = self._parse_dimension(r""".*?Z\((\d+)\).*?""") if 0 == len(z_levels): z_levels = parse_if_not_none(self.z_data, self._parse_z_coordinates) - if isinstance(z_levels, type(None)): + if z_levels is None: z_levels = [] else: z_levels = range(len(z_levels)) - if 0 != z_levels: + if 0 != len(z_levels): warnings.warn("Z-levels details missing in metadata. Using Z-coordinates instead.") return z_levels