Closed glopesdev closed 2 months ago
CodeRabbit
The proposed changes primarily focus on improving code readability, maintainability, and consistency. This is achieved through addressing linting warnings, updating docstrings, refactoring some parts of the code, and making minor adjustments in variable assignments and dictionary usage. Some changes also involve function signatures and import statements that may impact module resolution and external interfaces. The CI workflow and pre-commit hooks configurations have been updated as well.
Files | Summary |
---|---|
aeon/analysis/block_plotting.py, aeon/analysis/movies.py, aeon/analysis/plotting.py, aeon/dj_pipeline/tracking.py, aeon/io/device.py, aeon/analysis/utils.py, aeon/dj_pipeline/init.py, aeon/dj_pipeline/acquisition.py, aeon/dj_pipeline/utils/load_metadata.py, aeon/io/api.py, aeon/io/reader.py, aeon/dj_pipeline/scripts/clone_and_freeze_exp01.py, aeon/dj_pipeline/scripts/update_timestamps_longblob.py, aeon/util.py, aeon/dj_pipeline/create_experiments/insert_experiment_directory.ipynb, aeon/dj_pipeline/docs/notebooks/diagram.ipynb, aeon/dj_pipeline/docs/notebooks/social_experiments_block_analysis.ipynb, docs/examples/dj_example_octagon1_experiment.ipynb, aeon/dj_pipeline/populate/worker.py, tests/conftest.py | Improved code readability and maintainability by addressing linting warnings, updating docstrings, refactoring some parts of the code, and making minor adjustments in variable assignments and dictionary usage. |
aeon/dj_pipeline/qc.py, aeon/io/video.py, aeon/qc/video.py, aeon/dj_pipeline/scripts/clone_and_freeze_exp02.py, aeon/schema/core.py, aeon/schema/dataset.py, aeon/schema/foraging.py, aeon/schema/schemas.py, aeon/schema/social_02.py, aeon/schema/streams.py | Changes in function signatures and import statements that may impact module resolution and external interfaces. |
tests/dj_pipeline/test_acquisition.py, tests/dj_pipeline/test_pipeline_instantiation.py, tests/dj_pipeline/test_tracking.py, tests/io/test_api.py, aeon/init.py, aeon/dj_pipeline/utils/load_metadata.py, tests/dj_pipeline/test_tracking.py, tests/io/test_api.py | Modifications in test functions to improve code readability and consistency. |
.github/workflows/build_env_run_tests.yml, .pre-commit-config.yaml | Updated the CI workflow and pre-commit hooks configurations. |
aeon/dj_pipeline/webapps/sciviz/apk_requirements.txt | Minor change related to adding a newline at the end of the file in the git bash script. |
aeon/dj_pipeline/analysis/block_analysis.py | Optimized code by addressing linting warnings, improving variable assignments, and enhancing dictionary usage. |
aeon/dj_pipeline/populate/worker.py | Removed a function and added a new one with minor adjustments in the code. |
aeon/dj_pipeline/utils/streams_maker.py | Updated variable name in a loop within a function. |
aeon/io/reader.py | Improved code readability and maintainability by addressing linting warnings, updating docstrings, using constant variables, and refactoring some parts of the code. |
tests/dj_pipeline/test_pipeline_instantiation.py | Changes in test functions related to pipeline instantiation and experiment creation. |
tests/dj_pipeline/test_qc.py | Removed extraneous whitespace in a test function. |
tests/io/test_api.py | Modified test assertions related to data indexing and timestamps, introducing a constant variable for downsampling period. |
@glopesdev Thanks I'll go back and apply the fixes suggested here to clear as much of the Ruff rules as possible
I opened a separate PR #409 that adds on to the current PR and reduces the ruff errors down to 9 - could use some input from @ttngu207 as most of those are in dj_pipeline. The remaining 16 pyright errors can be addressed in a separate PR.
Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.
Thanks for integrating Codecov - We've got you covered :open_umbrella:
We have failing CI checks for a long time now purely because of ruff linting and pyright warnings. This PR clears all these warnings, either by addressing the suggestions, or ignoring the warnings where reasonable, e.g. docstrings on magic methods, etc.
The current PR is taking us from ~250 errors to zero errors. The final errors were grouped into the below 4 types and have all been resolved:
aeon\io\reader.py:338 and 341
: PLR2004 Magic value used in comparison, consider replacing0.3
with a constant variableaeon\dj_pipeline\utils\streams_maker.py:129:9
: PLW2901for
loop variablecol
overwritten by assignment targetaeon\dj_pipeline\populate\worker.py:49:5
: F841 Local variableexperiment_names
is assigned to but never useddict
call (rewrite as a literal) inaeon\dj_pipeline\analysis\block_analysis.py
To reproduce the required checks: run
pre-commit install
andpre-commit run --all-files
or see Workflow runIn the process we have also now enabled resolving all checks for all platforms, including resolving an outstanding issue for datajoint macOS wheels (see #406)
Fixes #411 Fixes #412 Fixes #344 Fixes #249
@coderabbitai: ignore
Summary by CodeRabbit