From 614b0ba2a9e27d6fe0f007ec6e70e0f39675dd1a Mon Sep 17 00:00:00 2001 From: ricardoV94 Date: Wed, 2 Oct 2024 12:50:55 +0200 Subject: [PATCH] Remove PyTensor from class name --- pytensor/configparser.py | 10 +++++----- tests/test_config.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pytensor/configparser.py b/pytensor/configparser.py index 8c6da4a144..919a41d82e 100644 --- a/pytensor/configparser.py +++ b/pytensor/configparser.py @@ -21,7 +21,7 @@ _logger = logging.getLogger("pytensor.configparser") -class PyTensorConfigWarning(Warning): +class ConfigWarning(Warning): @classmethod def warn(cls, message: str, stacklevel: int = 0): warnings.warn(message, cls, stacklevel=stacklevel + 3) @@ -62,7 +62,7 @@ def __exit__(self, *args): v.__set__(self._root, self.old_vals[k]) -class PyTensorConfigParser: +class ConfigParser: """Object that holds configuration settings.""" # add_basic_configvars @@ -551,7 +551,7 @@ def parse_config_string( kv_tuple = kv_pair.split("=", 1) if len(kv_tuple) == 1: if issue_warnings: - PyTensorConfigWarning.warn( + ConfigWarning.warn( f"Config key '{kv_tuple[0]}' has no value, ignoring it", stacklevel=1, ) @@ -581,7 +581,7 @@ def config_files_from_pytensorrc() -> list[Path]: return paths -def _create_default_config() -> PyTensorConfigParser: +def _create_default_config() -> ConfigParser: # The PYTENSOR_FLAGS environment variable should be a list of comma-separated # [section__]option=value entries. If the section part is omitted, there should # be only one section that contains the given option. @@ -608,7 +608,7 @@ def _create_default_config() -> PyTensorConfigParser: # Instances of PyTensorConfigParser can have independent current values! # But because the properties are assigned to the type, their existence is global. - config = PyTensorConfigParser( + config = ConfigParser( flags_dict=PYTENSOR_FLAGS_DICT, pytensor_cfg=pytensor_cfg, pytensor_raw_cfg=pytensor_raw_cfg, diff --git a/tests/test_config.py b/tests/test_config.py index 4370309f39..3f0af8dd3d 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -13,7 +13,7 @@ def _create_test_config(): - return configparser.PyTensorConfigParser( + return configparser.ConfigParser( flags_dict={}, pytensor_cfg=stdlib_configparser.ConfigParser(), pytensor_raw_cfg=stdlib_configparser.RawConfigParser(),