class tools.Grid(i, j)[source]

Supporting class for the plot_atoms function.

put(c, i, j, depth=1000000000.0)[source]

Blatantly stolen from GPAW. Ascii-art plot of the atoms.

tools.find_db_rows(db, **kwargs)[source]

Find all row of a database containing one or more kwargs.

Parameters:db (ASE database object (sqlite or json)) –
Returns:A list of ASE db row object matching the conditions.
Return type:list
tools.find_file(name, first=True, follow_symlinks=False, name_type='f')[source]

Locate name using call to bash find.

tools.getstatusoutput(*args, **kwargs)[source]

Helper function to replace the old commands.getstatusoutput.

Returns the returncode, stdout and sterr associated with the command.

getstatusoutput([command], stdin=subprocess.PIPE)

tools.handler(signum, frame)[source]

Signal handler for timed find_file.


Read the persistent data from a storq.db

Parameters:directory (str) – Path (relative or absolute) to the calculation directory.
Returns:data – Dictionary containing all the persistent data from storq.db
Return type:dict

Quick way to read the last line of a file.

tools.timed_find_file(name, first=True, follow_symlinks=False, name_type='f')[source]

Timed version of find.


Context manager for timing a piece of code.

tools.write_configuration(fname, config)[source]