Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the Python interface to expose proper Python classes instead of C++ binding functions, replacing individual *_init functions with object-oriented cache policy classes that inherit from a common base class.
- Replaces C++ binding functions (e.g.,
FIFO_init,LRU_init) with proper Python classes (FIFO,LRU, etc.) - Introduces
EvictionPolicyBaseas a common base class for all cache policies - Adds new utility functions
process_traceandprocess_trace_python_hookfor trace processing
Comments suppressed due to low confidence (3)
libCacheSim-python/libcachesim/init.pyi:53
- Parameter type references
PythonHookCachebut the class is defined asPythonHookCachePolicy. This should bePythonHookCachePolicyto match the class definition.
cache: PythonHookCache,
libCacheSim-python/libcachesim/init.pyi:149
- [nitpick] Parameter name
ain_size_ratiois inconsistent with the originalAin_size_ratio(capitalized). Consider usingAin_size_ratioto maintain consistency with the original API.
def __init__(self, cache_size: int, ain_size_ratio: float = 0.25, aout_size_ratio: float = 0.5) -> None: ...
libCacheSim-python/libcachesim/init.pyi:149
- [nitpick] Parameter name
aout_size_ratiois inconsistent with the originalAout_size_ratio(capitalized). Consider usingAout_size_ratioto maintain consistency with the original API.
def __init__(self, cache_size: int, ain_size_ratio: float = 0.25, aout_size_ratio: float = 0.5) -> None: ...
1a1a11a
approved these changes
Jul 16, 2025
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
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.
Expose Python methods rather than unwrapped C++ bindings.