-
Notifications
You must be signed in to change notification settings - Fork 205
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
Fixed the Messy code that needed too many paramenters #2669
base: main
Are you sure you want to change the base?
Conversation
Thank you for contributing to
|
0ba142c
to
fd0292d
Compare
fd0292d
to
6830398
Compare
e683900
to
6830398
Compare
a553949
to
b06401a
Compare
43fff03
to
d825cce
Compare
b111f9e
to
09343f1
Compare
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Reference Issues/PRs
Fixes #2650.
This PR addresses the issue of simplifying the create_multi_comparison_matrix function by improving its parameters and saving functionality.
What does this implement/fix? Explain your changes.
This PR simplifies the create_multi_comparison_matrix function by reducing the number of parameters required for saving files and ordering results. Specifically:
1. File Saving Simplification:
Replaced multiple parameters (pdf_savename, png_savename, etc.) with a single save_files dictionary. Users can now specify the file format and name as key-value pairs (e.g., {"pdf": "output.pdf", "png": "output.png"}). This reduces clutter and improves usability.
2. Ordering Parameters Simplification:
Consolidated order_win_tie_loss and order_better into a single order_settings dictionary (e.g., {"win_tie_loss": "higher", "better": "decreasing"}). This makes the function more intuitive and easier to use.
3. Added Logging:
Introduced logging to improve tracking of function execution and debugging. Key steps (e.g., loading data, performing analysis, saving files) are now logged for better visibility and troubleshooting.
These changes improve usability, maintainability, and reduce the cognitive load on users while addressing the concerns raised in issue #2650.
Does your contribution introduce a new dependency? If yes, which one?
No new dependencies are introduced. The logging module is part of Python's standard library.
Any other comments?
The changes are backward-compatible, as the new save_files and order_settings parameters replace older parameters without breaking existing functionality.
Logging has been added to enhance debugging and monitoring capabilities.
The updated function has been tested with various file formats and ordering configurations to ensure robustness.
Example Usage
fig = create_multi_comparison_matrix( df_results="results.csv", save_files={"pdf": "output.pdf", "png": "output.png"}, order_settings={"win_tie_loss": "higher", "better": "decreasing"}, used_statistic="Accuracy", dataset_column="dataset_name", )
Linked Issue
This PR directly addresses issue #2650, which highlighted the need to simplify the create_multi_comparison_matrix function's parameters and saving functionality. The changes proposed here resolve the issue by making the function more user-friendly and maintainable.