-
Notifications
You must be signed in to change notification settings - Fork 33
feat: Add support for third-party API models #164
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
Open
marcbal77
wants to merge
11
commits into
bio-learn:master
Choose a base branch
from
marcbal77:feature/third-party-api-models
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: Add support for third-party API models #164
marcbal77
wants to merge
11
commits into
bio-learn:master
from
marcbal77:feature/third-party-api-models
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2a46602 to
4be828e
Compare
This commit introduces a minimal framework for integrating third-party API models into biolearn, with Hurdle Bio's Inflammage model as the first implementation. Key changes: - Add HurdleAPIModel class to model.py for API-based predictions - Integrate HurdleAPIModel into ModelGallery for consistent usage - Implement privacy-first approach with explicit user consent - Add automatic imputation for missing CpG sites - Include comprehensive error handling with user-friendly messages Security & Privacy: - API keys managed via environment variables or direct input - Explicit consent required before sending data to external servers - Updated .gitignore to exclude credential files Documentation: - Add user guide in docs/hurdle_api_guide.md - Include working example in examples/hurdle_api_example.py - Placeholder for Hurdle CpG sites list Testing: - Add test suite for HurdleAPIModel functionality - Mock API calls to avoid requiring credentials in tests This implementation minimizes changes to the existing codebase while providing a robust foundation for future API model integrations.
- Add actual CpG sites to Hurdle_CpGs.csv.example file (first 100 sites) - Fix test_consent_denied decorator issue (missing mock_input parameter) - Skip HurdleAPIModel in main test_model.py suite (requires API credentials) - Update test data to include proper CpG site indices for Hurdle tests - Fix file path to use Hurdle_CpGs.csv.example instead of .csv
- Format biolearn/test/test_hurdle_model.py - Format biolearn/test/test_model.py
- Add real CpG sites to example file, improve error handling and validation - Simplify consent mechanism, reduce test redundancy, add type hints - Move documentation to doc/ folder, clean up examples
- Update HurdleAPIModel implementation to match latest codebase - Fix test imports and references after rebase - Maintain compatibility with existing model architecture
- Add self._consent_given flag to track consent state - Only ask for consent if not already given - Remove duplicate base_url initialization - Fixes failing test test_consent_only_asked_once
- Format base_url assignment as multi-line for consistency - Fixes CI formatting check failure
…ntation - Rename HurdleInflammage to HurdleInflammAge - Switch to production API (use_production=True) - Update registration URL to https://dashboard.hurdle.bio/register - Add non-commercial use disclaimer to documentation and docstring - Rename Hurdle_CpGs.csv.example to Hurdle_CpGs.csv - Document 0.5 imputation for missing CpG sites - Update example script with better error handling - Update all references in tests and documentation
0c2c5ef to
ad8b326
Compare
- Model now errors if any required CpG sites are missing - Provides informative error with count and examples of missing sites - Directs users to use ModelGallery imputation methods - Updated documentation to explain missing data handling - Added test for missing CpG error - All tests passing (143 passed, 4 skipped)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces a minimal framework for integrating third-party API models into biolearn, with Hurdle Bio's Inflammage model as the first implementation.
Key Changes
Security & Privacy Features
Documentation
Testing
Usage Example