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

Improve Console Output Readability #14

Closed
wants to merge 7 commits into from
Closed

Improve Console Output Readability #14

wants to merge 7 commits into from

Conversation

AnujSaha0111
Copy link
Contributor

Improve console output readability with enhanced print formatting using colorama

Improve console output readability with enhanced print formatting using colorama
@ombhojane
Copy link
Owner

improve_console_output.py is looking correct, please try to integrate it with core package so it'll reflect in the logs

custom logger that formats log messages with colors using colorama

Example usage of it in Core Functions:

# model_analysis.py

from custom_logger import setup_logger

# Initialize logger
logger = setup_logger('ModelAnalysis')

def analyze_model(accuracy):
    logger.info("Analyzing model...")
    logger.info(f"Accuracy: {accuracy:.3f}")

def display_error(message):
    logger.error(f"Error: {message}")

def display_warning(message):
    logger.warning(f"Warning: {message}")

def main():
    accuracy = 0.91234  # Example accuracy value
    analyze_model(accuracy)
    
    # Example usage of other log functions
    display_error("An error occurred while loading the model.")
    display_warning("This model may take a long time to train.")

if __name__ == "__main__":
    main()
Integrate enhanced print formatting into core package with custom logger
@AnujSaha0111
Copy link
Contributor Author

AnujSaha0111 commented Oct 1, 2024

please check for the updated pull request

@ombhojane
Copy link
Owner

ombhojane commented Oct 1, 2024

Hey @AnujSaha0111 efforts appreciated

We're expecting something like this:
Example:

from colorama import Fore, Style

# Before
print("Analyzing model...")

# After
print(f"{Fore.BLUE}Analyzing model...{Style.RESET_ALL}")

You may remove the newly added codes, and just enhance the existing logic codes

Please reach out for any doubts

Enhanced console output readability with colorama
@AnujSaha0111
Copy link
Contributor Author

AnujSaha0111 commented Oct 1, 2024

updated the file with Enhanced console output readability with colorama
Neglect the custom logger file pulled before

@ombhojane
Copy link
Owner

ombhojane commented Oct 1, 2024

Please don't create any new file!

Have the changes in current core package files only!
Then only it'll be a quality contribution, as it'll be useful to users for better understanding in console logs when they use the package

@AnujSaha0111
Copy link
Contributor Author

made changes in core.py

Copy link
Owner

@ombhojane ombhojane left a comment

Choose a reason for hiding this comment

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

code is looking good!

Please remove 'self._analyze_models()' this line with as it was previously ie. 'self.model_comparison_results = self._compare_models()'

I'll merge it just do this minor fix

@AnujSaha0111
Copy link
Contributor Author

updated the core.py as per asked

@AnujSaha0111
Copy link
Contributor Author

Check for the core.py after the commit message of 'Final Update core.py'

@ombhojane
Copy link
Owner

ombhojane commented Oct 1, 2024

This PR has been resolved at #21

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

Successfully merging this pull request may close these issues.

2 participants