Skip to content

fix: restore HRP optimization with current SciPy - #2

Merged
Geochelone666 merged 1 commit into
mainfrom
maintenance-public-linkage-methods
Oct 22, 2026
Merged

Geochelone666 merged 1 commit into
mainfrom
maintenance-public-linkage-methods

Conversation

@Geochelone666

Copy link
Copy Markdown
Owner

HRPOpt.optimize reads scipy.cluster.hierarchy._LINKAGE_METHODS, a private registry missing in SciPy 1.18.1. This raises AttributeError for every method, including the default, and causes five existing HRP tests plus the full CI matrix/coverage to fail independently of the discrete-allocation change in #1.

Delegate method validation to the public scipy.cluster.hierarchy.linkage API. Existing invalid-method inputs still raise ValueError. Add coverage for all seven methods documented by SciPy: https://docs.scipy.org/doc/scipy/reference/generated/scipy.cluster.hierarchy.linkage.html

Validation: reproduced five failures on the unmodified main HRP code with SciPy 1.18.1. All 13 HRP tests, including the seven documented-method cases, pass after this change.

@Geochelone666
Geochelone666 merged commit 355ab09 into main Oct 22, 2026
38 checks passed
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