Skip to content

Conversation

@zasexton
Copy link
Contributor

@zasexton zasexton commented Oct 9, 2025

Current situation

  • This PR makes svVascularize installable in two modes:
    • Pure‑Python by default via pip install svv.
    • Accelerated via pip install "svv[accel]" using a new companion wheel svv‑accelerated.
  • It also removes the unused hnswlib dependency and HNSWTree code path in favor of
    USearchTree.
  • Related items to track/discuss:
    • Packaging: offering both pure and accelerated wheels from the same repo.
    • Naming: reserving the “all” extra for future bundles (accelerators + solvers).

Release Notes

  • New: Pure‑Python install path by default; compiled accelerators are now optional.
    • pip install svv → pure‑Python fallbacks.
    • pip install "svv[accel]" (or "svv[accelerated]") → installs the companion
      svv‑accelerated wheel; svv auto‑prefers compiled modules.
  • New: Companion wheel “svv‑accelerated”
    • Contains compiled C/Cython extensions under the svv_accel.* namespace.
    • svv transparently aliases svv_accel modules to svv.* imports when present.
  • CI: Build and publish both wheels (svv and svv‑accelerated) via cibuildwheel.
    • Pure‑Python svv wheel and sdist.
    • Accelerated svv‑accelerated wheels (no sdist).
  • Docs: Updated installation guide (docs/install.html) with:
    • Clear pure vs accelerated instructions.
    • Advanced from‑source option.
    • Snippet to verify which backend is active at runtime.
  • Packaging cleanup:
    • Removed hnswlib dependency and HNSWTree implementation; use USearchTree consistently.
    • Updated import sites to drop HNSWTree.
  • Minor message tweak: local optimization ImportError now recommends pip install svv[accel].
  • Migration notes (potentially breaking):
    • If external code directly imports/uses HNSWTree, migrate to USearchTree (compatible API
      in this context).
    • If docs/scripts previously referenced svv[all] for accelerators, switch to svv[accel].
      The “all” extra is now reserved for a future full bundle.

Documentation

  • Installation page updated:
    • Added “Choose pure‑Python or accelerated” section with precise commands.
    • Added verification snippet to confirm loaded backend (.so/.pyd vs .py).
  • No API reference changes required; accelerators are auto‑preferred when installed.

Testing

  • CI builds both pure‑Python and accelerated wheels on Linux/macOS/Windows for CPython 3.9–
    3.12.
  • Existing test suite should pass in both modes (pure and accelerated).
  • Packaging workflow verifies sdist creation (for svv) and wheel builds for both
    distributions.
  • Follow‑up recommended:
    • Ensure coverage of the aliasing behavior (svvsvv_accel) and the pure/accelerated
      import preference in CI.
    • Confirm downstream workflows (e.g., large‑tree builds, GUI stacks) still succeed in
      both modes.

Code of Conduct & Contributing Guidelines

Update Python fallback implementations to match Cython behavior for
numerical edge cases in c_angle and c_basis modules.

Changes to c_angle.py:
- Use threshold-based zero detection (denom < 1e-15) instead of exact zero check
- Return angle = 0.0 degrees for zero/near-zero magnitude vectors
- Match Cython's handling of degenerate cases

Changes to c_basis.py:
- Remove zero-magnitude protection to match Cython behavior
- Both implementations now produce NaN/Inf for identical points
- Ensures consistent behavior between compiled and fallback versions

These changes ensure Python fallbacks produce identical results to Cython
extensions when available, preventing inconsistent behavior based on whether
extensions are compiled.
Remove GUI troubleshooting scripts, test files, and documentation that
were added during development but should not be tracked in the repository.

Files remain in working directory as untracked files.
…-prefer accelerators; build both wheels in CI
@zasexton zasexton self-assigned this Oct 9, 2025
@zasexton zasexton merged commit 0c89fc5 into SimVascular:pure-python-install Oct 9, 2025
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.

1 participant