finesse.utilities.misc

Miscellaneous utility functions for any part of Finesse.

Functions

calltracker(func)

Decorator used for keeping track of whether the current state is inside the decorated function or not.

changed_params(subs)

Temporarily change model parameters within a context.

check_name(name)

Checks the validity of a component or node name.

doc_element_parameter_table(cls)

Prints table for a particular element class.

find(x, value)

Finds value in the list x and returns its index, returning None if value is not in the list.

find_nearest(x, value[, index])

graph_layouts()

Available NetworkX and graphviz (if installed) graph plotting layouts.

graphviz_layouts()

Available graphviz graph plotting layouts.

is_iterable(obj)

Reliable check for whether an object is iterable.

logs([level, exclude, fmt, datefmt, ...])

Change the default Finesse log stream handler behaviour in the encapsulated context.

networkx_layouts()

Available NetworkX graph plotting layouts.

opened_file(fobj, mode)

Get an open file regardless of whether a string or an already open file is passed.

pairwise(iterable)

Iterates through each pair in a iterable.

valid_name(name)

Validate the specified name.