Repository navigation
refactor: standardize 5-slot layout, modularize ncl_curly/, and add PEP 562 lazy imports + zero-tax native fast paths - #2
Merged
Conversation
…EP 562 lazy imports + zero-tax native fast paths
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.
Summary
Standardize
skyborn-plotinto the Gold-Standard Template #2 layout (5-slot layout, modularncl_curly/Rust submodule directory,_plot_rs.pyitype stub +py.typed, PEP 562 lazy__init__.py, and zero-tax positional Rust fast paths in_core/native.py) with zero behavioral or numerical change.Key Changes
git mv c_ref legacy; updated allc_refreferences inlegacy/README.md,pyproject.toml(exclude = ["legacy/**", "tools/**", "benchmarks/**", "rust/target/**", "target/**", "assets/**"]), and.github/workflows/ci.yml(paths-ignore).rust/skybornplot-core/src/ncl_curly/(7 submodules, 3,034 lines total, preservingskybornplot_core::ncl_curly::*1:1):mod.rs(133 lines),grid.rs(631 lines),trace.rs(929 lines),thinning.rs(282 lines),stipple.rs(192 lines),arrows.rs(208 lines),tests.rs(659 lines).src/skybornplot/__init__.py: preserves__version__, exact__all__,skyborn.plotre-export compatibility,_SkybornPlotModule.__setattr__guard soimport skybornplot.scatterdoes not shadowskybornplot.scatter, and leaves'matplotlib' not in sys.moduleson bareimport skybornplot.src/skybornplot/_plot_rs.pyi(covering all 18 PyO3 functions acrossnclcurly,contour_arrows, andcontour) andsrc/skybornplot/py.typed.src/skybornplot/_core/native.py): added_as_f64/_as_intphelpers and positional-argument fast paths whennative_fn is _rs_*, skipping redundant post-callnp.asarrayand~np.isfiniterescans while keeping exact mock/fallback paths intact.Verification & Neon QA Acceptance (
#240)cargo test --release --workspace --exclude skybornplot-py: 26 / 26 passed.RUSTDOCFLAGS="-D warnings" cargo doc --workspace --exclude skybornplot-py --no-deps: 0 warnings.pytest(RAM-disk wheel stage): 448 passed, 1 skipped (includingtests/test_rust_parity.py: 12 / 12 against live v0.1.0 C oracle).Skyborn/tests/test_plot_*.py: 407 passed, 1 skipped;skyborn.plot11/11 alias verified.hyperfine/ E2E benchmarks):import skybornplot: 85.9x faster (1.323 s -> 0.015 s), 8.8x less RAM (165.0 MiB -> 18.7 MiB).curly_vectorE2E (73x144, 20 figs): 1.89x faster (52.91 ms/fig -> 28.05 ms/fig).scattercells E2E (73x144, 20 figs): 1.76x faster (41.48 ms/fig -> 23.56 ms/fig).