Repository navigation
Conversation
Owner
Author
Classifier speed-up
Anomaly detector speedup
|
Brings in the Dependabot action bumps (checkout v7, setup-python v7, codecov-action v7.1.1). Conflict resolution: publish-to-pypi.yml was deleted on this branch but modified on main. Keep it: PyPI trusted publishing is registered against this workflow filename (v0.2.3 was published through it). It is rewritten for compiled wheels in a follow-up commit.
Typed memoryviews declared as double[:, ::1] request a writable buffer, so read-only float64 C-contiguous inputs (which np.ascontiguousarray passes through uncopied) raised "ValueError: buffer source array is read-only". SciPy's cdist accepts these, so this was a regression for e.g. joblib memmaps under n_jobs > 1, np.load(mmap_mode="r"), pandas copy-on-write arrays, and DistanceAnomaly(scale=False) fit on a single class (1-row centroid frame). Declare the input memoryviews const; the kernels only read from them.
It is regenerated from _cdistances.pyx on every build (Cython is a build requirement) and .gitignore already excludes it; tracking it meant every local build dirtied the working tree and the diff carried ~31k generated lines.
0.3.0 is scoped to the Cython speedup only. Remove the experimental dispersion_stat="aiqr" / "cdf" options, the cdf_grid_size parameter, their tests, and DistanceAnomaly's all-NaN metric-column drop (needed only under cdf). The _class_transform refactor is kept for std/iqr; it reproduces the original scaling exactly (test_std_path_unchanged). To restore the work for 0.4.0: git revert <this commit>.
Next minor after 0.2.3 (latest on PyPI): Cython kernels for the custom metrics, distclassipy.cdist, DistanceAnomaly exported at top level, plus the meehl/dice/mutation fixes described in the PR.
Fixes the failing "Build and test sdist" check on PR #38 and the release pipeline, which had never run: - Remove ci.yml. Its pytest matrix duplicated testing-and-coverage.yml, and its tag-triggered publish job would have broken PyPI trusted publishing (registered against publish-to-pypi.yml, no environment). - testing-and-coverage.yml: add Python 3.14 and an sdist job that installs the sdist and runs the full suite from outside the checkout. The old smoke test ran `python -c "import distclassipy"` from the repo root, so it imported the uncompiled source tree instead of the installed wheel ("No module named 'distclassipy._cdistances'"). - publish-to-pypi.yml: same filename and release trigger, but build the sdist plus cibuildwheel wheels (cp310-cp314; Linux x86_64/aarch64, Windows AMD64, macOS x86_64/arm64) before publishing. Wheel tests use CIBW_TEST_SOURCES: running pytest on {project}/tests would put the repo root on sys.path (tests/__init__.py) and hit the same shadowing bug.
Owner
Author
|
Cython kernels for all custom metrics (38-500x faster; DistanceAnomaly ~78x), Small breaking change in behaviour:
|
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.
Written non-SciPy functions in Cython to enable SciPy-like speedup in compute speed & performance.