qpym2.utils#

Contains utulity classes and routines.

TODO: Move things into appropriate modules.

  • Move the logs into a seperate module and implement proper logging.

  • Math utilities should go into a seperate module. (include hist routines too)

Module Contents#

Classes#

TempConfig

A temporary configuration class that will have all the keyword arguments implemented as data members.

Functions#

log

log output (print) if log level is less than the _DEBUG_ level

debug

get_ncores

Check the number of cores available on the node. Copied from NERSC doc.

get_mode

Get the mode of the array arr using a gaussian kernel density estimation.

find_mode

Find the mode of the variables in varnames from the trace object.

Data#

API#

qpym2.utils._DEBUG_ = 5#
qpym2.utils.log(level: int, *args, **kwargs)#

log output (print) if log level is less than the _DEBUG_ level

qpym2.utils.debug(*args, **kwargs)#
class qpym2.utils.TempConfig(**kwds)#

A temporary configuration class that will have all the keyword arguments implemented as data members.

Example:
>>> cfg = TempConfig(name='hmu', threshold=threshold)
>>> cfg.name
'hmu'  

TODO: find an existing implementation for this.

Initialization

__repr__()#
qpym2.utils.get_ncores(print_state=False)#

Check the number of cores available on the node. Copied from NERSC doc.

Returns:

int: number of cores available on the node.

qpym2.utils.get_mode(arr)#

Get the mode of the array arr using a gaussian kernel density estimation.

qpym2.utils.find_mode(varnames, trace)#

Find the mode of the variables in varnames from the trace object.