Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
10158f5
Update installation documentation to recommend uv
GeorgePearse Nov 2, 2025
cfa4fa0
Add AGENTS.md workflow documentation
GeorgePearse Nov 2, 2025
fc893dd
Add prek configuration with ruff (all rules) and mypy
GeorgePearse Nov 2, 2025
22f9cf0
Replace mypy with ty (Astral) for type checking
GeorgePearse Nov 2, 2025
35c2cf0
Update ty configuration - manual execution until pre-commit support a…
GeorgePearse Nov 2, 2025
4b902ae
Integrate ty and prek fully into GitHub workflows
GeorgePearse Nov 2, 2025
4854c2b
Add testmon file-based database configuration and documentation
GeorgePearse Nov 2, 2025
3ba83cc
Add skylos static analysis and verify ty type checking integration
GeorgePearse Nov 3, 2025
3db299f
Fix critical ruff linting errors (F401, NPY002, ARG002, SLF001)
GeorgePearse Nov 3, 2025
281d5bc
Fix all ruff errors in __init__.py and validation.py
GeorgePearse Nov 3, 2025
38f1d59
Fix most ruff errors in utils.py and update config
GeorgePearse Nov 3, 2025
31c18f6
Add comprehensive type annotations to core UMAP library files
GeorgePearse Nov 3, 2025
79ebada
Add Rust-based HNSW nearest neighbor backend
GeorgePearse Nov 4, 2025
c628135
Rename package from umap-learn to umap
GeorgePearse Nov 4, 2025
ce5d98f
Update package references from umap-learn to umap in Python modules
GeorgePearse Nov 4, 2025
30019ec
Convert README.rst to README.md
GeorgePearse Nov 4, 2025
0fb6970
Convert all documentation from reStructuredText (.rst) to Markdown (.md)
GeorgePearse Nov 4, 2025
1874aa7
Setup MkDocs with Material theme for GitHub Pages
GeorgePearse Nov 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
*.ipynb linguist-language=Python
*.ipynb linguist-language=Python
17 changes: 17 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,29 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v2

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install pytest pytest-cov pytest-testmon

- name: Install prek and ty
run: |
uv tool install prek ty

- name: Run prek hooks (ruff + code quality checks)
run: |
prek install
prek install-hooks
prek run --all-files

- name: Run ty type checker
run: |
ty check

- name: Run tests (optimized with testmon)
run: |
pytest umap/tests/ -v --cov=umap --cov-report=xml --testmon
Expand Down
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,9 @@ dist
# coverage
.coverage
.coverage.*
.coverage.xml
.coverage.xml


# Added by cargo

/target
2 changes: 1 addition & 1 deletion .idea/umap-nan.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
repos:
# Ruff linter with all rules enabled
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.3
hooks:
- id: ruff-check
args: [--fix, --unsafe-fixes]
types_or: [python, pyi]
- id: ruff-format
types_or: [python, pyi]

# Type checker: ty (Astral's Rust-based type checker) & Skylos
- repo: local
hooks:
- id: ty
name: ty type checker
entry: ty check umap/
language: system
types: [python]
pass_filenames: false
stages: [manual]
- id: skylos
name: Skylos static analysis
entry: python -m skylos.cli .
language: system
types: [python]
pass_filenames: false

# Standard pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
args: [--maxkb=5000]
- id: check-ast
- id: check-merge-conflict
179 changes: 179 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
# Agent Development Workflow

This document specifies the workflow for implementing tasks and features in this repository.

## Core Principles

Every task should follow a structured workflow to ensure code quality, traceability, and easy review.

## Workflow

### 1. Create a Fresh Branch

Before starting any task, create a new branch from `master`:

```bash
git checkout master
git pull origin master
git checkout -b <branch-name>
```

**Branch naming conventions:**
- Feature: `feat/<description>` (e.g., `feat/add-gpu-support`)
- Bug fix: `fix/<description>` (e.g., `fix/memory-leak`)
- Documentation: `docs/<description>` (e.g., `docs/update-installation`)
- Refactoring: `refactor/<description>` (e.g., `refactor/optimize-metric-computation`)
- Tests: `test/<description>` (e.g., `test/add-parametric-umap-tests`)

### 2. Implement the Task

Work on the implementation in your branch:

- Write code following the project's conventions
- Add tests for new functionality
- Update documentation as needed
- Run pre-commit hooks to ensure code quality
- Commit changes with clear, descriptive messages

**Commit Message Guidelines:**
- Use imperative mood ("add" not "adds", "fix" not "fixes")
- First line should be concise (50 chars or less)
- Provide detailed explanation in the body if needed
- Reference related issues if applicable

Example:
```bash
git add .
git commit -m "Add GPU support for metric computation

- Implement CUDA kernels for distance calculations
- Add device selection logic
- Update tests for GPU paths
"
```

### 3. Submit a Draft PR

After completing the task, push your branch and create a **draft pull request**:

```bash
git push -u origin <branch-name>
gh pr create --draft --title "<title>" --body "<description>"
```

