Repository navigation
Refactor and update modules for improved organization and functionality - #728
Conversation
|
@lucas-heck, can you review? |
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the module structure by reordering and standardizing imports across various dataset and augmentation files and updates configuration in the pre-commit settings for consistent code formatting. Key changes include:
- Reordering of imports (e.g. switching the order of BaseDataset and BaseConcatDataset) across multiple files.
- Standardization of import ordering to avoid circular dependencies.
- Updates to the .pre-commit-config.yaml to improve linter configuration and file matching.
Reviewed Changes
Copilot reviewed 154 out of 154 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| braindecode/datasets/xy.py | Reordered numpy/pandas imports and base module imports. |
| braindecode/datasets/tuh.py | Adjusted import ordering and moved import statements. |
| braindecode/datasets/sleep_physionet.py | Updated import order and removed redundant mne import. |
| braindecode/datasets/sleep_physio_challe_18.py | Standardized import order for mne and preprocessing function. |
| braindecode/datasets/nmt.py | Reordered imports; now includes pathlib and mock earlier. |
| braindecode/datasets/moabb.py | Adjusted import order of pandas and base module imports. |
| braindecode/datasets/mne.py | Removed duplicate mne import and reorders base module imports. |
| braindecode/datasets/bids.py | Updated import order and base module import; note typo in helper name. |
| braindecode/datasets/bcicomp.py | Reordered base module import order. |
| braindecode/datasets/bbci.py | Added a newline after future import for clarity. |
| braindecode/datasets/base.py | Adjusted imports to avoid circular import; consistent ordering. |
| braindecode/datasets/init.py | Reordered exports for better organization. |
| braindecode/classifier.py | Moved import statement to group similar imports together. |
| braindecode/augmentation/transforms.py | Consolidated functional imports into a single grouped import. |
| braindecode/augmentation/functional.py | Reordered imports to group torch-related imports together. |
| braindecode/augmentation/base.py | Reordered typing imports for consistency. |
| braindecode/augmentation/init.py | Updated linter and file matching configuration for imports. |
| braindecode/init.py | Rearranged import order to import version after classifier. |
| benchmark_filterbank.py | New benchmark file added for parallelized evaluation. |
| .pre-commit-config.yaml | Updated linter configurations and added isort hook. |
Comments suppressed due to low confidence (1)
braindecode/datasets/bids.py:25
- There is a spelling mistake in the function name '_descriptiion_from_bids_path'; consider renaming it to '_description_from_bids_path' for clarity.
def _descriptiion_from_bids_path(bids_path: mne_bids.BIDSPath) -> dict[str, Any]:
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #728 +/- ##
=======================================
Coverage 87.66% 87.67%
=======================================
Files 82 93 +11
Lines 7558 7546 -12
=======================================
- Hits 6626 6616 -10
+ Misses 932 930 -2 🚀 New features to boost your workflow:
|
|
@agramfort, if you have some time to look at the new API doc structure here: https://output.circle-artifacts.com/output/job/d7023a3b-e9f5-46d2-a29e-af7af5756c0c/artifacts/0/dev/api.html I would appreciate it, but no problem if not. |
PierreGtch
left a comment
There was a problem hiding this comment.
Mayn public functions/classes were moved. Should we also keep the old import paths with deprecated warnings? Or should we make a new major version?
|
Major release is the way to go, the what's new file is too big at the moment. Let's sync with the competition timeline, it's time for us to refine the press release material. |
There was a problem hiding this comment.
Pull Request Overview
This pull request refactors several modules to improve code organization, resolve import issues, and enhance maintainability. Key changes include:
- Reordering and standardizing import statements across multiple modules.
- Fixing a typo in a function name (_descriptiion → _description) to improve clarity.
- Updating pre-commit hooks with new linting and formatting configurations.
Reviewed Changes
Copilot reviewed 149 out of 149 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| braindecode/datautil/init.py | Reordered import list for serialization functions. |
| braindecode/datasets/xy.py | Standardized import ordering for dataset functionality. |
| braindecode/datasets/tuh.py | Reorganized imports for clarity and consistency. |
| braindecode/datasets/sleep_physionet.py | Reordered imports and updated base dataset imports. |
| braindecode/datasets/sleep_physio_challe_18.py | Reorganized import statements and dependency ordering. |
| braindecode/datasets/nmt.py | Standardized and reordered import sections. |
| braindecode/datasets/moabb.py | Adjusted import order for consistency. |
| braindecode/datasets/mne.py | Updated import order and dependency groupings. |
| braindecode/datasets/bids.py | Fixed typo in function name and standardized import order. |
| braindecode/datasets/bcicomp.py | Minor import order modifications for consistency. |
| braindecode/datasets/bbci.py | Adjusted imports with no functional changes. |
| braindecode/datasets/base.py | Updated import order and clarified inline import comments. |
| braindecode/datasets/init.py | Standardized module re-exports and import order. |
| braindecode/classifier.py | Revised import sequence for classifier modules. |
| braindecode/augmentation/transforms.py | Consolidated individual functional imports into a grouped format. |
| braindecode/augmentation/functional.py | Adjusted import order to align torch and mne dependencies. |
| braindecode/augmentation/base.py | Reordered typing and dependency imports for clarity. |
| braindecode/augmentation/init.py | Reordered and re-exported transform imports for consistency. |
| braindecode/init.py | Revised import order, including version and classifier modules. |
| .pre-commit-config.yaml | Added new linting and formatting hooks with ruff and isort. |
|
@bruAristimunha Indeed the change log is becoming super large. We could create more subsections in the log for better clarity, for this release at least. Something like
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…aindecode into modules-moving
PierreGtch
left a comment
There was a problem hiding this comment.
Allright, then we will make a major version so it's fine to change the API. Nice reorganisation @bruAristimunha :) Code is much more clear now and it should promote re-using modules between models
|
thank you @PierreGtch ;) |
This update reorganizes various modules, resolves import issues, and enhances the overall structure of the codebase. It includes moving functions, updating configurations, and refining documentation to ensure better maintainability and clarity.
closed: #585, #577