Repository navigation
Conversation
- tract_querier/util.py (LabelsBundles) and the empty tract_querier/decorators.py have no users. - tract_querier/code_util (DocStringInheritor) was only used through `__metaclass__ = DocStringInheritor` in EvaluateQueries, a class attribute that Python 3 ignores; the import and that line go too. - tract_querier/aabb.py: AABBTree could not be instantiated (its __init__ calls a non-existent buildTree; build_tree uses np.int), and the BoundingBox methods old_intersection, collides_width, split, contains, __contains__ and intersection have no callers. BoundingBox construction, its properties and union, used by the spatial indexing and relative queries, are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 4, 2026
This branch has not been deployed
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.
What was wrong
Part of the dead code listed in #107, limited to the core package files no other open work touches. Evidence for each item is a whole-repository
git grep(package,scripts/, tests,doc/,.qryfiles):tract_querier/util.py(LabelsBundles): no reference toLabelsBundlesor to theutilmodule anywhere (the onlyutilhits arevtk.utilandnipype.interfaces.ants.utils).tract_querier/decorators.py: empty file, never imported.tract_querier/code_util/(DocStringInheritor): only used as__metaclass__ = DocStringInheritorinEvaluateQueries(query_processor.py), a plain class attribute on Python 3, so the metaclass never ran.tract_querier/aabb.py:AABBTreecannot be instantiated: on masterAABBTree([BoundingBox([0, 0, 0, 1, 1, 1])])raisesAttributeError: 'AABBTree' object has no attribute 'buildTree';build_treeandbuildTree_oldalso usenp.int, removed in NumPy 1.24.AABBTree,buildTree,build_tree,intersect,forwardMaphave no users.BoundingBox.old_intersection,collides_width,split,contains,intersection: no callers. Theintersection/unionhits outsideaabb.pyare allsetorFiberQueryInfomethods;collides_widthonly callsintersection.BoundingBox.__contains__: no... in <bounding box>anywhere, and it is wrong (compares the point against the lower corner twice: on master[1, 1, 1] in BoundingBox([0, 0, 0, 2, 2, 2])isFalse).Change
The files and code above are deleted, plus
from .code_util import DocStringInheritorand__metaclass__ = DocStringInheritorintract_querier/query_processor.py(nothing else in that file).BoundingBox.__new__,__str__, the side properties (left...superior,volume,side_lengths) andunion, used bytract_label_indices.pyand the relative-position queries, are kept. A comment# @add_metaclass(DocStringInheritor)remains inquery_processor.py(line 110); it can go with the openquery_processor.pywork.Not in this PR (other parts of #107, handled separately):
tract_math/tract_obb.py,tract_math/operations.py,tensor_operations.py,tract_label_indices.py,tractography/vtkInterface.py,tractography/tractography.py,scripts/cli_tract_math.py.No behaviour change for users.
Testing
pytest -q -p no:cacheprovider tract_querier: 42 passed, 1 skipped (a first run hit the known randomtest_not_infailure fixed by TST: Fix random failures oftest_not_in#97; the rerun passed).doc/tract_querier.rstautosummary lists none of the removed modules.make -C doc htmlbuilds (exit 0) with the same 22 warnings as master (sorted warning lines diffed, identical).Merge order
Merge last among the open #107/#115 work: it may conflict with the
query_processor.pyPR for #115 on the__metaclass__/ import lines, and textually with the old #75 (absolute imports) inquery_processor.py.Part of #107
🤖 Generated with Claude Code