Skip to content

Commit

Permalink
Fix names: Notation -> AsymptoticNotation, analyse -> analyze
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaySimakov committed Jun 30, 2023
1 parent 7bfc113 commit ae4f4a2
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/notations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit ae4f4a2

Please sign in to comment.