Sets up optional values.
Classes:
|
Set options for xarray in a controlled context. |
- class cmomy.options.set_options(**kwargs)[source]#
Bases:
object
Set options for xarray in a controlled context.
Can be used as a context manager as well
- Parameters:
nmax (
int
, default20
) – Maximum number of moments. [env var: CMOMY_NMAX]cache (
bool
, defaultTrue
) – IfTrue
, cache numba functions. [env var: CMOMY_NUMBA_CACHE]fastmath (
bool
, defaultTrue
) – IfTrue
, use fastmath option to numba. [env var: CMOMY_NUMBA_FASTMATH]parallel (
bool
, defaultTrue
) – IfTrue
, allow parallel numba functions (can still be overridden in function calls.) [env var: CMOMY_NUMBA_PARALLEL]
Notes
You can turn off options setrting the corresponding environment variable to 0. For example to turn off caching, you can set
CMOMY_NUMBA_CACHE=0
. These only take effect at load time, so make sure the variable is set before importingcmomy
.