From ae4f4a248b1d64d4ccb802eeef5aafffc8633319 Mon Sep 17 00:00:00 2001 From: Nikolay Simakov Date: Fri, 30 Jun 2023 07:42:15 +0300 Subject: [PATCH] Fix names: Notation -> AsymptoticNotation, analyse -> analyze --- src/notations.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/notations.py b/src/notations.py index 82e2c10..d32e5b2 100644 --- a/src/notations.py +++ b/src/notations.py @@ -8,7 +8,7 @@ ''' Base class of asymptotic notation ''' -class Notation: +class AsymptoticNotation: def __init__(self, full_report: bool = True) -> None: self.full_report = full_report @@ -23,7 +23,7 @@ def _get_ast(self, func) -> ast.Module: code_str = self._code_to_string(func) return ast.parse(code_str) - def analyse(self, func): + def analyze(self, func): analyzer = Analyzer() tree = self._get_ast(func) # print(ast.dump(tree, indent=4)) @@ -51,15 +51,15 @@ def wrapper(self, *args, **kwargs): ''' Implementation of Big O notation ''' -class BigO(Notation): +class BigO(AsymptoticNotation): def __init__(self) -> None: super().__init__() - @Notation.report + @AsymptoticNotation.report def complexity(self, func) -> AnalysisFormatter: - func_name, _ = self.analyse(func) + func_name, _ = self.analyze(func) return AnalysisFormatter( func_name=func_name, @@ -70,15 +70,15 @@ def complexity(self, func) -> AnalysisFormatter: ''' Implementation of Big Omega notation ''' -class BigOmega(Notation): +class BigOmega(AsymptoticNotation): def __init__(self) -> None: super().__init__() - @Notation.report + @AsymptoticNotation.report def complexity(self, func) -> AnalysisFormatter: - func_name, _ = self.analyse(func) + func_name, _ = self.analyze(func) return AnalysisFormatter( func_name=func_name, @@ -89,15 +89,15 @@ def complexity(self, func) -> AnalysisFormatter: ''' Implementation of Big Theta notation ''' -class BigTheta(Notation): +class BigTheta(AsymptoticNotation): def __init__(self) -> None: super().__init__() - @Notation.report + @AsymptoticNotation.report def complexity(self, func) -> AnalysisFormatter: - func_name, _ = self.analyse(func) + func_name, _ = self.analyze(func) return AnalysisFormatter( func_name=func_name,