cta-observatory / ctapipe

Low-level data processing pipeline software for CTAO or similar arrays of Imaging Atmospheric Cherenkov Telescopes
https://ctapipe.readthedocs.org
BSD 3-Clause "New" or "Revised" License
63 stars 266 forks source link

Use editable install to fix coverage #2460

Closed maxnoe closed 8 months ago

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (49ab82b) 60.60% compared to head (5ee0e9b) 87.96%. Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2460 +/- ## =========================================== + Coverage 60.60% 87.96% +27.35% =========================================== Files 3 231 +228 Lines 33 19768 +19735 =========================================== + Hits 20 17388 +17368 - Misses 13 2380 +2367 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

maxnoe commented 8 months ago

Using the editable install fixed coverage.py being able to associate the coverage report with the source files, so now we have correctly working coverage reports again.

Please review @Tobychev @LukasNickel

The muon fit fix is temporary, a proper fix is under investigation in #2425

Tobychev commented 8 months ago

I don't understand what the problem being solved is, nor why doing an editable install would matter. I don't even understand why the muon test needs to be patched in this PR, so I don't think I can provide a meaningful review.

maxnoe commented 8 months ago

I don't understand what the problem being solved is

Codecov reports coverage of 60% on 30 lines, because it doesn't recognize the file paths being tested because we run the tests in a temporary directory using the package installed into the prefix of the python installation.

See: https://app.codecov.io/gh/cta-observatory/ctapipe/

why doing an editable install would matter.

Doing an editable install means the installation is just creating symlinks to the checked out repository, which means that codecov can link the executed code to the source files correctly.

I don't even understand why the muon test needs to be patched in this PR

To be honest, me neither. The test started failing after I added the -e and I fixed it to see if the coverage was ok after I got the tests to run using the editable install, which it does now, see:

https://app.codecov.io/gh/cta-observatory/ctapipe/pull/2460/indirect-changes