-
Notifications
You must be signed in to change notification settings - Fork 0
Add configuration options for handling unsupported reference prefixes #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This commit adds two new configuration options to ReferenceValidationConfig: 1. skip_prefixes: List of prefixes to skip during validation - References with these prefixes return is_valid=True with INFO severity - Useful for unsupported reference types (SRA, MGNIFY, BIOPROJECT) - Case-insensitive matching 2. unknown_prefix_severity: Control severity for unfetchable references - Options: ERROR (default), WARNING, INFO - Applied when references cannot be fetched - skip_prefixes takes precedence over this setting Changes: - Added skip_prefixes field to ReferenceValidationConfig (models.py) - Added unknown_prefix_severity field to ReferenceValidationConfig (models.py) - Implemented prefix checking logic in validate() method (supporting_text_validator.py) - Added comprehensive test coverage (test_supporting_text_validator.py) - Updated documentation with configuration examples (README.md) - Added doctests for new configuration options Resolves #28 Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
|
@dragon-ai-agent please add something to docs/. Everything must be completely clear to someone setting up a system, with illustrative examples |
This commit adds three major documentation enhancements to make the system completely clear to new users setting up linkml-reference-validator: 1. **Setup Guide (docs/setup-guide.md)** - Complete installation instructions for pip, uv, and development setup - Initial configuration including NCBI API key setup - Quick start examples with real PMIDs - Real-world example: validating gene functions - Advanced configuration with YAML config files - Integration with pre-commit hooks, CI/CD, and Makefiles - Verification checklist and troubleshooting quick fixes 2. **Complete Workflow Tutorial (docs/tutorials/complete-workflow.md)** - Step-by-step 30-45 minute tutorial building a gene annotation system - Covers installation, schema design, data creation, validation, and repair - Includes real-world examples with TP53, BRCA1, EGFR, and JAK1 - Shows integration with Git, GitHub Actions, and testing frameworks - Provides templates and boilerplate code for quick starts - Production-ready examples with Makefiles and test suites 3. **Troubleshooting Guide (docs/troubleshooting.md)** - Comprehensive solutions for installation issues - Reference fetching problems (PMIDs, network, rate limiting) - Validation errors with detailed explanations and fixes - Schema and data format issues - Performance optimization tips - Common error messages with causes and solutions - Quick diagnostic checklist Also updated mkdocs.yml navigation to include the new guides in logical positions for discoverability. These guides provide clear, illustrative examples for someone setting up the system from scratch, addressing issue #29. Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Documentation Added 📚I've created comprehensive documentation to make the setup process completely clear, with illustrative examples throughout. See PR #30. What's Been Added1. Setup Guide (
|
Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
Claude finished @github-actions[bot]'s task —— View job PR Review Complete ✅Reviewed PR #29: Add configuration options for handling unsupported reference prefixes Review Checklist
Overall Assessment: Excellent ⭐⭐⭐⭐⭐This is a well-implemented feature that follows excellent software engineering practices. The implementation is backward compatible, thoroughly tested, and properly documented. ✅ Code Quality & Best PracticesStrengths:
Code Quality Examples:
✅ Test Coverage: ComprehensiveTest Quality Analysis:
Notable Test Cases:# tests/test_supporting_text_validator.py:469-489
def test_skip_prefixes_takes_precedence_over_unknown_severity()
# Ensures skip_prefixes overrides unknown_prefix_severity - critical behaviorTest coverage is exceptional - covers all combinations and edge cases. ✅ Implementation AnalysisModels (
|
| Aspect | Rating | Notes |
|---|---|---|
| Code Quality | ⭐⭐⭐⭐⭐ | Excellent structure, typing, documentation |
| Test Coverage | ⭐⭐⭐⭐⭐ | Comprehensive, edge cases covered |
| Performance | ⭐⭐⭐⭐⭐ | Optimized, no performance regressions |
| Security | ⭐⭐⭐⭐⭐ | No security concerns identified |
| Documentation | ⭐⭐⭐⭐⭐ | Clear examples, comprehensive README |
| Backward Compatibility | ⭐⭐⭐⭐⭐ | Fully backward compatible |
✅ Recommendation: APPROVE
This PR is ready to merge. It's a textbook example of how to implement a new feature:
- Well-designed API with clear configuration options
- Thoroughly tested with comprehensive coverage
- Properly documented with practical examples
- Backward compatible with sensible defaults
- Follows project conventions perfectly
The implementation addresses a real user need (handling unsupported reference types) with a clean, configurable solution that doesn't compromise existing functionality.
Great work! 🎉
Summary
Implements #28 by adding two new configuration options to control behavior for unsupported or unfetchable reference types:
skip_prefixes: List of reference prefixes to skip during validationunknown_prefix_severity: Control severity level for unfetchable referencesChanges
Core Implementation
models.py: Addedskip_prefixesandunknown_prefix_severityfields toReferenceValidationConfigsupporting_text_validator.py: Implemented prefix checking logic invalidate()methodskip_prefixesbefore attempting to fetch referenceis_valid=TruewithINFOseverity for skipped prefixesTesting
Added comprehensive test coverage in
test_supporting_text_validator.py:Test Results: All 406 tests passing (including 11 new tests)
Documentation
Configuration Examples
Example 1: Skip unsupported prefixes
Result:
Example 2: Downgrade severity for unknown prefixes
Result:
$ linkml-reference-validator validate text "some text" UNKNOWN:12345 ✗ Valid: False (WARNING) - Could not fetch reference: UNKNOWN:12345Example 3: Combined configuration
Use Cases
This feature is particularly useful for the dismech knowledge base and other projects that:
Implementation Notes
skip_prefixestakes precedence overunknown_prefix_severityRelated
Closes #28
🤖 Generated with Claude Code