cosimoNigro / agnpy

Modelling jetted Active Galactic Nuclei radiative processes with python
https://agnpy.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
48 stars 33 forks source link

absorption in synchrotron radiation (Sourcery refactored) #98

Closed sourcery-ai[bot] closed 3 years ago

sourcery-ai[bot] commented 3 years ago

Pull Request #97 refactored by Sourcery.

Since the original Pull Request was opened as a fork in a contributor's repository, we are unable to create a Pull Request branching from it.

To incorporate these changes, you can either:

  1. Merge this Pull Request instead of the original, or

  2. Ask your contributor to locally incorporate these commits and push them to the original Pull Request

    Incorporate changes via command line
    git fetch https://github.com/cosimoNigro/agnpy pull/97/head
    git merge --ff-only FETCH_HEAD
    git push

NOTE: As code is pushed to the original Pull Request, Sourcery will re-run and update (force-push) this Pull Request with new refactorings as necessary. If Sourcery finds no refactorings at any point, this Pull Request will be closed automatically.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Help us improve this pull request!

sourcery-ai[bot] commented 3 years ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 0.78 ⭐ 0.82 ⭐ 0.04 πŸ‘Ž
Method Length 92.17 πŸ™‚ 96.31 πŸ™‚ 4.14 πŸ‘Ž
Working memory 10.52 😞 10.64 😞 0.12 πŸ‘Ž
Quality 64.26% πŸ™‚ 63.50% πŸ™‚ -0.76% πŸ‘Ž
Other metrics Before After Change
Lines 1081 1266 185
Changed files Quality Before Quality After Quality Change
agnpy/absorption/absorption.py 66.85% πŸ™‚ 65.97% πŸ™‚ -0.88% πŸ‘Ž
agnpy/tests/test_absorption.py 61.93% πŸ™‚ 61.50% πŸ™‚ -0.43% πŸ‘Ž

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

File Function Complexity Length Working Memory Quality Recommendation
agnpy/absorption/absorption.py Absorption.evaluate_tau_ss_disk 0 ⭐ 233 β›” 17 β›” 46.22% 😞 Try splitting into smaller methods. Extract out complex expressions
agnpy/tests/test_absorption.py TestAbsorptionMuS.test_tau_on_synchrotron_compare_with_delta_approximation 0 ⭐ 270 β›” 15 😞 46.47% 😞 Try splitting into smaller methods. Extract out complex expressions
agnpy/tests/test_absorption.py TestAbsorptionMuS.test_tau_dt_mu_s_far 0 ⭐ 285 β›” 13 😞 48.54% 😞 Try splitting into smaller methods. Extract out complex expressions
agnpy/absorption/absorption.py Absorption.evaluate_tau_blr_mu_s 1 ⭐ 202 😞 15 😞 49.38% 😞 Try splitting into smaller methods. Extract out complex expressions
agnpy/tests/test_absorption.py TestAbsorptionMuS.test_tau_dt_mu_s_simple 0 ⭐ 212 β›” 14 😞 50.93% πŸ™‚ 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[bot] commented 3 years ago

Codecov Report

Merging #98 (3b7f0ab) into master (216f6f0) will increase coverage by 0.19%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #98      +/-   ##
==========================================
+ Coverage   95.48%   95.68%   +0.19%     
==========================================
  Files          30       30              
  Lines        2127     2200      +73     
==========================================
+ Hits         2031     2105      +74     
+ Misses         96       95       -1     
Flag Coverage Ξ”
unittests 95.68% <100.00%> (+0.19%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Ξ”
agnpy/absorption/absorption.py 96.36% <100.00%> (+0.95%) :arrow_up:
agnpy/tests/test_absorption.py 100.00% <100.00%> (ΓΈ)

Continue to review full report at Codecov.

Legend - Click here to learn more Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data Powered by Codecov. Last update 216f6f0...3b7f0ab. Read the comment docs.