Skip to content

[DOC] Add description for Pybind in main README.md#262

Merged
haochengxia merged 5 commits intodevelopfrom
hxia/pybind
Jul 14, 2025
Merged

[DOC] Add description for Pybind in main README.md#262
haochengxia merged 5 commits intodevelopfrom
hxia/pybind

Conversation

@haochengxia
Copy link
Copy Markdown
Collaborator

@haochengxia haochengxia commented Jul 14, 2025

  • Revise the README.md for pybind and add a section in main README.md
  • Add workflow for PyPI release
  • Bump to v0.3.2

@haochengxia haochengxia requested a review from Copilot July 14, 2025 05:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.sh for development installs and optional wheel building; remove deprecated install scripts.
  • Update C++ binding (pylibcachesim.cpp) to infer trace types, add seek, and simplify open_trace/process_trace signatures.
  • 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 seek docstring lists offset but omits the from_beginning parameter—add a description for from_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_req uses -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++ compilation has 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_trace signature has dropped max_sec, start_time, and end_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_type function covers multiple extensions and fallbacks but lacks unit tests—add tests to verify each suffix and UNKNOWN_TRACE behavior.
trace_type_e infer_trace_type(const std::string& trace_path) {

Comment thread README.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@haochengxia haochengxia requested a review from 1a1a11a July 14, 2025 08:30
@haochengxia haochengxia merged commit 289796e into develop Jul 14, 2025
11 checks passed
@haochengxia haochengxia deleted the hxia/pybind branch July 14, 2025 08:35
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.

2 participants