Remi-Gau / nilearn

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

[TEST] Format examples #11

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.

For new features:

For bug fixes:

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 increase code quality in the affected files by 0.05%.

Quality metrics Before After Change
Complexity 6.15 ⭐ 5.95 ⭐ -0.20 πŸ‘
Method Length 160.43 😞 160.40 😞 -0.03 πŸ‘
Working memory 10.21 😞 10.21 😞 0.00
Quality 55.95% πŸ™‚ 56.00% πŸ™‚ 0.05% πŸ‘
Other metrics Before After Change
Lines 5903 6451 548
Changed files Quality Before Quality After Quality Change
setup.py 66.88% πŸ™‚ 66.88% πŸ™‚ 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.81% 😞 -0.04% πŸ‘Ž
examples/05_glm_second_level/plot_second_level_design_matrix.py 70.41% πŸ™‚ 70.67% πŸ™‚ 0.26% πŸ‘
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.03% πŸ™‚ -0.35% πŸ‘Ž
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% ⭐ 80.94% ⭐ -0.29% πŸ‘Ž
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% 😞 47.96% 😞 -0.38% πŸ‘Ž
examples/06_manipulating_images/plot_negate_image.py 80.79% ⭐ 80.79% ⭐ 0.00%
examples/06_manipulating_images/plot_nifti_labels_simple.py 65.65% πŸ™‚ 65.56% πŸ™‚ -0.09% πŸ‘Ž
examples/06_manipulating_images/plot_nifti_simple.py 59.74% πŸ™‚ 59.67% πŸ™‚ -0.07% πŸ‘Ž
examples/06_manipulating_images/plot_resample_to_template.py 59.41% πŸ™‚ 55.36% πŸ™‚ -4.05% πŸ‘Ž
examples/06_manipulating_images/plot_roi_extraction.py 36.87% 😞 36.86% 😞 -0.01% πŸ‘Ž
examples/06_manipulating_images/plot_smooth_mean_image.py 80.68% ⭐ 80.53% ⭐ -0.15% πŸ‘Ž
maint_tools/show-python-packages-versions.py 88.79% ⭐ 87.58% ⭐ -1.21% πŸ‘Ž
nilearn/image/__init__.py 62.81% πŸ™‚ 62.81% πŸ™‚ 0.00%
nilearn/image/image.py 57.01% πŸ™‚ 56.89% πŸ™‚ -0.12% πŸ‘Ž
nilearn/image/resampling.py 28.56% 😞 29.25% 😞 0.69% πŸ‘
nilearn/image/tests/test_image.py 65.04% πŸ™‚ 65.10% πŸ™‚ 0.06% πŸ‘
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 56 β›” 904 β›” 27 β›” 3.65% β›” 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 10 πŸ™‚ 409 β›” 15 😞 33.36% 😞 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 ⭐ 200 😞 20 β›” 39.23% 😞 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 #11 (e3e3beb) into main (33ce6e0) will decrease coverage by 0.01%. The diff coverage is 92.03%.

@@            Coverage Diff             @@
##             main      #11      +/-   ##
==========================================
- Coverage   91.00%   91.00%   -0.01%     
==========================================
  Files         133      133              
  Lines       15360    15350      -10     
  Branches     3034     3031       -3     
==========================================
- Hits        13979    13969      -10     
  Misses        817      817              
  Partials      564      564              
Impacted Files Coverage Ξ”
nilearn/image/resampling.py 93.93% <88.88%> (-0.06%) :arrow_down:
nilearn/image/image.py 95.62% <94.64%> (-0.11%) :arrow_down:
nilearn/image/__init__.py 100.00% <100.00%> (ΓΈ)

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