chore: modernize build system, add CI/CD, MPS support, and comprehensive tests#6
Merged
chore: modernize build system, add CI/CD, MPS support, and comprehensive tests#6
Conversation
- Add GitHub Actions CI (lint + test matrix across 3 OS × 3 Python versions) - Add GitHub Actions release workflow (tag-triggered PyPI publish) - Add pre-commit config (ruff lint/format + standard hooks) - Add comprehensive .gitignore for Python projects - Add CHANGELOG.md, CONTRIBUTING.md, and py.typed marker - Enhance README with badges, fixed URLs, code example fix, citation section - Add classifiers and project.urls to pyproject.toml - Fix ruff per-file-ignores path (test/* → tests/*) - Target semantic-release at main branch instead of restructure - Add pre-commit to dev dependencies, remove release dependency group - Remove legacy files: setup.py, requirements.txt, MANIFEST.in, scripts/ - Clean up Makefile: remove release targets, add pre-commit target Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ✏️ Tip: You can disable in-progress messages and the fortune message in your review settings. Tip You can customize the tone of the review comments and chat replies.Configure the ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Source code fixes: - Modernize super() call in MLP (UP008) - Fix unused loop variables (B007) - Replace assert with ValueError in VariableDataset (S101) - Use list.extend instead of append loop (PERF401) - Use list comprehension for adjacency sets (PERF401) - Remove commented-out code (ERA001) - Add missing module, package, and method docstrings (D100/D104/D105/D107) Test fixes: - Remove unused variables (F841) - Fix unused loop variables (B007) - Remove commented-out code (ERA001) - Fix docstring punctuation (D400/D401/D415) Ruff config: - Add targeted ignore list for ML/scientific conventions (N803/N806, FBT, etc.) - Add per-file ignores for test patterns (S101, SLF001, ARG, etc.) - All ruff checks now pass Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CI:
- Set KMP_DUPLICATE_LIB_OK and OMP_NUM_THREADS globally to prevent
dual-OpenMP crashes between FAISS and PyTorch
Test fixes (test_core.py):
- Fix fitted_pumap fixture to use real model instead of broken mocks
- Fix error match strings ("not fitted" → "must be fitted")
- Fix fit_transform mock assertions to include default kwargs
- Fix load() calls to use classmethod return value
- Fix device handling test to verify directly instead of via mocks
Test fixes (test_datasets_edge.py):
- Fix invalid batch_size test to match actual behavior (no validation)
- Fix adjacency set edge case assertions for correct graph logic
Test fixes (test_utils_graph.py):
- Fix single_point and k_larger_than_dataset tests (FAISS pads with -1)
- Fix invalid k test to expect correct exception types
- Fix convergence test with non-degenerate geometry and relaxed tolerance
Test fixes (test_datasets_covariates.py):
- Update expected exception from AssertionError to ValueError
Result: 191 passed, 0 failed, 12 skipped, 85% coverage
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The swiss_roll_data fixture imports sklearn which is in the examples optional dependency group. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… sources Lower torch floor from >=2.6.0 to >=2.3.1 since no 2.6+-specific APIs are used. The numpy>=2.2.3 constraint sets the practical floor at 2.3.1. Also removes unused torchvision source entries from uv config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Explicitly pass weights_only=True to silence FutureWarning on PyTorch 2.4-2.5 and match the new default in 2.6+. The save dict only contains safe types (dicts, strings, ints, tensors) so this is safe. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Set KMP_DUPLICATE_LIB_OK and OMP_NUM_THREADS at test startup, matching the CI environment variables that prevent dual-OpenMP conflicts between FAISS and PyTorch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add optional extras (cpu, cu118, cu121, cu124, cu126, cu128) for selecting the PyTorch CUDA build on Linux. Non-Linux platforms automatically get the CPU build via marker. Update CI to use --extra cpu since runners have no GPUs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rewrite install section with GPU acceleration guide and uv CUDA extras usage. Update Makefile and CLAUDE.md to use explicit extras instead of --all-extras which conflicts with mutually exclusive CUDA extras. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove dependency upper bounds (unnecessary resolver constraints) - Remove dead [tool.semantic_release] config (release workflow is tag-based) - Remove pytest defaults that restate built-in values - Remove HTML/XML coverage reports from default addopts - Remove blanket filterwarnings suppression Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
uv run re-syncs the environment, which on Linux resolves torch from PyPI (CUDA-enabled) instead of the CPU index. Using --no-sync skips the re-sync and uses the already-configured environment from uv sync. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The torch CPU wheel from download.pytorch.org doesn't declare sympy as a dependency, unlike the PyPI wheel. Some torch.optim code paths require sympy at runtime. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Device selection now follows CUDA > MPS > CPU when no explicit device is passed. MPS does not support sparse tensors, so the probability matrix stays on CPU and is transferred per-batch (with a warning). Docs, tests, and example notebook updated accordingly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mpatibility TorchSparseDataset now stores COO data as sorted linear indices and uses torch.searchsorted for lookups, eliminating sparse tensor usage entirely. This fixes MPS support without special-casing and simplifies core.py. Also fixes macOS multiprocessing deadlocks (use spawn context, set OMP env vars, import FAISS before PyTorch) and adds a single-process fast path for negative edge sampling. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ective Replace en dashes with hyphens in comments and multiplication sign with asterisk in docstring to satisfy RUF002/RUF003. Remove unused E402 from noqa directive (RUF100). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update test assertions to use new internal attributes (_keys, _values, _n) instead of the removed P_sparse. Adjust OOB tests to expect zero returns instead of exceptions. Handle empty matrix edge case in __getitem__. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Build system & tooling
cu124,cu126, etc.) alongside CPU extra>=2.3.1CI/CD
mainanddevDevice support
TorchSparseDatasetfor full MPS compatibilityTests
test_core,test_datasets_covariates,test_datasets_edge,test_models_mlp,test_utils_graph,test_utils_lossesconftest.pywith OpenMP conflict preventionCode quality & docs
.gitignoreoverhaul,py.typedmarkerTest plan
uv buildproduces valid wheel🤖 Generated with Claude Code