pyiron_contrib.protocol.utils.misc module

class pyiron_contrib.protocol.utils.misc.LoggerMixin[source]

Bases: object

A class which is meant to be inherited from. Provides a logger attribute. The loggers name is the fully qualified type name of the instance

fullname()[source]

Returns the fully qualified type name of the instance

Returns

fully qualified type name of the instance

Return type

str

property logger
class pyiron_contrib.protocol.utils.misc.Registry(name, bases, nmspc)[source]

Bases: type

pyiron_contrib.protocol.utils.misc.ensure_iterable(v)
pyiron_contrib.protocol.utils.misc.flatten(l)
pyiron_contrib.protocol.utils.misc.fullname(obj)[source]

Returns the fully qualified class name of an object

Parameters

obj – (object) the object

Returns: (str) the class name

pyiron_contrib.protocol.utils.misc.get_cls(string)[source]
pyiron_contrib.protocol.utils.misc.is_iterable(o)[source]

Convenience method to test for an iterator

Parameters

o – the object to test

Returns

wether the input argument is iterable or not

Return type

bool

pyiron_contrib.protocol.utils.misc.ordered_dict_get_index(ordered_dict, index)[source]

Gets the object at “index” of an collections.OrderedDict without copying the keys list :param ordered_dict: (collections.OrderedDict) the dict to get the value from :param index: (int) the index

Returns: (object) the object at “index”

pyiron_contrib.protocol.utils.misc.ordered_dict_get_last(ordered_dict)[source]

Gets the last most recently added object of an collections.OrderedDict instance

Parameters

ordered_dict – (collections.OrderedDict) the dict to get the value from

Returns: (object) the object at the back

pyiron_contrib.protocol.utils.misc.requires_arguments(func)[source]

Determines if a function of method needs arguments, ingores self

Parameters

func – (callable) the callable

Returns: (bool) wether arguments (except “self” for methods) are needed