flatspin.utils

Utilities related to the flatspin model

Module Contents

Functions

numeric_dict(d)

filter_dict(d, keys)

pop_dict(d, keys)

try_eval(s)

Try to eval(s), on failure return s

eval_dict(d, ctx=None)

make_tuple(tup)

unique_list(l)

get_default_args(func, exclude=['self'])

get_default_kwargs(func, exclude=[])

get_default_params(cls)

check_params(params, classes)

filter_params(cls, params)

pop_params(cls, params)

split_params(params, classes)

Split params belonging to the given list of classes.

format_label(label)

label_columns(labels, prefix='spin')

label_columns_2d(labels, prefix='spin')

get_outdir(script_filename)

make_outdir(script_filename)

flatspin.utils.numeric_dict(d)
flatspin.utils.filter_dict(d, keys)
flatspin.utils.pop_dict(d, keys)
flatspin.utils.try_eval(s)

Try to eval(s), on failure return s

flatspin.utils.eval_dict(d, ctx=None)
flatspin.utils.make_tuple(tup)
flatspin.utils.unique_list(l)
flatspin.utils.get_default_args(func, exclude=['self'])
flatspin.utils.get_default_kwargs(func, exclude=[])
flatspin.utils.get_default_params(cls)
flatspin.utils.check_params(params, classes)
flatspin.utils.filter_params(cls, params)
flatspin.utils.pop_params(cls, params)
flatspin.utils.split_params(params, classes)

Split params belonging to the given list of classes.

Returns a list of parameters matching the the given list of classes. The last element of the list are parameters which didn’t match any of the class signatures.

flatspin.utils.format_label(label)
flatspin.utils.label_columns(labels, prefix='spin')
flatspin.utils.label_columns_2d(labels, prefix='spin')
flatspin.utils.get_outdir(script_filename)
flatspin.utils.make_outdir(script_filename)