Skip to content

Consider removing deprecated config api #125

Closed
@ferrine

Description

@ferrine

THe deprecation was introduced by @michaelosthege

class _SectionRedirect:
"""Functions as a mock property on the PyTensorConfigParser.
It redirects attribute access (to config subsectinos) to the
new config variable properties that use "__" in their name.
"""
def __init__(self, root, section_name):
self._root = root
self._section_name = section_name
super().__init__()
def __getattr__(self, attr):
warnings.warn(
f"Accessing section '{attr}' through old .-based API. "
f"This will be removed. Use 'config.{self._section_name}__{attr}' instead.",
DeprecationWarning,
)
return getattr(self._root, f"{self._section_name}__{attr}")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions