From fdc3dfcb61d680e8c60613c6c8988af66732143e Mon Sep 17 00:00:00 2001 From: Ian Hunt-Isaak Date: Wed, 27 Oct 2021 16:12:20 -0400 Subject: [PATCH] pre-commit fixes --- examples/lazy_loading.py | 4 ++-- mpl_image_labeller/_labeller.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/lazy_loading.py b/examples/lazy_loading.py index 37d8434..f9f2813 100644 --- a/examples/lazy_loading.py +++ b/examples/lazy_loading.py @@ -2,11 +2,11 @@ # if you do this then you must also provide *N_images* in the labeller constructor -from mpl_image_labeller import image_labeller import matplotlib.pyplot as plt - from numpy.random import default_rng +from mpl_image_labeller import image_labeller + def lazy_image_generator(idx): rng = default_rng(idx) diff --git a/mpl_image_labeller/_labeller.py b/mpl_image_labeller/_labeller.py index 8d17a49..e82457a 100644 --- a/mpl_image_labeller/_labeller.py +++ b/mpl_image_labeller/_labeller.py @@ -57,10 +57,13 @@ def __init__( "If images is a callable then N_images must be provided" ) self._N_images = N_images + def _get_image(i): return self._images(i) + else: self._N_images = len(images) + def _get_image(i): return self._images[i]