Several utility functions are used throughout sisl.

Range routines

strmap(func, s[, start, end, sep])

Parse a string as though it was a slice and map all entries using func.

strseq(cast, s[, start, end])

Accept a string and return the casted tuples of content based on ranges.

lstranges(lst[, cast, end])

Convert a strmap list into expanded ranges

erange(start, step[, end])

Returns the range with both ends includede


Convert a list of elements into a string of ranges

fileindex(f[, cast])

Parses a filename string into the filename and the indices.

Miscellaneous routines


Split into a tuple of name and specifier, delimited by {...}.

direction(d[, abc, xyz])

Index coordinate corresponding to the Cartesian coordinate system.

angle(s[, rad, in_rad])

Convert the input string to an angle, either radians or degrees.


Generator for iterating a shape by returning consecutive slices


Evaluate a mathematical expression using a safe evaluation method