Context
PR #2 exposes src/core as an rlib so it can be used from pure Rust (outside of Python), via crate-type = ["cdylib", "rlib"] plus an optional extension-module feature gating pyo3/numpy.
This works, but has two limitations:
core and pyapi still live in the same Cargo crate, with the API boundary maintained by convention (a feature flag) rather than by the package system itself.
- Adding the
rlib target triggers the crate's doctests, several of which don't actually compile (missing imports, malformed markdown fence, an ASCII diagram parsed as Rust code, two examples out of sync with their real signature) — previously hidden behind doctest = false.
Proposal
Split into a real two-member Cargo workspace:
gridr-core: the resampling/filtering engine, no pyo3/numpy dependency, default crate-type (rlib). This is the crate an external Rust project depends on directly.
gridr-py: the PyO3 binding layer, crate-type = ["cdylib"] only, depends on gridr-core as a path dependency. No more feature-gating needed since this crate now only serves the Python extension.
Benefits
- API boundary enforced by the compiler, not by convention.
gridr-py never generates doctests again (cdylib-only): no risk of regressing on this again.
gridr-core becomes a real, documented, tested Rust-facing crate (real doctests, run in CI).
Context
PR #2 exposes
src/coreas an rlib so it can be used from pure Rust (outside of Python), viacrate-type = ["cdylib", "rlib"]plus an optionalextension-modulefeature gating pyo3/numpy.This works, but has two limitations:
coreandpyapistill live in the same Cargo crate, with the API boundary maintained by convention (a feature flag) rather than by the package system itself.rlibtarget triggers the crate's doctests, several of which don't actually compile (missing imports, malformed markdown fence, an ASCII diagram parsed as Rust code, two examples out of sync with their real signature) — previously hidden behinddoctest = false.Proposal
Split into a real two-member Cargo workspace:
gridr-core: the resampling/filtering engine, no pyo3/numpy dependency, default crate-type (rlib). This is the crate an external Rust project depends on directly.gridr-py: the PyO3 binding layer,crate-type = ["cdylib"]only, depends ongridr-coreas a path dependency. No more feature-gating needed since this crate now only serves the Python extension.Benefits
gridr-pynever generates doctests again (cdylib-only): no risk of regressing on this again.gridr-corebecomes a real, documented, tested Rust-facing crate (real doctests, run in CI).