File: options.rst

package info (click to toggle)
python-xarray 2025.08.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 11,796 kB
  • sloc: python: 115,416; makefile: 258; sh: 47
file content (36 lines) | stat: -rw-r--r-- 844 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
.. currentmodule:: xarray

.. _options:

Configuration
=============

Xarray offers a small number of configuration options through :py:func:`set_options`. With these, you can

1. Control the ``repr``:

   - ``display_expand_attrs``
   - ``display_expand_coords``
   - ``display_expand_data``
   - ``display_expand_data_vars``
   - ``display_max_rows``
   - ``display_style``

2. Control behaviour during operations: ``arithmetic_join``, ``keep_attrs``, ``use_bottleneck``.
3. Control colormaps for plots:``cmap_divergent``, ``cmap_sequential``.
4. Aspects of file reading: ``file_cache_maxsize``, ``warn_on_unclosed_files``.


You can set these options either globally

::

  xr.set_options(arithmetic_join="exact")

or locally as a context manager:

::

   with xr.set_options(arithmetic_join="exact"):
       # do operation here
       pass