viperleed.calc.lib.base

Module base of viperleed.calc.lib.

Contains generic functions used in the TensErLEED scripts.

Functions

addUnequalPoints(l1, l2, eps[, uniqueLists])

Adds all points from l1 to l2, if they are not already in l2 (+- epsilon).

available_cpu_count()

Number of available virtual or physical CPUs on this system, i.e. user/real as output by time(1) when called with an optimally scaling userspace-only program.

dict_equal(d1, d2)

Checks whether two dictionaries are equal, i.e. contain the same set of keys with the same values.

dist_from_line(p1, p2, r)

Calculates the distance of a point from a line, with the line defined by two other points.

parseMathSqrt(s)

readToExc(llist)

For reading PARAMETERS files; takes a list, returns elements until the first one that starts with an exclamation mark.

splitSublists(llist, sep)

Takes a list and a separator, splits strings in the list by the separator, returns results as list of lists

Classes

BackwardsReader(file[, blksize, encoding])

Simple class for reading a large file in reverse without having to read the entire file to memory.