aiidalab_widgets_base.utils package

Module contents

Some utility functions used acrross the repository.

aiidalab_widgets_base.utils.find_ranges(iterable)[source]

Yield range of consecutive numbers.

aiidalab_widgets_base.utils.get_ase_from_file(fname, format=None)[source]

Get ASE structure object.

aiidalab_widgets_base.utils.list_to_string_range(lst, shift=1)[source]

Converts a list like [0, 2, 3, 4] into a string like ‘1 3..5’.

Shift used when e.g. for a user interface numbering starts from 1 not from 0

aiidalab_widgets_base.utils.predefine_settings(obj, **kwargs)[source]

Specify some pre-defined settings.

aiidalab_widgets_base.utils.string_range_to_list(strng, shift=- 1)[source]

Converts a string like ‘1 3..5’ into a list like [0, 2, 3, 4].

Shift used when e.g. for a user interface numbering starts from 1 not from 0

aiidalab_widgets_base.utils.valid_arguments(arguments, valid_args)[source]

Check whether provided arguments are valid.