Skip to content

Commit

Permalink
Merge pull request #8 from alasdairwilson/startn-end-skip-docs
Browse files Browse the repository at this point in the history
Added explanation of start, end, skip kwargs when loading directories
  • Loading branch information
alasdairwilson authored Jul 11, 2024
2 parents d75ba8c + 1e33db7 commit a033a8c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions examples/io/loading_a_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a033a8c

Please sign in to comment.