chore: remove unused private functions#143
Open
KenyaOtsuka wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Removes multiple private/unreferenced helper functions across MRI, dataform, and torch-related modules to reduce dead code and simplify maintenance.
Changes:
- Deleted unused private MRI helpers (
__get_xyz,__load_mri) frombdpy/mri/fmriprep.py. - Deleted an unused dataset string helper (
_removesuffix) and an unused feature helper (_apply_to_features). - Removed an unimplemented/unused
DecodedFeatures.__init_dbstub.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| bdpy/recon/torch/task/inversion.py | Removes unused _apply_to_features helper (now leaves an unused Callable import). |
| bdpy/mri/fmriprep.py | Removes unused private MRI-loading/xyz helper functions. |
| bdpy/dl/torch/dataset.py | Removes unused _removesuffix compatibility wrapper. |
| bdpy/dataform/features.py | Removes unused/unimplemented DecodedFeatures.__init_db stub. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -14,12 +14,6 @@ | |||
| _FeatureType = Dict[str, torch.Tensor] | |||
Author
|
If any of these should be kept or removed gradually with a deprecation warning over a few releases rather than deleted outright, please let me know. |
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.
Summary
Remove private functions with no callers anywhere in the codebase.
__get_xyzbdpy/mri/fmriprep.py__load_mribdpy/mri/fmriprep.pyDecodedFeatures.__init_dbbdpy/dataform/features.pyNotImplementedError_apply_to_featuresbdpy/recon/torch/task/inversion.py_removesuffixbdpy/dl/torch/dataset.pystr.removesuffixwrapperfmriprep.__load_mriandfmriprep.__get_xyzwere flagged as dead code to be removed separately in #138.Checks
Environment: Python 3.11.15, Linux x86_64 (glibc 2.39), numpy 2.4.6, scipy 1.17.1, h5py 3.16.0, hdf5storage 0.2.2
uv run pytest: 135 passed, 1 pre-existing failure intests/ml/test_learning.py(external depfastl2lir, unrelated to this PR)uv run ruff check: pre-existing errors only; no new errors introduceduv run mypy bdpy: pre-existing errors only; no new errors introduced