Skip to content

Make test_point_source_spectral_fit a circular test#480

Merged
eneights merged 7 commits intocositools:developfrom
israelmcmc:develop_make_spectral_fit_test_circular
Feb 13, 2026
Merged

Make test_point_source_spectral_fit a circular test#480
eneights merged 7 commits intocositools:developfrom
israelmcmc:develop_make_spectral_fit_test_circular

Conversation

@israelmcmc
Copy link
Collaborator

Create fake test data and background using the same response as the fit. This is circular because if test the fitting routine itself, not the simulations or anything else.

Fixes #357 (because the response, despite being coarse, is the true response as far as the algorithm cares) and #477 (because the energy bins edges are by definition the same).

This was the last unit test that was still failing in the interfaces refactoring, but I believe it's due to unrelated reasons (those in the issues.

…it (for a circular test). Fixes cositools#357 and cositools#477

Signed-off-by: Israel Martinez <imc@umd.edu>
# Conflicts:
#	tests/threeml/test_spectral_fitting.py
Signed-off-by: Israel Martinez <imc@umd.edu>
Signed-off-by: Israel Martinez <imc@umd.edu>
@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.87%. Comparing base (5e3a419) to head (d8c161b).
⚠️ Report is 8 commits behind head on develop.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@israelmcmc israelmcmc marked this pull request as ready for review February 13, 2026 16:13
@israelmcmc
Copy link
Collaborator Author

Btw, I also changed Band to PowerLaw. Even with a better response, people have reported that it is really difficult to fit the Crab to a Band function due to the narrow COSI energy resolution (the lower energy index is not well constrained). We should do the same with the tutorials.

Signed-off-by: Israel Martinez <imc@umd.edu>
Signed-off-by: Israel Martinez <imc@umd.edu>
Signed-off-by: Israel Martinez <imc@umd.edu>
@eneights eneights self-assigned this Feb 13, 2026
Copy link
Contributor

@eneights eneights left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, thanks @israelmcmc!

@eneights eneights merged commit ee6a8bf into cositools:develop Feb 13, 2026
4 checks passed
@israelmcmc
Copy link
Collaborator Author

Thanks @eneights

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

spectral fitting test in test suite is unstable with low-resolution response

2 participants