SnakeIterator.jl

๐Ÿ๐Ÿ๐Ÿ A general snaking iterator
Author tlnagy
Popularity
2 Stars
Updated Last
4 Years Ago
Started In
September 2020

๐Ÿ SnakeIterator.jl

Build Status Coverage

A micropackage implementing a snaking iterator for use with 2D arrays.

What?

See the diagram below for a comparison of normal column-wise (Julia default) iteration versus snaking iteration. It can handle iteration of arbitrary 2D arrays.

Why?

A common use case is minimizing the time spent on physical movement between consecutive wells when iterating over a multiwell plate. This is useful for programming robots to handle 96-well or 386-well plates during microscopy, liquid handling, etc

How?

First, install the package from the General registry

using Pkg

Pkg.add("SnakeIterator")

The only exported function is snake and it constructs a SnakeIterator that should just work (tm) like any other iterator.

using SnakeIterator

arr = reshape(1:16, 4, 4)

for i in snake(arr)
    @show i
end