Skip to content

Commit

Permalink
docs: add docstring--enums
Browse files Browse the repository at this point in the history
  • Loading branch information
Khushiyant committed Jan 30, 2024
1 parent be0a7e0 commit 3075c55
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
3 changes: 1 addition & 2 deletions quasar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
from logging import ERROR, INFO, DEBUG


load_dotenv()
load_dotenv() # Load environment variables from .env file

__version__ = '0.1.0'


def main():
import sys
from quasar.cli import logger, cli

try:
Expand Down
4 changes: 2 additions & 2 deletions quasar/algorithm/detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def _detect(self, data, model_type):
return self.class_model.predict(data)[0]


def detect_smell(data, detector: Detector, model_type: str):
def detect_smell(data, detector: Detector, model_type: str) -> int:
"""
Detects smell in the given data using the specified detector and model type.
Expand All @@ -67,7 +67,7 @@ def detect_smell(data, detector: Detector, model_type: str):
model_type: The type of model used for smell detection.
Returns:
The result of smell detection.
The result of smell detection (int).
"""
return detector._detect(data, model_type)
4 changes: 2 additions & 2 deletions quasar/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_help(self, ctx):
@click.group(name='cli', cls=ASCIICommandClass)
@click.version_option(__version__, prog_name='Quasar')
@click.help_option('-h', '--help')
def cli():
def cli() -> None:
pass


Expand All @@ -39,7 +39,7 @@ def train_model(type, dataset, output):
@click.option('--path', '-p')
@click.option('--format', '-f',
type=click.Choice([t.value for t in FormatterType]))
def detect(type, path, format):
def detect(type, path, format) -> None:
"""
Detects the specified type of object in the given path and formats the output.
Expand Down
10 changes: 10 additions & 0 deletions quasar/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,25 @@


class ModelType(Enum):
"""
Enum representing different types of models.
"""
CLASS = 'CLASS'
METHOD = 'METHOD'


class SmellType(Enum):
"""
Enumeration representing different types of smells.
"""
CLASS = 'CLASS'
METHOD = 'METHOD'


class FormatterType(Enum):
"""
Represents the available formatter types for data serialization.
"""

JSON = 'JSON'
XML = 'XML'

0 comments on commit 3075c55

Please sign in to comment.