Skip to content

Commit

Permalink
Remove PyTensor from class name
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoV94 committed Oct 2, 2024
1 parent aea88ec commit 614b0ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions pytensor/configparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
)
Expand Down Expand Up @@ -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.
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 614b0ba

Please sign in to comment.