Remi-Gau / nilearn

Machine learning for NeuroImaging in Python
http://nilearn.github.io
Other
1 stars 1 forks source link

TEST #20

Closed Remi-Gau closed 1 year ago

github-actions[bot] commented 1 year ago

πŸ‘‹ @Remi-Gau Thanks for creating a PR!

Until this PR is ready for review, you can include the [WIP] tag in its title, or leave it as a github draft.

Please make sure it is compliant with our contributing guidelines. In particular, be sure it checks the boxes listed below.

We will review it as quick as possible, feel free to ping us with questions if needed.

sourcery-ai[bot] commented 1 year ago

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.03%.

Quality metrics Before After Change
Complexity 3.98 ⭐ 3.97 ⭐ -0.01 πŸ‘
Method Length 215.71 β›” 215.00 β›” -0.71 πŸ‘
Working memory 11.77 😞 11.79 😞 0.02 πŸ‘Ž
Quality 51.42% πŸ™‚ 51.39% πŸ™‚ -0.03% πŸ‘Ž
Other metrics Before After Change
Lines 14345 16264 1919
Changed files Quality Before Quality After Quality Change
setup.py 66.82% πŸ™‚ 66.82% πŸ™‚ 0.00%
examples/00_tutorials/plot_3d_and_4d_niimg.py 69.80% πŸ™‚ 69.80% πŸ™‚ 0.00%
examples/00_tutorials/plot_decoding_tutorial.py 40.11% 😞 40.11% 😞 0.00%
examples/00_tutorials/plot_nilearn_101.py 84.09% ⭐ 84.09% ⭐ 0.00%
examples/00_tutorials/plot_python_101.py 91.06% ⭐ 91.06% ⭐ 0.00%
examples/00_tutorials/plot_single_subject_single_run.py 39.84% 😞 39.84% 😞 0.00%
examples/01_plotting/plot_atlas.py 83.28% ⭐ 83.28% ⭐ 0.00%
examples/01_plotting/plot_carpet.py 49.87% 😞 49.87% 😞 0.00%
examples/01_plotting/plot_colormaps.py 48.95% 😞 48.95% 😞 0.00%
examples/01_plotting/plot_dim_plotting.py 79.20% ⭐ 79.20% ⭐ 0.00%
examples/01_plotting/plot_haxby_masks.py 55.38% πŸ™‚ 55.38% πŸ™‚ 0.00%
examples/01_plotting/plot_multiscale_parcellations.py 82.19% ⭐ 82.19% ⭐ 0.00%
examples/01_plotting/plot_overlay.py 72.98% πŸ™‚ 72.98% πŸ™‚ 0.00%
examples/01_plotting/plot_prob_atlas.py 50.98% πŸ™‚ 50.90% πŸ™‚ -0.08% πŸ‘Ž
examples/01_plotting/plot_visualization.py 66.39% πŸ™‚ 66.39% πŸ™‚ 0.00%
examples/01_plotting/plot_visualize_megatrawls_netmats.py 87.65% ⭐ 87.65% ⭐ 0.00%
examples/02_decoding/plot_haxby_anova_svm.py 54.70% πŸ™‚ 54.70% πŸ™‚ 0.00%
examples/02_decoding/plot_haxby_different_estimators.py 30.15% 😞 30.15% 😞 0.00%
examples/02_decoding/plot_haxby_full_analysis.py 37.67% 😞 37.66% 😞 -0.01% πŸ‘Ž
examples/02_decoding/plot_haxby_glm_decoding.py 40.01% 😞 40.01% 😞 0.00%
examples/02_decoding/plot_haxby_grid_search.py 33.56% 😞 33.56% 😞 0.00%
examples/02_decoding/plot_haxby_multiclass.py 45.53% 😞 45.53% 😞 0.00%
examples/02_decoding/plot_haxby_searchlight.py 44.54% 😞 44.54% 😞 0.00%
examples/02_decoding/plot_haxby_stimuli.py 61.20% πŸ™‚ 61.20% πŸ™‚ 0.00%
examples/02_decoding/plot_miyawaki_encoding.py 48.46% 😞 48.45% 😞 -0.01% πŸ‘Ž
examples/02_decoding/plot_miyawaki_reconstruction.py 49.48% 😞 49.48% 😞 0.00%
examples/02_decoding/plot_oasis_vbm.py 39.20% 😞 39.20% 😞 0.00%
examples/02_decoding/plot_oasis_vbm_space_net.py 54.98% πŸ™‚ 54.98% πŸ™‚ 0.00%
examples/02_decoding/plot_simulated_data.py 45.06% 😞 45.04% 😞 -0.02% πŸ‘Ž
examples/03_connectivity/plot_atlas_comparison.py 67.32% πŸ™‚ 67.32% πŸ™‚ 0.00%
examples/03_connectivity/plot_compare_decomposition.py 50.42% πŸ™‚ 50.42% πŸ™‚ 0.00%
examples/03_connectivity/plot_data_driven_parcellations.py 36.39% 😞 36.40% 😞 0.01% πŸ‘
examples/03_connectivity/plot_extract_regions_dictlearning_maps.py 43.04% 😞 43.04% 😞 0.00%
examples/03_connectivity/plot_inverse_covariance_connectome.py 63.09% πŸ™‚ 63.09% πŸ™‚ 0.00%
examples/03_connectivity/plot_multi_subject_connectome.py 59.92% πŸ™‚ 59.92% πŸ™‚ 0.00%
examples/03_connectivity/plot_probabilistic_atlas_extraction.py 64.16% πŸ™‚ 64.16% πŸ™‚ 0.00%
examples/03_connectivity/plot_seed_to_voxel_correlation.py 53.64% πŸ™‚ 53.64% πŸ™‚ 0.00%
examples/03_connectivity/plot_signal_extraction.py 43.20% 😞 43.20% 😞 0.00%
examples/03_connectivity/plot_simulated_connectome.py 37.70% 😞 37.70% 😞 0.00%
examples/03_connectivity/plot_sphere_based_connectome.py 34.90% 😞 34.90% 😞 0.00%
examples/04_glm_first_level/plot_adhd_dmn.py 48.93% 😞 49.23% 😞 0.30% πŸ‘
examples/04_glm_first_level/plot_bids_features.py 48.54% 😞 48.54% 😞 0.00%
examples/04_glm_first_level/plot_design_matrix.py 44.89% 😞 44.89% 😞 0.00%
examples/04_glm_first_level/plot_fir_model.py 49.73% 😞 49.79% 😞 0.06% πŸ‘
examples/04_glm_first_level/plot_first_level_details.py 58.55% πŸ™‚ 58.58% πŸ™‚ 0.03% πŸ‘
examples/04_glm_first_level/plot_predictions_residuals.py 38.08% 😞 38.09% 😞 0.01% πŸ‘
examples/04_glm_first_level/plot_spm_multimodal_faces.py 40.98% 😞 41.07% 😞 0.09% πŸ‘
examples/04_glm_first_level/plot_write_events_file.py 61.16% πŸ™‚ 61.16% πŸ™‚ 0.00%
examples/05_glm_second_level/plot_oasis.py 50.50% πŸ™‚ 50.50% πŸ™‚ 0.00%
examples/05_glm_second_level/plot_proportion_activated_voxels.py 69.83% πŸ™‚ 69.83% πŸ™‚ 0.00%
examples/05_glm_second_level/plot_second_level_association_test.py 49.85% 😞 49.95% 😞 0.10% πŸ‘
examples/05_glm_second_level/plot_second_level_design_matrix.py 70.41% πŸ™‚ 70.41% πŸ™‚ 0.00%
examples/05_glm_second_level/plot_second_level_one_sample_test.py 41.52% 😞 41.52% 😞 0.00%
examples/05_glm_second_level/plot_second_level_two_sample_test.py 45.78% 😞 45.78% 😞 0.00%
examples/05_glm_second_level/plot_thresholding.py 56.38% πŸ™‚ 56.38% πŸ™‚ 0.00%
examples/06_manipulating_images/plot_affine_transformation.py 44.90% 😞 44.90% 😞 0.00%
examples/06_manipulating_images/plot_compare_mean_image.py 81.23% ⭐ 81.23% ⭐ 0.00%
examples/06_manipulating_images/plot_extract_regions_labels_image.py 74.67% πŸ™‚ 74.67% πŸ™‚ 0.00%
examples/06_manipulating_images/plot_extract_rois_smith_atlas.py 63.83% πŸ™‚ 63.83% πŸ™‚ 0.00%
examples/06_manipulating_images/plot_extract_rois_statistical_maps.py 67.55% πŸ™‚ 67.55% πŸ™‚ 0.00%
examples/06_manipulating_images/plot_mask_computation.py 48.34% 😞 48.34% 😞 0.00%
examples/06_manipulating_images/plot_nifti_labels_simple.py 65.65% πŸ™‚ 65.65% πŸ™‚ 0.00%
examples/06_manipulating_images/plot_nifti_simple.py 59.74% πŸ™‚ 59.74% πŸ™‚ 0.00%
examples/06_manipulating_images/plot_roi_extraction.py 36.87% 😞 36.87% 😞 0.00%
examples/06_manipulating_images/plot_smooth_mean_image.py 80.68% ⭐ 80.68% ⭐ 0.00%
examples/07_advanced/plot_advanced_decoding_scikit.py 38.46% 😞 38.45% 😞 -0.01% πŸ‘Ž
examples/07_advanced/plot_age_group_prediction_cross_val.py 49.66% 😞 49.66% 😞 0.00%
examples/07_advanced/plot_beta_series.py 47.23% 😞 47.23% 😞 0.00%
examples/07_advanced/plot_bids_analysis.py 49.34% 😞 49.34% 😞 0.00%
examples/07_advanced/plot_haxby_mass_univariate.py 40.17% 😞 40.17% 😞 0.00%
examples/07_advanced/plot_ica_neurovault.py 32.77% 😞 32.82% 😞 0.05% πŸ‘
examples/07_advanced/plot_ica_resting_state.py 66.56% πŸ™‚ 66.56% πŸ™‚ 0.00%
examples/07_advanced/plot_localizer_mass_univariate_methods.py 46.40% 😞 46.40% 😞 0.00%
examples/07_advanced/plot_localizer_simple_analysis.py 56.63% πŸ™‚ 56.63% πŸ™‚ 0.00%
examples/07_advanced/plot_neurovault_meta_analysis.py 75.32% ⭐ 75.32% ⭐ 0.00%
maint_tools/show-python-packages-versions.py 85.99% ⭐ 85.99% ⭐ 0.00%
nilearn/image/__init__.py 62.81% πŸ™‚ 62.81% πŸ™‚ 0.00%
nilearn/image/image.py 57.01% πŸ™‚ 56.93% πŸ™‚ -0.08% πŸ‘Ž
nilearn/image/resampling.py 28.56% 😞 28.51% 😞 -0.05% πŸ‘Ž
nilearn/image/tests/test_image.py 65.04% πŸ™‚ 64.96% πŸ™‚ -0.08% πŸ‘Ž
nilearn/image/tests/test_resampling.py 61.73% πŸ™‚ 61.74% πŸ™‚ 0.01% πŸ‘

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
nilearn/image/resampling.py resample_img 58 β›” 910 β›” 27 β›” 3.40% β›” Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
nilearn/image/image.py new_img_like 31 😞 253 β›” 12 😞 27.14% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
nilearn/image/resampling.py reorder_img 11 πŸ™‚ 409 β›” 16 β›” 31.33% 😞 Try splitting into smaller methods. Extract out complex expressions
nilearn/image/image.py _smooth_array 18 πŸ™‚ 216 β›” 11 😞 38.94% 😞 Try splitting into smaller methods. Extract out complex expressions
nilearn/image/image.py clean_img 7 ⭐ 197 😞 20 β›” 39.46% 😞 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

