mantispy.settings#

mantispy.settings = MantispySettings(cache_dir=PosixPath('/home/docs/.cache/mantispy'), stream_bytes=506689536, map_table_bytes=4053516288)#

Allows users to customize settings for the mantispy package.

Settings here will generally be for advanced use-cases and should be used with caution.

For setting an option use override() (local) or set the attributes directly (global) e.g., mantispy.settings.my_setting = foo. For assignment by environment variable, use the variable name in all caps with MANTISPY_ as the prefix before import of mantispy.

The following options are available:

settings.cache_dir: pathlib.Path = PosixPath('/home/docs/.cache/mantispy')#

Where mantispy.ds keeps the datasets it downloads.

settings.stream_bytes: int = 506689536#

How many bytes of a matrix that is not in memory a grouped operation reads at once. The default is a sixteenth of the machine’s memory, between 256 MB and 4 GB. Groups are packed into reads of about this size, and a group larger than that is read a block of columns at a time, so a smaller value lowers the peak memory and a larger one reads the file in fewer passes. mantispy.io.read() with lazy=True also sizes its chunks so that one per dask worker fits in this many bytes.

settings.map_table_bytes: int = 4053516288#

How many bytes of sorted similarities and ranks the permutation null of mantispy.tl.map() may hold. The default is half of the machine’s memory. The null refuses a screen whose sorted similarities would exceed it. When a table of each similarity’s rank fits beside them, the draws read the ranks, which is faster; otherwise they search the sorted similarities and give the same p-values.