module containing miscelanous functions used in BKchem that don't
fit anywhere else. Does not contain any objects
Imported modules
|
|
import base64
import math
import re
import string
import time
import types
from warnings import warn
|
Functions
|
|
|
|
difference
|
difference ( a, b )
returns difference of 2 lists ( a-b)
|
|
extend_bbox
|
extend_bbox ( bbox, pixels=1 )
|
|
filter_unique
|
filter_unique ( items )
|
|
has_one_value_only
|
has_one_value_only ( iterable )
|
|
intersection
|
intersection ( a, b )
returns intersection of 2 lists
|
|
lazy_apply
|
lazy_apply ( function, arguments )
similar to apply but returns a callable (lambda) that performs the apply when called.
|
|
len_and_ending
|
len_and_ending ( iterable )
|
|
list_difference
|
list_difference ( list )
return a list of differences between list members,
the list is by 1 shorter than the original
|
|
normalize_coords
|
normalize_coords ( coords )
|
|
plural_or_singular
|
plural_or_singular ( iterable )
useful for string construction such as you have %d apple%s % (len(apples), plural_or_singular( apples)
|
|
reverse
|
reverse ( iterable )
|
|
reverse_molecule_formula
|
reverse_molecule_formula ( formula )
|
|
signum
|
signum ( a )
|
|
smallest_common_bbox
|
smallest_common_bbox ( bboxes )
|
|
split_number_and_unit
|
split_number_and_unit ( txt )
|