Closed roomrys closed 1 year ago
The changes primarily revolve around enhancing the MainWindow
class and main
function in sleap/gui/app.py
to accept an optional labels
parameter, improving flexibility. Additionally, error handling has been introduced for CPU-only mode switch, and a new function create_parser
has been added for argument parsing.
File | Summary |
---|---|
sleap/gui/app.py |
Introduced labels parameter to MainWindow and main function, added create_parser function, and implemented error handling for CPU-only mode switch. |
sleap/gui/commands.py |
Enhanced loadProjectFile method to accept Union[str, Labels] parameter and improved do_action and ask functions to handle None filename and Labels instance respectively. |
🐇
In the land of code, changes were made,
With logic and precision, a foundation was laid.
The rabbit hopped, the keys did clatter,
Crafting solutions to make SLEAP better.
With labels in hand, and errors caught,
A more robust system, the rabbit has wrought. 🎉
Merging #1524 (9b5b1c7) into develop (ed77b49) will decrease coverage by
0.02%
. The diff coverage is63.63%
.
@@ Coverage Diff @@
## develop #1524 +/- ##
===========================================
- Coverage 73.39% 73.38% -0.02%
===========================================
Files 134 134
Lines 23961 23973 +12
===========================================
+ Hits 17586 17592 +6
- Misses 6375 6381 +6
Files | Coverage Δ | |
---|---|---|
sleap/gui/commands.py | 61.35% <100.00%> (ø) |
|
sleap/gui/app.py | 74.73% <50.00%> (-0.62%) |
:arrow_down: |
... and 1 file with indirect coverage changes
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
Description
This is more a debugging feature than anything else. A lot of the times when I want to visually inspect a project after making changes to the code, I will end up calling
sleap-label
through it's entry point functionsleap.gui.app.main
. This forces me to save the file and use the path to that file to then open the project in the GUI.This PR allows developers to
Labels
to visually inspect viasleap.gui.app.main
and it also
Types of changes
Does this address any currently open issues?
[list open issues here]
Outside contributors checklist
Thank you for contributing to SLEAP!
:heart:
Summary by CodeRabbit
New Features:
Labels
object to theMainWindow
constructor, providing more flexibility in initializing the main application window.create_parser
for creating an argument parser, improving code modularity and readability.Improvements:
loadProjectFile
method to accept aUnion[str, Labels]
parameter, allowing for more versatile project file loading.Bug Fixes:
do_action
function where it did not handle the case wherefilename
isNone
.ask
function to check if thefilename
parameter is an instance ofLabels
before loading the file, preventing potential errors.