File tree Expand file tree Collapse file tree 1 file changed +7
-17
lines changed Expand file tree Collapse file tree 1 file changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,8 @@ def _reset(var=None):
41
41
42
42
Parameters
43
43
----------
44
- var : str or list, default None
45
- If str, it is the name of the configuration variable to reset. If lst,
46
- it is a list of configuration variables to reset. If None, then all
44
+ var : str, default None
45
+ The name of the configuration variable. If None, then all
47
46
configuration variables are reset to their default values.
48
47
49
48
Returns
@@ -55,21 +54,12 @@ def _reset(var=None):
55
54
]
56
55
57
56
if var is None :
58
- var = config_vars
59
- elif isinstance (var , str ):
60
- var = [var ]
57
+ for v in config_vars :
58
+ globals ()[v ] = _STUMPY_DEFAULTS [v ]
59
+ elif var in config_vars :
60
+ globals ()[var ] = _STUMPY_DEFAULTS [var ]
61
61
else :
62
- pass
63
-
64
- if not set (var ).issubset (config_vars ):
65
- msg = (
66
- "Could not reset the following unrecognized configuration variable(s): "
67
- + f"{ set (var ) - set (config_vars )} "
68
- )
62
+ msg = f'Could not reset unrecognized configuration variable "{ var } "'
69
63
warnings .warn (msg )
70
64
71
- # Reset all config variables back to default values
72
- for v in var :
73
- globals ()[v ] = _STUMPY_DEFAULTS [v ]
74
-
75
65
return
You can’t perform that action at this time.
0 commit comments