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

Simplify test for scaling true energy in IRFs and try to make it deterministic #1300

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

morcuended
Copy link
Member

@morcuended morcuended commented Oct 2, 2024

This test was failing from now and then giving IndexErrors. Here I try to simplify the search for maxima of the EDISP PDF and avoid loops inside the test using pytest parametrization decorator that runs the test for every combination of scaling factor and true energy value.

See action job: https://github.com/cta-observatory/cta-lstchain/actions/runs/11127968103/job/30921574910?pr=1289

         # Check that the maximum of the density probability of the migration has shifted
        order_max = []
        order_max_mod = []
        for idx, _ in enumerate(e_true_list):
            for j in range(len(e_migra)):
                if e_migra_prob[idx][j] > e_migra_prob[idx][j - 1]:
                    order_max.append(j)
                if e_migra_prob_mod[idx][j] > e_migra_prob_mod[idx][j - 1]:
                    order_max_mod.append(j)
    
        for i in range(len(order_max)):
>           assert order_max[i] != order_max_mod[i]
E           IndexError: list index out of range

Copy link

codecov bot commented Oct 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.47%. Comparing base (cc1441f) to head (7221fd5).
Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1300      +/-   ##
==========================================
- Coverage   73.50%   73.47%   -0.04%     
==========================================
  Files         134      134              
  Lines       14210    14193      -17     
==========================================
- Hits        10445    10428      -17     
  Misses       3765     3765              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This was referenced Oct 3, 2024
@moralejo moralejo merged commit f8e41f0 into main Oct 9, 2024
9 checks passed
@moralejo moralejo deleted the test-irf-scale branch October 9, 2024 07:33
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.

2 participants