Utils API

credo.utils

A module for general utility functions in CREDO, that don’t clearly fit into other modules.

credo.utils.dictAsPrettyStr(inDict)

A small function to create a string representation of a dictionary, by getting the str() of each item in a dict, not the repr(). Useful for floating points for example to be ‘prettier’ (less zeros after the number).

Note

No effort has been made to ensure this is super-efficient for large dictionaries, it’s suited to small lists of parameters

credo.utils.getCallingPath(stackNum)

Get the path of the calling stack at stackNum levels higher.

credo.utils.productCalc(*args, **kwds)

Basic implementation of itertools.product from Python 2.6: For Python 2.5 backward compatibility. productCalc(‘ABCD’, ‘xy’) –> Ax Ay Bx By Cx Cy Dx Dy productCalc(range(2), repeat=3) –> 000 001 010 011 100 101 110 111

Project Versions

Table Of Contents

Previous topic

Model API

Next topic

JobRunner API

This Page