Skip to content

Commit ea293c2

Browse files
authored
chore: drop fastcluster to allow numpy 2 (#147)
1 parent 828a3b7 commit ea293c2

File tree

4 files changed

+154
-132
lines changed

4 files changed

+154
-132
lines changed

mostlyai/qa/_accuracy.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from typing import Any, Literal
2020
from collections.abc import Callable, Iterable
2121

22-
import fastcluster
2322
import numpy as np
2423
import pandas as pd
2524
import phik.phik
@@ -1234,7 +1233,7 @@ def calculate_correlations(binned: pd.DataFrame, corr_cols: Iterable[str] | None
12341233
# determine column order via hierarchical linkage based on data; this mimics the logic used within
12351234
# `seaborn.clustermap`. We wrap this in try/except to be on the safe side, as `dendogram` and `linkage` can
12361235
# raise errors for edge cases. And because the improved sort order is not critical to have in place.
1237-
corr_link = fastcluster.linkage(corr, method="complete", metric="euclidean")
1236+
corr_link = scipy.cluster.hierarchy.linkage(corr, method="complete", metric="euclidean")
12381237
corr_idx = scipy.cluster.hierarchy.dendrogram(corr_link, no_plot=True)["leaves"]
12391238
corr_cols = corr.columns[corr_idx]
12401239
except Exception:

mostlyai/qa/assets/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
def read_html_assets() -> dict[str, str]:
32-
return {fn: Path(HTML_ASSETS_PATH / fn).read_text(encoding='utf-8') for fn in _HTML_ASSET_FILES}
32+
return {fn: Path(HTML_ASSETS_PATH / fn).read_text(encoding="utf-8") for fn in _HTML_ASSET_FILES}
3333

3434

3535
def load_tokenizer():

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ classifiers = [
2525
]
2626
dependencies = [
2727
"pydantic>=2.0.0,<3.0.0",
28-
"numpy>=1.26.3,<2.0.0",
28+
"numpy>=1.26.3",
2929
"scipy>=1.11.0",
3030
"pandas>=2.0.0",
3131
"pyarrow>=14.0.0",
3232
"plotly>=6.0.0",
3333
"phik>=0.12.4",
34-
"fastcluster>=1.2.6",
3534
"joblib>=1.4.2",
3635
"Jinja2>=3.1.2",
3736
"scikit-learn>=1.4.0",
3837
"sentence-transformers>=3.1.0",
38+
"accelerate>=1.5.0",
3939
"rich>=13.9.4,<14",
4040
"skops>=0.11.0",
4141
"torch>=2.6.0",

0 commit comments

Comments
 (0)