We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 079cfdf commit 6d08d3bCopy full SHA for 6d08d3b
xarray/core/options.py
@@ -109,7 +109,7 @@ class set_options(object):
109
"""
110
111
def __init__(self, **kwargs):
112
- self.old = OPTIONS.copy()
+ self.old = {}
113
for k, v in kwargs.items():
114
if k not in OPTIONS:
115
raise ValueError(
@@ -118,6 +118,7 @@ def __init__(self, **kwargs):
118
if k in _VALIDATORS and not _VALIDATORS[k](v):
119
120
'option %r given an invalid value: %r' % (k, v))
121
+ self.old[k] = OPTIONS[k]
122
self._apply_update(kwargs)
123
124
def _apply_update(self, options_dict):
@@ -130,5 +131,4 @@ def __enter__(self):
130
131
return
132
133
def __exit__(self, type, value, traceback):
- OPTIONS.clear()
134
self._apply_update(self.old)
0 commit comments