Conversation
|
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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>
This pull request improves the robustness of the
distancemethod inpyabc/external/r/r_rpy2.pyby 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.