cosimoNigro / agnpy

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

EC on CMB comparison, make uniform the SED format #102

Closed cosimoNigro closed 3 years ago

cosimoNigro commented 3 years ago

In this PR I have:

  1. added a script to generate a SED for EC on CMB with jetset, to be compared against the same calculation by agnpy;
  2. added this comparison to the automatic tests;
  3. worked to standardise our MWL SED data format, they comply now with the GADF specification and can be directly read via Gammapy's FluxPoints.
codecov[bot] commented 3 years ago

Codecov Report

Merging #102 (6e474b7) into master (ad70854) will increase coverage by 0.64%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #102      +/-   ##
==========================================
+ Coverage   95.68%   96.33%   +0.64%     
==========================================
  Files          30       30              
  Lines        2200     2208       +8     
==========================================
+ Hits         2105     2127      +22     
+ Misses         95       81      -14     
Flag Coverage Δ
unittests 96.33% <100.00%> (+0.64%) :arrow_up:

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

Impacted Files Coverage Δ
agnpy/tests/test_synchrotron.py 100.00% <ø> (ø)
agnpy/tests/test_compton.py 100.00% <100.00%> (ø)
agnpy/compton/external_compton.py 98.43% <0.00%> (+10.93%) :arrow_up:

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 ad70854...6e474b7. Read the comment docs.

sourcery-ai[bot] commented 3 years ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 0.10 ⭐ 0.10 ⭐ 0.00
Method Length 110.20 🙂 108.33 🙂 -1.87 👍
Working memory 9.36 🙂 9.28 🙂 -0.08 👍
Quality 65.77% 🙂 66.26% 🙂 0.49% 👍
Other metrics Before After Change
Lines 658 691 33
Changed files Quality Before Quality After Quality Change
agnpy/data/reference_seds/jetset/jetset_ssa_seds.py 52.24% 🙂 52.24% 🙂 0.00%
agnpy/data/reference_seds/jetset/jetset_ssc_seds.py 57.98% 🙂 57.98% 🙂 0.00%
agnpy/tests/test_compton.py 71.01% 🙂 71.67% 🙂 0.66% 👍
agnpy/tests/test_synchrotron.py 69.40% 🙂 69.40% 🙂 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_synchrotron.py TestSynchrotron.test_ssa_reference_sed 0 ⭐ 172 😞 14 😞 54.13% 🙂 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!

cosimoNigro commented 3 years ago

I have also updated the tutorial notebooks to work with the new data and with some of the adjustments we made for the paper. I will add also the gammapy's notebook once we finalise the paper content.

cosimoNigro commented 3 years ago

Merging without review since the core library is not affected, only the test and docs.