Compatibility fixes for modern NumPy / sklearn / HMMER / CheckM - #49
Open
rec3141 wants to merge 1 commit into
Open
Compatibility fixes for modern NumPy / sklearn / HMMER / CheckM#49rec3141 wants to merge 1 commit into
rec3141 wants to merge 1 commit into
Conversation
…+, PyTorch 2.2+) Python code fixes: - Replace sklearn.cluster._kmeans private imports with public APIs - KMeans: algorithm="full" → "lloyd", drop removed n_jobs param - stable_cumsum → np.cumsum(dtype=float64) - np.int → np.int64 (removed alias in NumPy 1.24+) - .item(0) → .item() (deprecated positional arg) - torch.cuda.amp → torch.amp with explicit device_type (PyTorch 2.4+) - ruamel.yaml: Path() → file handle loading - hmmsearch: add -E 1e-10 fallback when --cut_tc fails (HMMER 3.3+) Runtime hardening: - Auto-resolve CHECKM_DATA_PATH from conda prefix - Auto-set MPLCONFIGDIR to avoid writes to restricted home dirs - Lazy imports to avoid loading ML libs for lightweight subcommands - Suppress pkg_resources deprecation warning from CheckM Environment (comebin_env.yaml): - Modernize all deps: Python 3.10-3.11, NumPy <2.0, scikit-learn 1.4+ - Move pip packages to conda-forge where available - Pin pplacer=1.1.alpha19 (>=1.1 doesn't match alpha version strings) - Pin python<3.12 for CheckM1 compatibility - Add missing ruamel.yaml and tqdm dependencies - CPU-only PyTorch (conda-forge default) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rec3141
force-pushed
the
codex/recent-dependencies-fix
branch
from
February 12, 2026 08:58
db6e76d to
8fab9d7
Compare
ziyewang
force-pushed
the
master
branch
2 times, most recently
from
August 13, 2026 15:40
70e5b0f to
ad6ceb3
Compare
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
Update COMEBin to run with modern dependencies (Python 3.11, NumPy 1.26, scikit-learn 1.4+, PyTorch 2.2+), replacing removed/deprecated APIs and fixing env solver failures.
What changed
Python code fixes:
sklearn.cluster._kmeansprivate imports → public APIs (KMeans,euclidean_distances,check_random_state,row_norms)KMeans(algorithm="full", n_jobs=-1)→KMeans(algorithm="lloyd", n_init=10)stable_cumsum→np.cumsum(dtype=np.float64)np.int→np.int64(5 instances across 3 files).item(0)→.item()(deprecated positional arg in NumPy 2.x)torch.cuda.amp.{GradScaler,autocast}→torch.amp.{GradScaler,autocast}with explicitdevice_type(PyTorch 2.4+)ruamel.yamlPath loading → file handle (avoids deprecation warning)-E 1e-10when--cut_tcfails (HMMER ≥3.3)Runtime hardening:
CHECKM_DATA_PATHfrom$CONDA_PREFIXMPLCONFIGDIRto output dir (avoids writes to restricted$HOME)pkg_resourcesdeprecation warning from CheckMEnvironment (
comebin_env.yaml):<3.12for CheckM1 compatibility)>=1.26,<2.0, scikit-learn>=1.4, PyTorch>=2.2hnswlib,python-igraph,leidenalg,scanpyfrom pip to conda-forgepplacer=1.1.alpha19(>=1.1doesn't match alpha version strings → solver failure)ruamel.yamlandtqdmdependenciesIssue tags
Fixes #44
Refs #29, #38, #11
Validation
mamba env create -f comebin_env.yamlAI Assistance
Portions of this PR were developed with assistance from OpenAI Codex (initial refactoring) and Claude Code (code review, additional fixes, env debugging).