From d90f9b02f7f7e66d95c90f045ec2316eb3553f9c Mon Sep 17 00:00:00 2001 From: Keith Cheveralls Date: Thu, 12 Sep 2024 18:12:24 -0700 Subject: [PATCH] address comments --- Makefile | 5 +++++ README.md | 2 +- readlif/__init__.py | 2 +- readlif/reader.py | 3 +-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 5b7384c..cab44ce 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,8 @@ +# Load environment variables from the `.env` file if it exists. +ifneq (,$(wildcard .env)) + include .env +endif + .PHONY: lint lint: ruff check --exit-zero . diff --git a/README.md b/README.md index 5ec3beb..448d2e2 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ The following is a summary of recent and planned changes to the `readlif` packag - [Done] Use ruff for formatting and linting. - [Done] migrate to pyproject.toml for package configuration. - [Planned] add support for reading 32-bit images. -- [Planned] add support for extracting relevant metadata from the raw XML metadata embedded in LIFF files. +- [Planned] add support for extracting relevant metadata from the raw XML metadata embedded in LIF files. - [Planned] refactor the `get_plane` method to make it easier to use. - [Planned] improve tests using realistic test files from internal sources. diff --git a/readlif/__init__.py b/readlif/__init__.py index 7bbb2ef..6c8e6b9 100755 --- a/readlif/__init__.py +++ b/readlif/__init__.py @@ -1 +1 @@ -__version__ = "0.6.5" +__version__ = "0.0.0" diff --git a/readlif/reader.py b/readlif/reader.py index 123bb2a..28d98a7 100755 --- a/readlif/reader.py +++ b/readlif/reader.py @@ -5,6 +5,7 @@ import xml.etree.ElementTree as ET from collections import namedtuple from functools import reduce +from itertools import compress import numpy as np from PIL import Image @@ -829,8 +830,6 @@ def __init__(self, filename): if len(self.offsets) - len(self.image_list) > 0: is_image_bool_list = self._recursive_memblock_is_image(self.xml_root) if False in is_image_bool_list: - from itertools import compress - self.offsets = list(compress(self.offsets, is_image_bool_list)) if len(self.image_list) != len(self.offsets) and not truncated: