cf.CONSTANTS

cf.CONSTANTS

A dictionary of useful constants.

Whilst the dictionary may be modified directly, it is safer to retrieve and set the values with a function where one is provided. This is due to interdependencies between some values.

Keys :
ATOL : float

The value of absolute tolerance for testing numerically tolerant equality. Retrieved and set with ATOL.

CHUNKSIZE : int

The chunk size (in bytes) for data storage and processing. Retrieved and set with CHUNKSIZE.

FM_THRESHOLD : float

The minimum amount of memory (in kibibytes) to be kept free as a temporary work space. Retrieved and set with FM_THRESHOLD.

MINNCFM : int

The number of chunk sizes to be kept free a temporary work space.

RTOL : float

The value of relative tolerance for testing numerically tolerant equality. Retrieved and set with RTOL.

TEMPDIR : str

The location to store temporary files. By default the directory returned by the tempfile.gettempdir function is used.

Examples

>>> cf.CONSTANTS
{'ATOL': 2.2204460492503131e-16,
 'CHUNKSIZE': 104857600,
 'FM_THRESHOLD': 1024000.0,
 'MINNCFM': 10,
 'RTOL': 2.2204460492503131e-16,
 'TEMPDIR': '/tmp'}
>>> cf.CONSTANTS['MINNCFM'] = 15
>>> cf.CONSTANTS['TEMPDIR'] = '/home/me/tmp'
>>> cf.CHUNKSIZE(2**30)
>>> cf.CONSTANTS['CHUNKSIZE']
1073741824
>>> cf.CONSTANTS['FM_THRESHOLD']
10485760.0

Previous topic

Constants

This Page