minor updates to v0.8.1 for compatability with numpy 2.0+ and pandas 2.0+#267
Merged
jeremymanning merged 4 commits intomasterfrom Jul 9, 2025
Merged
minor updates to v0.8.1 for compatability with numpy 2.0+ and pandas 2.0+#267jeremymanning merged 4 commits intomasterfrom
jeremymanning merged 4 commits intomasterfrom
Conversation
This file provides comprehensive guidance for future Claude Code instances working with the HyperTools codebase, including: - Key commands for testing, development, and documentation - High-level architecture overview and data flow - Core component descriptions and design patterns - Testing strategy and development notes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
The test was failing because t-SNE's default perplexity (30) was larger than the number of samples (10) in the test data. Fixed by explicitly setting perplexity=5 which is less than the sample count. This ensures the test passes while maintaining the same test coverage for t-SNE dimensionality reduction functionality. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Critical fixes: - Replace deprecated pkg_resources with importlib.metadata in config.py - Fix scipy.stats.stats.pearsonr import to use scipy.stats.pearsonr - Add comprehensive compatibility review tracking in notes/ All 129 tests pass with numpy 2.0.2 and pandas 2.2.3. The codebase is now fully compatible with: - NumPy ≥ 2.0.0 (already specified in requirements.txt) - Pandas ≥ 2.2.0 (already specified in requirements.txt) - Python 3.9+ (as specified in setup.py) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Features: - Test matrix across Python 3.9, 3.10, 3.11, 3.12 - Cross-platform testing: Ubuntu, Windows, macOS - Dependency caching for faster builds - System dependencies (FFmpeg) installation - Coverage reporting on Ubuntu Python 3.12 - Parallel execution with fail-fast disabled - Triggers on push/PR to master and dev branches The workflow runs 12 parallel jobs (4 Python versions × 3 OS) to ensure comprehensive compatibility testing across all supported environments. Also added importlib_metadata fallback dependency for Python < 3.8 compatibility in requirements.txt. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull Request Overview
This PR updates compatibility with NumPy 2.0+ and pandas 2.0+ and adds a GitHub Actions CI workflow.
- Tests: updated
test_reduce_TSNEto use the newreducedict signature - Code: fixed deprecated imports (
scipy.stats.stats,pkg_resources) - CI: added GitHub Actions workflow and related documentation files
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_reduce.py | Updated TSNE test to use reduce={'model': ..., 'params': {...}} |
| hypertools/tools/describe.py | Changed import from scipy.stats.stats to scipy.stats |
| hypertools/config.py | Switched from pkg_resources to importlib.metadata for version |
| notes/numpy_pandas_compatibility_review.csv | Added compatibility notes for NumPy 2.0+ and pandas 2.0+ |
| notes/github_actions_info.md | Documented GitHub Actions CI/CD setup |
| .github/workflows/test.yml | Added GitHub Actions workflow for tests and coverage reporting |
| CLAUDE.md | Added AI guidance documentation |
Comments suppressed due to low confidence (3)
tests/test_reduce.py:95
- Consider adding tests for other
reducealgorithms with parameter dicts and edge cases to ensure the new API signature is consistently handled across different configurations.
reduced_data_3d = reducer(data, reduce={'model': 'TSNE', 'params': {'perplexity': 5}}, ndims=3)
.github/workflows/test.yml:50
- The
continue-on-error: truesetting for Windows ffmpeg installation may mask failures and lead to inconsistent test environments; consider removing it to surface installation issues.
continue-on-error: true
tests/test_reduce.py:95
- [nitpick] The inline nested dict for
reducearguments is verbose; consider extracting it into a named variable or fixture to improve readability and reuse.
reduced_data_3d = reducer(data, reduce={'model': 'TSNE', 'params': {'perplexity': 5}}, ndims=3)
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.
also added github actions tests (they run automatically on pull requests to master or dev)