Skip to content

Refactor lookup benchmark implementations using AbstractLookup base class#4

Merged
samuelstanton merged 4 commits intomainfrom
patch-lookups
Mar 30, 2025
Merged

Refactor lookup benchmark implementations using AbstractLookup base class#4
samuelstanton merged 4 commits intomainfrom
patch-lookups

Conversation

@samuelstanton
Copy link
Copy Markdown
Collaborator

This PR improves the organization and maintainability of the lookup-based benchmark functions by introducing an
AbstractLookup base class that provides shared functionality. This reduces code duplication across the
TFBIND8, TrpB, and DHFR implementations while standardizing naming conventions and interfaces.

Key changes:

  • Add AbstractLookup base class with common functionality
  • Refactor specific implementations to inherit from AbstractLookup
  • Standardize attribute naming across all implementations
  • Update tests to use consistent attribute names
  • All tests and benchmarks continue to pass

Benefits include reduced code redundancy, improved code reuse, and easier maintenance when adding new
lookup-based benchmarks in the future.

- Update URLs to raw.githubusercontent.com
- Add alphabet_size attribute for test compatibility
- Fix type issues with optimal_value to ensure it's a float
- Ensure all lookups can properly download data via pooch

All tests now pass and benchmarks can be successfully run.
…lass

- Create AbstractLookup base class to improve code reuse and maintainability
- Update TFBIND8, TrpB, and DHFR implementations to use AbstractLookup
- Standardize naming conventions across all implementations (alphabet, _lookup_dict)
- Update tests to use consistent attribute names
- All tests and benchmarks now pass with cleaner, more maintainable code
- Create mock implementations of TFBIND8, TrpB, and DHFR for CI testing
- Use synthetic data in CI environments to avoid network issues
- Maintain real data loading for local development
- All tests continue to pass locally
@samuelstanton samuelstanton merged commit ffe6d13 into main Mar 30, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant