[DOC] Add description for Pybind in main README.md#262
Merged
haochengxia merged 5 commits intodevelopfrom Jul 14, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR overhauls Python integration by adding developer install scripts, updating the pybind11 binding API, and enhancing documentation for the Python package.
- Introduce
install_python_dev.shfor development installs and optional wheel building; remove deprecated install scripts. - Update C++ binding (
pylibcachesim.cpp) to infer trace types, addseek, and simplifyopen_trace/process_tracesignatures. - Revise Python wrapper (
eviction.py), examples, and CI (pyproject.toml) for new parameters; expand README.md documentation in both the binding and main repo.
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| scripts/install_python_dev.sh | New install script with --build-wheels support |
| scripts/install_python.sh | Removed old install script |
| scripts/build_pypi.sh | Removed standalone wheel build script |
| libCacheSim-python/tests/conftest.py | Updated test fixture to use TraceType enum instead of .value |
| libCacheSim-python/src/pylibcachesim.cpp | Added infer_trace_type, seek, and revised API signatures |
| libCacheSim-python/libcachesim/eviction.py | Simplified process_trace signature and updated docstrings |
| libCacheSim-python/examples/demo_unified_interface.py | Updated example calls to new enum-based and parameter names |
| libCacheSim-python/pyproject.toml | Extended cibuildwheel config for multi-arch and improved hooks |
| libCacheSim-python/README.md | Enhanced installation and usage instructions |
| README.md | Added “Python package” section and usage examples |
Comments suppressed due to low confidence (5)
libCacheSim-python/src/pylibcachesim.cpp:297
- The
seekdocstring listsoffsetbut omits thefrom_beginningparameter—add a description forfrom_beginning(e.g., whether seeking from current position or absolute start) and its default value.
offset (int): The offset to seek to the beginning.
libCacheSim-python/libcachesim/eviction.py:43
- The docstring indicates
start_requses -1 for no limit, but the signature defaults to 0—either update the doc to reflect default=0 meaning 'from beginning' or change the default to -1 to match the description.
start_req: Start request index (-1 for no limit)
README.md:341
- [nitpick] The markdown emphasis around
without any C/C++ compilationhas mismatched asterisks—use either*...*or**...**consistently.
With python package, you can extend new algorithm to test your own eviction design *without any C/C++ compilation**.
libCacheSim-python/libcachesim/eviction.py:35
- The
process_tracesignature has droppedmax_sec,start_time, andend_time, which is a breaking API change—consider adding a changelog entry or a deprecation path for older parameters.
def process_trace(self, reader, start_req=0, max_req=-1) -> float:
libCacheSim-python/src/pylibcachesim.cpp:52
- The new
infer_trace_typefunction covers multiple extensions and fallbacks but lacks unit tests—add tests to verify each suffix andUNKNOWN_TRACEbehavior.
trace_type_e infer_trace_type(const std::string& trace_path) {
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Uh oh!
There was an error while loading. Please reload this page.