Skip to content

Commit

Permalink
pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhi committed Oct 27, 2021
1 parent da46f0e commit fdc3dfc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/lazy_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions mpl_image_labeller/_labeller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit fdc3dfc

Please sign in to comment.