Closed roomrys closed 3 months ago
The recent updates primarily focus on refining the state management within the SLEAP application's GUI. By ensuring that the context.state["instance"]
is reset to None
after instance deletions, the modifications enhance the accuracy and reliability of the application's state. Additionally, corresponding tests have been updated to validate these changes, thereby improving overall code robustness.
Files | Change Summaries |
---|---|
sleap/gui/commands.py |
Added context.state["instance"] = None after instance removals in _do_deletion , do_action , and DeleteSelectedInstanceTrack . |
tests/gui/test_app.py |
Included assertions to ensure app.state["instance"] is None after specified operations. |
sequenceDiagram
participant User
participant GUI
participant CommandContext
participant State
User->>GUI: Initiates delete action
GUI->>CommandContext: _do_deletion(lf_inst_list)
CommandContext->>State: Remove instances from state
CommandContext->>State: Update state["instance"] to None
State-->>GUI: Acknowledgement
User->>GUI: Initiates action
GUI->>CommandContext: do_action(params)
CommandContext->>State: Perform action
CommandContext->>State: Update state["instance"] to None
State-->>GUI: Acknowledgement
In the realm where data bounds, Code now clears its grounds, Instances gone with care, State reset, nothing there.
Tests affirm the new strife, Safeguarding this digital life. 🎉🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Attention: Patch coverage is 50.00000%
with 2 lines
in your changes missing coverage. Please review.
Project coverage is 74.06%. Comparing base (
7ed1229
) to head (9b4933a
). Report is 14 commits behind head on develop.
Files | Patch % | Lines |
---|---|---|
sleap/gui/commands.py | 50.00% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Do a scan of instance state
Orally approved in subgroup meeting, and I searched the codebase for state["instance"]
and each case seems to handle when state["instance"] is None
, so yolo-merging!
Description
Currently, in the commands where we remove the selected instance from our
Labels
object, we keep the instance inGuiState["instance"]
.This doesn't seem like appropriate logic, and it is also leading to some problems for me in:
1807
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