BF: Remove all traces of Forceps bundles.#116
Merged
Conversation
Calling to the __del_item__ instead of removing them just from the list of bundle_names should remove the key as well as the name. This partially address tractometry#115, I believe.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR removes Forceps bundles by calling the __delitem__ method instead of just removing them from the bundle names list, ensuring both the key and name are properly deleted. It also adds a test case to verify the deletion functionality works correctly.
- Updated bundle removal logic to use
del self[bundle_name]instead ofself.bundle_names.remove() - Added test coverage for bundle deletion behavior
- Fixed iteration over bundle dictionary to use
bundle_namesproperty
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| AFQ/api/bundle_dict.py | Changed from removing bundle names to deleting bundle entries using __delitem__ |
| AFQ/api/group.py | Updated loop iteration to use bundle_names property instead of keys() |
| AFQ/tests/test_bundle_dict.py | Added test case to verify bundle deletion functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Member
Author
|
I can confirm that this removes the error mentioned in #115 (item 1) when run locally on my laptop. |
Collaborator
|
This looks great to me! Good find |
Member
Author
|
Yay! This was a fun Friday afternoon PR. I'll merge when the CI comes back green. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Calling to the
__del_item__method instead of removing these just from the list ofbundle_namesshould remove the key as well as the name.This partially address #115, I believe.