Add ekore_py - #554
Conversation
|
Doubt, what should we name this python library? |
There was a problem hiding this comment.
Pull request overview
Adds a new ekore_py crate intended to provide Python bindings for ekore via PyO3, and wires it into the workspace/release metadata while updating crate READMEs to reference the new component.
Changes:
- Introduces a new
crates/ekore_pypackage with an initial PyO3 module scaffold plus Python packaging metadata (pyproject.toml). - Adds
pyo3to workspace dependencies and updatesCargo.lockaccordingly. - Updates framework documentation and release crate list to include
ekore_py.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/release.json | Adds ekore_py to the crate release list. |
| crates/ekore/README.md | Mentions the new ekore_py crate in the framework list. |
| crates/ekore_py/src/lib.rs | Adds initial PyO3 module scaffold (currently a template function). |
| crates/ekore_py/README.md | Introduces README for the Python binding crate. |
| crates/ekore_py/pyproject.toml | Adds maturin-based Python build metadata for ekore_py. |
| crates/ekore_py/Cargo.toml | Adds new Rust crate manifest for the PyO3 cdylib. |
| crates/ekore_capi/README.md | Mentions ekore_py in the framework list. |
| crates/eko/README.md | Mentions ekore_py in the framework list. |
| crates/dekoder/README.md | Mentions ekore_py in the framework list. |
| Cargo.toml | Adds pyo3 to workspace dependencies. |
| Cargo.lock | Updates lockfile format/version and adds PyO3 dependency graph entries. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
I guess there are two options: |
|
The crate name will be |
I see, mmm ... I've no strong opinion ... |
|
So in my opinion we should not add the |
| - name: Setup Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ vars.PYTHON_VERSION_WORKFLOWS }} | ||
| - name: Setup Rust toolchain | ||
| uses: dtolnay/rust-toolchain@stable | ||
| - name: Create virtual environment | ||
| run: python -m venv .venv | ||
| - name: Add venv to PATH | ||
| run: echo "$PWD/.venv/bin" >> "$GITHUB_PATH" | ||
| - name: Install task runner and test deps | ||
| run: pip install maturin numpy poethepoet pytest |
There was a problem hiding this comment.
- do we need
venv? can't we rely on the global environment? - should we pin the versions here?
- if the answer to the last is yes: we should cache the environment Caching data in workflows is not working #452
| let gamma = $path($order_qcd, $mode, &mut cache.inner, $nf); | ||
| gamma_ns_qcd_body!(@collect $py, $order_qcd, gamma) | ||
| }}; | ||
| (@check $order_qcd:expr, $mode:expr, $bound:expr) => { |
There was a problem hiding this comment.
| (@check $order_qcd:expr, $mode:expr, $bound:expr) => { | |
| // sanity checks | |
| (@check $order_qcd:expr, $mode:expr, $bound:expr) => { |
maybe add a few more comments, these macro expansions look a bit scary 🙃
| ))); | ||
| } | ||
| }; | ||
| (@collect $py:expr, $order_qcd:expr, $gamma:expr) => {{ |
There was a problem hiding this comment.
| (@collect $py:expr, $order_qcd:expr, $gamma:expr) => {{ | |
| // transform for return | |
| (@collect $py:expr, $order_qcd:expr, $gamma:expr) => {{ |
| @@ -0,0 +1,216 @@ | |||
| //! Shared bodies for the `#[pyfunction]`s defined throughout this crate. | |||
|
|
|||
| /// Body for a non-singlet tower function returning shape `(order_qcd,)`. | |||
There was a problem hiding this comment.
| /// Body for a non-singlet tower function returning shape `(order_qcd,)`. | |
| /// Body for a non-singlet tower function. | |
| /// Returning shape: `(order_qcd,)`. |
maybe?
|
|
||
| /// Body for a non-singlet tower function returning shape `(order_qcd,)`. | ||
| macro_rules! gamma_ns_qcd_body { | ||
| // With an `n3lo_variation` argument. |
There was a problem hiding this comment.
| // With an `n3lo_variation` argument. | |
| // Compute with an `n3lo_variation` argument. |
A step for #519
In this PR we:
ekore_pycrate, which exposesekorecrate usingPyO3and build the lib usingmaturin.TODO