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 numerical check between agnpy and Finke 2016 for absorption on BLR and DT #89

Merged
merged 6 commits into from
Apr 23, 2021

Conversation

cosimoNigro
Copy link
Owner

@cosimoNigro cosimoNigro commented Apr 23, 2021

So far we were just producing plots for the crosschecks against the Finke 2016 reference for the case of the gamma-gamma absorption on the BLR and DT.

I added the check_deviation function at the end of the functions checking these absorptions numerically against the reference.
These are the automatic plots produced now by the TestAbsorption class

  • for the BLR
    tau_blr_Ly_alpha_comprison_r_1e-1_R_Ly_alpha_figure_14_finke_2016
    tau_blr_Ly_alpha_comprison_r_1e0 5_R_Ly_alpha_figure_14_finke_2016
    tau_blr_Ly_alpha_comprison_r_1e1_R_Ly_alpha_figure_14_finke_2016
    tau_blr_point_source_comparison

  • and for the DT
    tau_dt_comprison_r_1e-1_R_Ly_alpha_figure_14_finke_2016
    tau_dt_comprison_r_1e0_R_Ly_alpha_figure_14_finke_2016
    tau_dt_comprison_r_1e1_R_Ly_alpha_figure_14_finke_2016
    tau_dt_comprison_r_1e2_R_Ly_alpha_figure_14_finke_2016
    tau_dt_point_source_comparison

Keeping in mind that, thanks to @jsitarek work, we are also checking against the point-source approximation (for the misaligned case) I think we can close both issues #65 and #66.
I think for the BLR and DT the absorption is under control.

@codecov
Copy link

codecov bot commented Apr 23, 2021

Codecov Report

Merging #89 (561cbb5) into master (2a94ebd) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #89      +/-   ##
==========================================
+ Coverage   94.35%   94.36%   +0.01%     
==========================================
  Files          30       30              
  Lines        2054     2059       +5     
==========================================
+ Hits         1938     1943       +5     
  Misses        116      116              
Flag Coverage Δ
unittests 94.36% <100.00%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
agnpy/utils/geometry.py 100.00% <ø> (ø)
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 2a94ebd...561cbb5. Read the comment docs.

@sourcery-ai
Copy link

sourcery-ai bot commented Apr 23, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 0.03 ⭐ 0.03 ⭐ 0.00
Method Length 99.70 🙂 105.15 🙂 5.45 👎
Working memory 13.41 😞 14.23 😞 0.82 👎
Quality 59.47% 🙂 57.90% 🙂 -1.57% 👎
Other metrics Before After Change
Lines 528 545 17
Changed files Quality Before Quality After Quality Change
agnpy/tests/test_absorption.py 55.92% 🙂 54.06% 🙂 -1.86% 👎
agnpy/utils/geometry.py 73.29% 🙂 73.29% 🙂 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
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/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/tests/test_absorption.py TestAbsorption.test_absorption_blr_reference_tau 0 ⭐ 172 😞 20 ⛔ 48.47% 😞 Try splitting into smaller methods. Extract out complex expressions
agnpy/tests/test_absorption.py TestAbsorptionMuS.test_tau_dt_mu_s_simple 0 ⭐ 212 ⛔ 15 😞 49.67% 😞 Try splitting into smaller methods. Extract out complex expressions
agnpy/tests/test_absorption.py TestAbsorptionMuS.test_abs_blr_mu_s_vs_on_axis 0 ⭐ 167 😞 13 😞 56.01% 🙂 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.

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.

1 participant