nctoolkit.options

Contents

nctoolkit.options#

nctoolkit.options(**kwargs)#

Define session options.

Parameters:

**kwargs – Define options using key, value pairs. Set thread_safe = True if hdf5 was built to be thread safe. Set lazy = False if you want methods to evaluate non-lazily Set cores = n, if you want nctoolkit to process the individual files in multi-file datasets in parallel. Note this only applies to multi-file datasets and will not improve performance with single files. Set temp_dir = “/foo” if you want to change the temporary directory used by nctoolkit to save temporary files. Set = “/foo” if you want to change the temporary directory used by nctoolkit to save temporary files. Set progress to “on” or “off” if you always or never want a progress bar to show when multi-file datasets are processed. This defaults to “auto”, i.e. nctoolkit will automatically decide whether to show a progress bar based on the size of the ensemble.

Examples

If you wanted to process the files in multi-file datasets in parallel with 6 cores, do the following:

>>> import nctoolkit as nc
>>> nc.options(cores = 6)

If you want to set evaluation to always be lazy do the following:

>>> nc.options(lazy = True)

If you want nctoolkit to store temporary files in a specific directory, do this:

>>> nc.options(temp_dir = "/foo")