Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 4 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,20 @@ on: push
jobs:
build:
runs-on: self-hosted
strategy:
matrix:
python-version:
- 3.10.14
- 3.11
- 3.12
steps:
- uses: actions/checkout@v4
- name: Setup rye
uses: eifinger/setup-rye@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
version: '0.44.0'
- name: Pin Python version
run: rye pin ${{ matrix.python-version }}
- name: Setup environment
run: make .venv
- name: Test with pytest
run: make coverage.xml
- name: Check formatting
run: rye fmt --check parafac2
run: uv run ruff format --check parafac2
- name: Check linting
run: rye lint parafac2
run: uv run ruff check parafac2
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
Expand Down
33 changes: 1 addition & 32 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,6 @@ __pycache__/
# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
Expand Down Expand Up @@ -160,6 +130,5 @@ cython_debug/
#.idea/

.DS_Store
requirements.lock
requirements-dev.lock
uv.lock
.python-version
12 changes: 6 additions & 6 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
.PHONY: clean test pyright

test: .venv
rye run pytest -s -v -x --durations=0
uv run pytest -s -v -x --durations=0

.venv: pyproject.toml
rye sync
uv sync --dev

testprofile:
rye run python3 -m cProfile -o profile -m pytest -s -x -v
rye run gprof2dot -f pstats --node-thres=1.0 profile | dot -Tsvg -o profile.svg
uv run python3 -m cProfile -o profile -m pytest -s -x -v
uv run gprof2dot -f pstats --node-thres=1.0 profile | dot -Tsvg -o profile.svg

coverage.xml: .venv
rye run pytest --junitxml=junit.xml --cov=parafac2 --cov-report xml:coverage.xml
uv run pytest --junitxml=junit.xml --cov=parafac2 --cov-report xml:coverage.xml

pyright: .venv
rye run pyright parafac2
uv run pyright parafac2

clean:
rm -rf output profile profile.svg
Expand Down
20 changes: 11 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
[project]
name = "parafac2"
version = "0.1.0"
version = "0.2.0"
description = "An implementation of PARAFAC2 that handles sparsity for single cell data."
authors = [{name = "Aaron Meyer", email = "git@asmlab.org" }]
license = "MIT"
requires-python = ">= 3.11"
requires-python = ">= 3.12"

dependencies = [
"numpy>=2.2",
"scipy>=1.15",
"scipy>=1.16",
"tensorly>=0.8.1",
"tqdm>=4.66",
"cupy-cuda12x>=13.4",
"anndata>=0.11",
"cupy-cuda12x>=13.6",
"anndata>=0.12",
]

[tool.rye]
managed = true
dev-dependencies = [
"pytest>=8.3",
[dependency-groups]
dev = [
"ruff>=0.14.1",
"pytest>=8.4",
"pytest-cov>=6.1",
"pyright>=1.1.380",
]
Expand Down Expand Up @@ -48,3 +48,5 @@ select = [
# type checking
"TC",
]