From 1e33db72104bec290b626e233e07f2abd8e6e4f0 Mon Sep 17 00:00:00 2001 From: Alasdair Wilson Date: Thu, 11 Jul 2024 14:45:23 +0100 Subject: [PATCH] Added explanation of start, end, skip kwargs --- examples/io/loading_a_directory.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/examples/io/loading_a_directory.py b/examples/io/loading_a_directory.py index 823f9d6..bcfbef1 100644 --- a/examples/io/loading_a_directory.py +++ b/examples/io/loading_a_directory.py @@ -10,5 +10,19 @@ from ripplemapper.io import load_dir_to_obj imgs = load_dir_to_obj(example_dir) +print(imgs) + +################################################################# +# +# We can also select a subset of the images in our path with start, end and skip kwargs. +# These integer valued parameters work like python slicing [start:end:skip]. +imgs = load_dir_to_obj(example_dir, start=0, end=3, skip=2) print(imgs) + +################################################################# +# +# This allows you to chunk up your input into independent processes or to quickly load a subset of your data for testing. +# +# Since you can save and load RippleImage objects, you can also save the subset of images. +# If this is done without the image arrays then you can fit far more images in memory at once