21
21
_logger = logging .getLogger ("pytensor.configparser" )
22
22
23
23
24
- class PyTensorConfigWarning (Warning ):
24
+ class ConfigWarning (Warning ):
25
25
@classmethod
26
26
def warn (cls , message : str , stacklevel : int = 0 ):
27
27
warnings .warn (message , cls , stacklevel = stacklevel + 3 )
@@ -62,7 +62,7 @@ def __exit__(self, *args):
62
62
v .__set__ (self ._root , self .old_vals [k ])
63
63
64
64
65
- class PyTensorConfigParser :
65
+ class ConfigParser :
66
66
"""Object that holds configuration settings."""
67
67
68
68
# add_basic_configvars
@@ -551,7 +551,7 @@ def parse_config_string(
551
551
kv_tuple = kv_pair .split ("=" , 1 )
552
552
if len (kv_tuple ) == 1 :
553
553
if issue_warnings :
554
- PyTensorConfigWarning .warn (
554
+ ConfigWarning .warn (
555
555
f"Config key '{ kv_tuple [0 ]} ' has no value, ignoring it" ,
556
556
stacklevel = 1 ,
557
557
)
@@ -581,7 +581,7 @@ def config_files_from_pytensorrc() -> list[Path]:
581
581
return paths
582
582
583
583
584
- def _create_default_config () -> PyTensorConfigParser :
584
+ def _create_default_config () -> ConfigParser :
585
585
# The PYTENSOR_FLAGS environment variable should be a list of comma-separated
586
586
# [section__]option=value entries. If the section part is omitted, there should
587
587
# be only one section that contains the given option.
@@ -608,7 +608,7 @@ def _create_default_config() -> PyTensorConfigParser:
608
608
609
609
# Instances of PyTensorConfigParser can have independent current values!
610
610
# But because the properties are assigned to the type, their existence is global.
611
- config = PyTensorConfigParser (
611
+ config = ConfigParser (
612
612
flags_dict = PYTENSOR_FLAGS_DICT ,
613
613
pytensor_cfg = pytensor_cfg ,
614
614
pytensor_raw_cfg = pytensor_raw_cfg ,
0 commit comments