3
���hc � @ s d diZ G dd� de�ZdS )Z
display_width�P c @ s( e Zd ZdZdd� Zdd� Zdd� ZdS ) �set_optionsa% Set global state within a controlled context
Currently, the only supported option is ``display_width``, which has a
default value of 80.
You can use ``set_options`` either as a context manager:
>>> ds = xr.Dataset({'x': np.arange(1000)})
>>> with xr.set_options(display_width=40):
... print(ds)
<xarray.Dataset>
Dimensions: (x: 1000)
Coordinates:
* x (x) int64 0 1 2 3 4 5 6 ...
Data variables:
*empty*
Or to set global options:
>>> xr.set_options(display_width=80)
c K s t j� | _t j|� d S )N)�OPTIONS�copy�old�update)�self�kwargs� r �3/tmp/pip-build-5_djhm0z/xray/xarray/core/options.py�__init__ s
zset_options.__init__c C s d S )Nr )r r r r
� __enter__ s zset_options.__enter__c C s t j� t j| j� d S )N)r �clearr r )r �type�value� tracebackr r r
�__exit__! s zset_options.__exit__N)�__name__�
__module__�__qualname__�__doc__r r r r r r r
r s r N)r �objectr r r r r
�<module> s |