-
Notifications
You must be signed in to change notification settings - Fork 96
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
Add function to create app #1546
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1546 +/- ##
===========================================
- Coverage 73.37% 73.37% -0.01%
===========================================
Files 134 134
Lines 23973 23976 +3
===========================================
+ Hits 17591 17592 +1
- Misses 6382 6384 +2
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
WalkthroughThe changes primarily focus on enhancing code readability and maintainability. Key modifications include renaming functions for clarity, adding docstrings for better understanding, and refactoring the main function to improve modularity. The creation of a Qt application is now handled by a dedicated function, and the main function signature has been simplified. Changes
TipsChat with CodeRabbit Bot (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Files selected for processing (1)
- sleap/gui/app.py (4 hunks)
Additional comments (Suppressed): 5
sleap/gui/app.py (5)
264-267: The
dropEvent
method has not been changed in this hunk. It appears to be identical to the old hunk.1604-1612: The function
create_parser
has been renamed tocreate_sleap_label_parser
for clarity. This is a good practice as it makes the function's purpose more explicit. Ensure all calls to this function have been updated to reflect the new name.1652-1659: The creation of the Qt application, which was previously done in the
main
function, has been moved to a new functioncreate_app
. This improves modularity and makes themain
function cleaner. Ensure all necessary initializations for the Qt application are done in this function.1662-1668: The
main
function now uses the renamedcreate_sleap_label_parser
function and the newcreate_app
function. Thelabels
argument has been removed from the function signature, simplifying its usage. Ensure that all calls to this function have been updated to match the new signature.1677-1680: The
main
function now uses thecreate_app
function to create the Qt application. This makes themain
function cleaner and more readable.
Description
When testing things, I often find myself running subsets of sleep.gui.app.main. This PR just breaks up main a little bit and adds a create_app function. Mainly for troubleshooting/testing.
Types of changes
Does this address any currently open issues?
[list open issues here]
Outside contributors checklist
Thank you for contributing to SLEAP!
❤️
Summary by CodeRabbit
Refactor:
sleap/gui/app.py
to improve code readability and maintainability.create_app
for creating a Qt application, enhancing modularity.create_parser
tocreate_sleap_label_parser
for better clarity.labels
argument from themain
function signature to simplify its usage.Documentation:
create_sleap_label_parser
function to provide more context about its purpose and usage.