From b24ff9d10bde57265887e0ebf6d65ffdac032acf Mon Sep 17 00:00:00 2001 From: NimaSarajpoor Date: Mon, 23 Dec 2024 00:07:17 -0500 Subject: [PATCH] Removed support for input with type list to simplify function --- stumpy/config.py | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/stumpy/config.py b/stumpy/config.py index bcec1e679..aa50d5de2 100644 --- a/stumpy/config.py +++ b/stumpy/config.py @@ -41,9 +41,8 @@ def _reset(var=None): Parameters ---------- - var : str or list, default None - If str, it is the name of the configuration variable to reset. If lst, - it is a list of configuration variables to reset. If None, then all + var : str, default None + The name of the configuration variable. If None, then all configuration variables are reset to their default values. Returns @@ -55,21 +54,12 @@ def _reset(var=None): ] if var is None: - var = config_vars - elif isinstance(var, str): - var = [var] + for v in config_vars: + globals()[v] = _STUMPY_DEFAULTS[v] + elif var in config_vars: + globals()[var] = _STUMPY_DEFAULTS[var] else: - pass - - if not set(var).issubset(config_vars): - msg = ( - "Could not reset the following unrecognized configuration variable(s): " - + f"{set(var) - set(config_vars)}" - ) + msg = f'Could not reset unrecognized configuration variable "{var}"' warnings.warn(msg) - # Reset all config variables back to default values - for v in var: - globals()[v] = _STUMPY_DEFAULTS[v] - return