Skip to content

style: format code with Autopep8, isort and Ruff Formatter#19

Open
deepsource-autofix[bot] wants to merge 1 commit into
mainfrom
deepsource-transform-50b37732
Open

style: format code with Autopep8, isort and Ruff Formatter#19
deepsource-autofix[bot] wants to merge 1 commit into
mainfrom
deepsource-transform-50b37732

Conversation

@deepsource-autofix

@deepsource-autofix deepsource-autofix Bot commented Jan 1, 2025

Copy link
Copy Markdown
Contributor

This commit fixes the style issues introduced in 5298bb0 according to the output
from Autopep8, isort and Ruff Formatter.

Details: None

Summary by Sourcery

Chores:

  • Apply automatic style fixes to the codebase.

This commit fixes the style issues introduced in 5298bb0 according to the output
from Autopep8, isort and Ruff Formatter.

Details: None
@sourcery-ai

sourcery-ai Bot commented Jan 1, 2025

Copy link
Copy Markdown

Reviewer's Guide by Sourcery

This pull request improves code style by resolving formatting issues identified by Autopep8, isort, and Ruff Formatter across multiple files.

Class diagram showing the affected classes and their relationships

classDiagram
    class TextClassifer {
        +load_data(texts, labels, data_name)
    }
    class HuggingfaceClassifer {
        -tokenizer
        -model
        -tokenzier_config
        +_label_encode(labels)
        +_tokenize(texts, labels)
        +train()
    }
    class SklearnClassifier {
        -tokenizer
        +_init_sklearn_pipeline(pipeline_config)
    }
    TextClassifer <|-- HuggingfaceClassifer
    TextClassifer <|-- SklearnClassifier
    note for HuggingfaceClassifer "Code formatting improved
No functional changes"
    note for SklearnClassifier "Code formatting improved
No functional changes"
Loading

File-Level Changes

Change Details Files
Formatting of function parameters
  • Parameters in function definitions are now consistently formatted with line breaks and indentation to improve readability.
src/everyai/classifier/classify.py
Import order and formatting
  • Imports are reorganized and formatted according to isort standards, ensuring a consistent import structure.
src/everyai/classifier/huggingface_classifier.py
Simplified variable assignment
  • Unnecessary parentheses around variable assignments have been removed to reduce visual clutter.
src/everyai/classifier/classify.py
String formatting updates
  • f-strings are used consistently for string formatting, improving code clarity and conciseness.
src/everyai/classifier/classify.py
src/everyai/main.py
Logging message formatting
  • Logging messages are formatted consistently to enhance readability and maintainability.
src/everyai/classifier/classify.py
src/everyai/classifier/sklearn_classifier.py
Import organization and formatting
  • Imports are grouped and formatted according to isort standards, improving code structure and readability.
src/everyai/config/config.py
Tokenizer initialization
  • Tokenizer initialization is simplified by removing redundant code, making the code more concise.
src/everyai/classifier/sklearn_classifier.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have skipped reviewing this pull request. It seems to have been created by a bot (hey, deepsource-autofix[bot]!). We assume it knows what it's doing!

@deepsource-io

deepsource-io Bot commented Jan 1, 2025

Copy link
Copy Markdown
Contributor

Here's the code health analysis summary for commits 5298bb0..d2a3005. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython✅ Success
🎯 7 occurences resolved
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants