Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added a special treatment for absorption on BLR if one of the grid points ends up very close to the shell #91

Merged
merged 1 commit into from
May 6, 2021

Conversation

jsitarek
Copy link
Collaborator

also a test to check that it is working

this should solve problem reported in issue #90

…ints ends up very close to the shell

also a test to check that it is working
@sourcery-ai
Copy link

sourcery-ai bot commented Apr 28, 2021

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.41%.

Quality metrics Before After Change
Complexity 0.93 ⭐ 0.90 ⭐ -0.03 👍
Method Length 91.56 🙂 92.30 🙂 0.74 👎
Working memory 13.64 😞 13.38 😞 -0.26 👍
Quality 59.51% 🙂 59.92% 🙂 0.41% 👍
Other metrics Before After Change
Lines 1117 1195 78
Changed files Quality Before Quality After Quality Change
agnpy/absorption/absorption.py 65.01% 🙂 63.83% 🙂 -1.18% 👎
agnpy/tests/test_absorption.py 54.06% 🙂 56.41% 🙂 2.35% 👍
agnpy/utils/math.py 59.56% 🙂 59.89% 🙂 0.33% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
agnpy/utils/math.py trapz_loglog 3 ⭐ 238 ⛔ 19 ⛔ 41.31% 😞 Try splitting into smaller methods. Extract out complex expressions
agnpy/tests/test_absorption.py TestAbsorptionMuS.test_tau_dt_mu_s_far 0 ⭐ 285 ⛔ 18 ⛔ 42.88% 😞 Try splitting into smaller methods. Extract out complex expressions
agnpy/absorption/absorption.py Absorption.evaluate_tau_ss_disk 0 ⭐ 233 ⛔ 18 ⛔ 45.35% 😞 Try splitting into smaller methods. Extract out complex expressions
agnpy/tests/test_absorption.py TestAbsorption.test_absorption_dt_reference_tau 0 ⭐ 180 😞 21 ⛔ 47.17% 😞 Try splitting into smaller methods. Extract out complex expressions
agnpy/absorption/absorption.py Absorption.evaluate_tau_blr_mu_s 1 ⭐ 202 😞 17 ⛔ 47.27% 😞 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

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!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

@jsitarek jsitarek linked an issue Apr 28, 2021 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Apr 28, 2021

Codecov Report

Merging #91 (435d853) into master (fd7826f) will increase coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #91      +/-   ##
==========================================
+ Coverage   94.36%   94.46%   +0.09%     
==========================================
  Files          30       30              
  Lines        2059     2094      +35     
==========================================
+ Hits         1943     1978      +35     
  Misses        116      116              
Flag Coverage Δ
unittests 94.46% <100.00%> (+0.09%) ⬆️

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

Impacted Files Coverage Δ
agnpy/absorption/absorption.py 95.40% <100.00%> (+0.17%) ⬆️
agnpy/tests/test_absorption.py 100.00% <100.00%> (ø)
agnpy/utils/math.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 fd7826f...435d853. Read the comment docs.

@cosimoNigro
Copy link
Owner

Everything looks good.

@cosimoNigro cosimoNigro merged commit 8c89b47 into cosimoNigro:master May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calculation of BLR absorption fails for r = R_line
2 participants