regionmask.set_options

class regionmask.set_options(**kwargs)

Set options for regionmask in a controlled context.

Parameters:
display_max_rowsint, default: 10

Maximum display rows.

cache_dirstr | pathlib.Path

Location of the cache directory. If None uses the default cache location of your operating system. For unix-like this would be ‘~/.cache/regionmask’.

Examples

It is possible to use set_options either as a context manager:

>>> import regionmask
>>> srex = regionmask.defined_regions.srex
>>> with regionmask.set_options(display_max_rows=2):
...     print(srex)
<regionmask.Regions 'SREX'>
Source:   Seneviratne et al., 2012 (https://www.ipcc.ch/site/assets/uploads/2...
overlap:  False

Regions:
 1 ALA       Alaska/N.W. Canada
..  ..                      ...
26 SAU S. Australia/New Zealand

[26 regions]
>>> regionmask.set_options(display_max_rows=None)  
<regionmask.core.options.set_options object at 0x...>
__init__(**kwargs)

Methods

__init__(**kwargs)