**Draft PR Requirements:**
- Clear, descriptive title
- Summary of changes made
- List of key implementation details
- Note any testing performed
- Flag any known issues or TODOs

Example:
```markdown
## Summary
Implements GPU acceleration for metric computation using CUDA.

## Changes
- Added CUDA kernels for Euclidean and Cosine distances
- Implemented device management and memory pooling
- Added fallback to CPU for unsupported operations

## Testing
- Unit tests pass on GPU and CPU paths
- Performance benchmarks show 3.2x speedup on MNIST

## Known Issues
- Sparse matrix operations not yet GPU-accelerated
```

### 4. Code Review

The draft PR allows for:
- Early feedback on approach and design
- Discussion of implementation details
- Identification of issues before final submission
- Iteration based on review comments

When ready for final review, convert the draft to a regular PR or request review.

## Pre-submission Checklist

Before creating a PR, ensure:

- [ ] All tests pass locally
- [ ] Pre-commit hooks pass
- [ ] Code follows project conventions
- [ ] Documentation is updated
- [ ] Commit messages are clear and descriptive
- [ ] Branch is up to date with `master`
- [ ] No unrelated changes are included

## Important Notes

### No Direct Commits to Master
- **Never commit directly to `master`**
- All changes must go through the branch → draft PR → review → merge workflow

### Keep Branches Fresh
- Rebase on `master` if it diverges significantly
- Keep branch scope focused on a single task
- Delete branch after merge

### Tests Are Required
- All new code must have corresponding tests
- All tests must pass before submitting PR
- Include both unit and integration tests where appropriate

### Documentation
- Update README if adding user-facing features
- Update docstrings for code changes
- Add migration guides for breaking changes

## Example Workflow

```bash
# 1. Create a branch
git checkout -b feat/add-inverse-transform-optimization

# 2. Implement the feature
# ... write code, tests, docs ...

# 3. Test locally
pytest umap/tests/ -v

# 4. Commit changes
git add .
git commit -m "Optimize inverse transform computation

- Use vectorized operations for faster calculation
- Add caching for repeated transforms
- Improve memory efficiency
"

# 5. Push to remote
git push -u origin feat/add-inverse-transform-optimization

# 6. Create draft PR
gh pr create --draft \
--title "feat: Optimize inverse transform computation" \
--body "
## Summary
Implements optimization improvements for inverse_transform method.

## Changes
- Vectorized operations for 2x speedup
- Caching layer for repeated queries
- Reduced memory allocation

## Testing
- All tests pass
- Benchmarks show 50% improvement on large datasets
"
```

## Questions?

If you're unsure about any aspect of the workflow:
1. Check existing PRs for examples
2. Refer to the project's CLAUDE.md for additional conventions
3. Open an issue with questions about the process
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# Contributing

Contributions of all kinds are welcome. In particular pull requests are appreciated.
Contributions of all kinds are welcome. In particular pull requests are appreciated.
The authors will endeavour to help walk you through any issues in the pull request
discussion, so please feel free to open a pull request even if you are new to such things.

## Issues

The easiest contribution to make is to [file an issue](https://github.com/lmcinnes/umap/issues/new).
It is beneficial if you check the [FAQ](https://umap-learn.readthedocs.io/en/latest/faq.html),
It is beneficial if you check the [FAQ](https://umap.readthedocs.io/en/latest/faq.html),
and do a cursory search of [existing issues](https://github.com/lmcinnes/umap/issues?utf8=%E2%9C%93&q=is%3Aissue).
It is also helpful, but not necessary, if you can provide clear instruction for
It is also helpful, but not necessary, if you can provide clear instruction for
how to reproduce a problem. If you have resolved an issue yourself please consider
contributing to the FAQ to add your problem, and its resolution, so others can
benefit from your work.

## Documentation

Contributing to documentation is the easiest way to get started. Providing simple
clear or helpful documentation for new users is critical. Anything that *you* as
clear or helpful documentation for new users is critical. Anything that *you* as
a new user found hard to understand, or difficult to work out, are excellent places
to begin. Contributions to more detailed and descriptive error messages is
especially appreciated. To contribute to the documentation please
especially appreciated. To contribute to the documentation please
[fork the project](https://github.com/lmcinnes/umap/issues#fork-destination-box)
into your own repository, make changes there, and then submit a pull request.

Expand All @@ -44,12 +44,12 @@ in the `doc/_build` folder.
## Code

Code contributions are always welcome, from simple bug fixes, to new features. To
contribute code please
contribute code please
[fork the project](https://github.com/lmcinnes/umap/issues#fork-destination-box)
into your own repository, make changes there, and then submit a pull request. If
you are fixing a known issue please add the issue number to the PR message. If you
are fixing a new issue feel free to file an issue and then reference it in the PR.
You can [browse open issues](https://github.com/lmcinnes/umap/issues),
You can [browse open issues](https://github.com/lmcinnes/umap/issues),
or consult the [project roadmap](https://github.com/lmcinnes/umap/issues/15), for potential code
contributions. Fixes for issues tagged with 'help wanted' are especially appreciated.

Expand Down
Loading
Loading