Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply PEP8 styling and improve code quality #233

Merged
merged 4 commits into from
Apr 15, 2023

Conversation

bugfloyd
Copy link
Contributor

This PR addresses several code quality improvements and applies PEP8 styling standards. The changes include:

  • Apply PEP8 styling standards and reformat the code:

    • Improve spacing and indentation
    • Split long lines into multiple lines
  • Enhance variable names and definitions:

    • Resolve shadowed variable names
    • Convert unused method parameters to private variables
    • Fix instances of variables being referenced before assignment
    • Improve parameter documentation for better readability
  • Remove duplicate code and streamline logic:

    • Create a new method add_chat_request_to_usage_tracker in the ChatGPTTelegramBot class to centralize usage tracking logic
    • Define a new method add_current_costs in the UsageTracker class to handle cost calculations in a more concise manner

Fix shadow names
Convert unused method parameters to private
Fix variable referenced before assignment
Improve parameter docs
define new method in ChatGPTTelegramBot:
  add_chat_request_to_usage_tracker
define new method add_current_costs in UsageTracker
@n3d1117
Copy link
Owner

n3d1117 commented Apr 15, 2023

Thank you @bugfloyd 🚀

@n3d1117 n3d1117 merged commit 3036c25 into n3d1117:main Apr 15, 2023
@bugfloyd bugfloyd deleted the refactor/pep8_and_more branch April 15, 2023 14:32
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.

None yet

2 participants