opan.utils.decorate¶
Custom decorators defined for Open Anharmonic.
Decorators¶
-
class
opan.utils.decorate.arraysqueeze(*args)¶ Converts selected arguments to squeezed np.arrays
Pre-applies an
np.array(...).squeeze()conversion to all positional arguments according to integer indices passed, and to any keyword arguments according to any strings passed.Each
intargument passed instructs the decorator to convert the corresponding positional argument in the function definition.Each
strargument passed instructs the decorator to convert the corresponding keyword argument.strparameters corresponding to keyword arguments absent in a particular function call and positional/optional argument indices beyond the range of the actual *args of the decorated function are ignored.Warning
Likely fragile with optional arguments; needs to be tested.
Parameters: *args ( intorstr) – Arguments to convert to squeezednp.array.