The πŸ‘ and πŸ‘Ž indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

codecov-commenter commented 1 year ago

Codecov Report

Merging #20 (f6c5ca1) into main (bf2eb51) will decrease coverage by 0.01%. The diff coverage is 93.23%.

:exclamation: Current head f6c5ca1 differs from pull request most recent head e893389. Consider uploading reports for the commit e893389 to get more accurate results

@@            Coverage Diff             @@
##             main      #20      +/-   ##
==========================================
- Coverage   91.01%   91.00%   -0.01%     
==========================================
  Files         133      133              
  Lines       15384    15378       -6     
  Branches     3212     3210       -2     
==========================================
- Hits        14001    13995       -6     
  Misses        819      819              
  Partials      564      564              
Impacted Files Coverage Ξ”
nilearn/decoding/space_net_solvers.py 98.05% <ΓΈ> (ΓΈ)
nilearn/image/resampling.py 93.99% <89.28%> (ΓΈ)
nilearn/image/image.py 95.65% <94.91%> (-0.08%) :arrow_down:
nilearn/decoding/decoder.py 95.97% <100.00%> (ΓΈ)
nilearn/decoding/searchlight.py 93.75% <100.00%> (ΓΈ)
nilearn/decoding/space_net.py 88.18% <100.00%> (ΓΈ)
nilearn/decomposition/_base.py 94.87% <100.00%> (ΓΈ)
nilearn/decomposition/_multi_pca.py 100.00% <100.00%> (ΓΈ)
nilearn/decomposition/canica.py 91.66% <100.00%> (ΓΈ)
nilearn/decomposition/dict_learning.py 89.06% <100.00%> (ΓΈ)
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.