Repository navigation
Add __all__ exports to metrics modules - #108
Conversation
|
Warning Review limit reached
Your plan currently allows 1 review/hour. Refill in 46 minutes and 4 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR adds explicit ChangesMetrics Module API Definitions
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
AI Code Review by LlamaPReview
🎯 TL;DR & Recommendation
Recommendation: Approve with suggestions
This PR adds explicit __all__ exports to four metrics modules and a corresponding test file. The only concern is a linting CI failure that should be resolved before merging.
🌟 Strengths
- Solid test coverage verifying public API exports.
💡 Suggestions (P2)
- trustlens/metrics/calibration.py: The linting CI check failed; run the linter locally with
pre-commit run --all-filesand resolve reported violations to keep CI green.
💡 Have feedback? We'd love to hear it in our GitHub Discussions.
✨ This review was generated by LlamaPReview Advanced, which is free for all open-source projects. Learn more.
Khanz9664
left a comment
There was a problem hiding this comment.
@JavadTe Thanks for picking this up — I reviewed the implementation and this looks great overall.
You kept the PR nicely scoped to the issue, added explicit __all__ definitions across the requested metrics modules, and followed the guidance around excluding private/internal helpers from the public API surface. I also appreciate you adding tests/test_metrics_all_exports.py to verify the exports — that wasn’t strictly required, but it’s a really nice addition for preventing regressions in the future.
I also checked that the PR stays focused on the requested modules (calibration.py, failure.py, bias.py, and representation.py) without unrelated cleanup/refactors, which I appreciate.
Since all checks are green and the implementation aligns with the issue scope, this looks good to me. Nice work on this one.
Thanks again for the contribution!
Pull Request Template
Summary
This pull request adds explicit
__all__definitions to the metrics modules listed in issue #34.Related Issue
Closes #34
Type of Change
Please check the type of change:
Changes Made
__all__totrustlens/metrics/calibration.py.__all__totrustlens/metrics/failure.py.__all__totrustlens/metrics/bias.py.__all__totrustlens/metrics/representation.py.Testing
py -m pytest tests/test_metrics_all_exports.pypy -m pytest --ignore=tests/backends/test_xgboost_logic.pyPre-submit Checklist
Before submitting, please ensure you have:
pre-commit run --all-filesand all hooks passed.make test).CHANGELOG.mdif applicable.Notes for Reviewers
I followed the issue guidance by including only public user-facing metric functions and excluding private helpers such as
_violation_level,_center_kernel, and_hsic.Summary by CodeRabbit
Tests
Chores