Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 15, 2025

Add numpyro test for gwpopulation_likelihood_model

  • Explore repository structure and understand existing code
  • Create test file for numpyro module (numpyro_test.py)
  • Write test comparing gwpopulation_likelihood_model with HyperparameterLikelihood
  • Ensure test uses same setup as test_likelihood_evaluation in example_test.py
  • Run test to verify it passes
  • Run code review and security checks
  • Fix linting issues (black formatting)

Summary

Successfully added test/numpyro_test.py with a test that verifies the gwpopulation_likelihood_model function produces identical likelihood values to the standard HyperparameterLikelihood.log_likelihood_ratio method.

The test:

  • Uses the same model setup as test_likelihood_evaluation in example_test.py
  • Tests both with and without selection effects using @pytest.mark.parametrize
  • Properly executes the numpyro model using numpyro.handlers.seed
  • Sets predictive_resample=False to ensure deterministic comparison
  • Verifies likelihoods match to within 1e-6 tolerance
  • Passes all pre-commit linting checks (black, isort, flynt)
Original prompt

On numpyro.py, Add a version of the example test using gwpopulation_likelihood_model verifying that the same likelihood is obtained.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: ColmTalbot <25602909+ColmTalbot@users.noreply.github.com>
Copilot AI changed the title [WIP] Add test for gwpopulation likelihood model Add test verifying gwpopulation_likelihood_model matches standard likelihood Dec 15, 2025
Copilot AI requested a review from ColmTalbot December 15, 2025 16:31
@ColmTalbot
Copy link
Owner

@copilot It looks like the new file doesn't follow the required linting methods and is failing the pre-commit tests.

@codecov
Copy link

codecov bot commented Dec 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.49%. Comparing base (fc60cf9) to head (ecc12d4).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #136      +/-   ##
==========================================
+ Coverage   90.74%   94.49%   +3.75%     
==========================================
  Files          14       14              
  Lines         907      907              
==========================================
+ Hits          823      857      +34     
+ Misses         84       50      -34     
Flag Coverage Δ
python3.10 94.49% <ø> (+3.75%) ⬆️
python3.11 94.49% <ø> (+3.75%) ⬆️
python3.12 94.49% <ø> (+3.75%) ⬆️
python3.13 94.49% <ø> (+3.75%) ⬆️

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

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

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

Co-authored-by: ColmTalbot <25602909+ColmTalbot@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 15, 2025

@copilot It looks like the new file doesn't follow the required linting methods and is failing the pre-commit tests.

Fixed in commit ecc12d4. The file now passes all pre-commit checks (black, isort, flynt). The only change needed was removing trailing whitespace.

@ColmTalbot ColmTalbot marked this pull request as ready for review December 15, 2025 16:44
@ColmTalbot ColmTalbot merged commit 4301b4e into main Dec 15, 2025
16 checks passed
@ColmTalbot ColmTalbot deleted the copilot/add-gwpopulation-likelihood-test branch December 15, 2025 16:50
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