Skip to content

Conversation

@arrjon
Copy link
Member

@arrjon arrjon commented Dec 23, 2025

This pull request improves the robustness of the distance method in pyabc/external/r/r_rpy2.py by adding stricter validation of the output from the R distance function. Now, the code checks that the result is a single numeric value and raises an informative error if it is not.

@codecov-commenter
Copy link

codecov-commenter commented Dec 23, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.62%. Comparing base (fafff1d) to head (00b1c7b).

Files with missing lines Patch % Lines
pyabc/external/r/r_rpy2.py 0.00% 4 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #654      +/-   ##
==========================================
- Coverage   80.64%   80.62%   -0.02%     
==========================================
  Files         141      141              
  Lines        8530     8533       +3     
==========================================
+ Hits         6879     6880       +1     
- Misses       1651     1653       +2     

☔ 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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request enhances the robustness of the R distance function wrapper by adding validation to ensure the R function returns a single numeric value. The validation checks the shape and size of the returned array and raises an informative error message if it doesn't meet the requirements.

Key Changes

  • Added validation logic to check that R distance functions return a single numeric value
  • Replaced direct float conversion with array validation using np.asarray().squeeze() and size checking
  • Improved error messaging to include the function name, expected return type, and actual shape/size received

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@arrjon arrjon merged commit 95159ef into main Dec 24, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants