Skip to content

Commit e120c92

Browse files
authored
Convert to uv (#501)
1 parent 72df273 commit e120c92

10 files changed

Lines changed: 2178 additions & 657 deletions

File tree

.github/workflows/build.yml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,19 @@ on: push
44
concurrency: gpu
55

66
jobs:
7-
build:
8-
runs-on: self-hosted
9-
steps:
10-
- uses: actions/checkout@v4
11-
- name: Setup rye
12-
uses: eifinger/setup-rye@v4
13-
with:
14-
enable-cache: true
15-
version: '0.39.0'
16-
- name: Setup environment
17-
run: make .venv
18-
- name: Build figures
19-
run: make all -j 2
20-
- name: Upload files
21-
uses: actions/upload-artifact@v4
22-
with:
23-
name: files
24-
path: |
25-
output/*.svg
7+
build:
8+
runs-on: self-hosted
9+
steps:
10+
- uses: actions/checkout@v6
11+
- name: Install uv
12+
uses: astral-sh/setup-uv@v6
13+
- name: Setup environment
14+
run: make .venv
15+
- name: Build figures
16+
run: make all -j 2
17+
- name: Upload files
18+
uses: actions/upload-artifact@v4
19+
with:
20+
name: files
21+
path: |
22+
output/*.svg

.github/workflows/test.yml

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,25 @@ name: Test
66
on: push
77

88
jobs:
9-
build:
10-
runs-on: self-hosted
11-
steps:
12-
- uses: actions/checkout@v4
13-
- name: Setup rye
14-
uses: eifinger/setup-rye@v4
15-
with:
16-
enable-cache: true
17-
version: '0.39.0'
18-
- name: Setup environment
19-
run: make .venv
20-
- name: Test with pytest
21-
run: make coverage.xml
22-
- name: Check formatting
23-
run: rye fmt --check RISE
24-
- name: Check linting
25-
run: rye lint RISE
26-
- name: Upload coverage to Codecov
27-
uses: codecov/codecov-action@v4
28-
with:
29-
token: ${{ secrets.CODECOV_TOKEN }}
30-
files: ./coverage.xml
31-
flags: unittests
32-
name: codecov-umbrella
33-
fail_ci_if_error: true
9+
build:
10+
runs-on: self-hosted
11+
steps:
12+
- uses: actions/checkout@v6
13+
- name: Install uv
14+
uses: astral-sh/setup-uv@v6
15+
- name: Setup environment
16+
run: make .venv
17+
- name: Test with pytest
18+
run: make coverage.xml
19+
- name: Check formatting
20+
run: rye fmt --check RISE
21+
- name: Check linting
22+
run: rye lint RISE
23+
- name: Upload coverage to Codecov
24+
uses: codecov/codecov-action@v4
25+
with:
26+
token: ${{ secrets.CODECOV_TOKEN }}
27+
files: ./coverage.xml
28+
flags: unittests
29+
name: codecov-umbrella
30+
fail_ci_if_error: true

RISE/figures/figureS9a_d.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@
1111
import numpy as np
1212
import pandas as pd
1313
import scanorama
14+
1415
# import scvi
1516
import seaborn as sns
17+
1618
# import torch
1719
from harmonypy import run_harmony
20+
from scipy.sparse import csr_array
1821

1922
from RISE.factorization import pf2
2023
from RISE.figures.common import getSetup, subplotLabel
@@ -123,14 +126,14 @@ def benchmark_algorithm(
123126

124127
elif algorithm == "Harmony":
125128
# Ensure data.X is a dense array
126-
X = data.X.toarray()
129+
X = csr_array(data.X).toarray()
127130

128131
# Prepare metadata
129132
if "pool" not in data.obs:
130133
raise ValueError(
131134
"Data must have 'batch' column in .obs for Harmony integration."
132135
)
133-
meta_data = data.obs[["pool"]]
136+
meta_data = pd.DataFrame(data.obs[["pool"]])
134137

135138
start_time = time.time()
136139
tracemalloc.start()

RISE/tests/test_import.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
import numpy as np
66
import pytest
77

8-
from ..imports import (
9-
import_thomson,
10-
)
8+
from ..imports import import_lupus, import_thomson
119

1210

1311
@pytest.mark.parametrize(
1412
"import_func",
1513
[
1614
import_thomson,
15+
import_lupus,
1716
],
1817
)
1918
def test_imports(import_func):

makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ allLupus: $(filter output/figureLupus%, $(allOutput))
1111

1212
output/figure%.svg: RISE/figures/figure%.py
1313
@ mkdir -p ./output
14-
rye run fbuild $*
14+
uv run fbuild $*
1515

1616
test: .venv
17-
rye run pytest -s -v -x
17+
uv run pytest -s -v -x
1818

1919
.venv: pyproject.toml
20-
rye sync
20+
uv sync
2121

2222
coverage.xml: .venv
23-
rye run pytest --junitxml=junit.xml --cov=RISE --cov-report xml:coverage.xml
23+
uv run pytest --junitxml=junit.xml --cov=RISE --cov-report xml:coverage.xml
2424

2525
pyright: .venv
26-
rye run pyright RISE
26+
uv run pyright RISE
2727

2828
clean:
2929
rm -rf output profile profile.svg

pyproject.toml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ requires-python = ">= 3.12"
88

99
dependencies = [
1010
"numpy>=2.2",
11-
"scipy>=1.15",
11+
"scipy>=1.16",
1212
"scikit-learn>=1.6",
1313
"seaborn>=0.13.2",
1414
"pandas>=2.2.1",
@@ -18,7 +18,7 @@ dependencies = [
1818
"anndata>=0.10.3",
1919
"datashader>=0.16",
2020
"gseapy>=1.1",
21-
"scanpy>=1.10",
21+
"scanpy>=1.11",
2222
"pacmap>=0.7.1",
2323
"tqdm>=4.66.1",
2424
"tlviz>=0.1.1",
@@ -34,23 +34,21 @@ readme = "README.md"
3434
fbuild = "RISE.figures.common:genFigure"
3535
factor = "RISE.imports:factorSave"
3636

37-
3837
[build-system]
3938
requires = ["hatchling"]
4039
build-backend = "hatchling.build"
4140

42-
[tool.rye]
43-
managed = true
44-
dev-dependencies = [
45-
"pytest>=8.0",
46-
"pytest-cov>=6.0",
47-
"pyright>=1.1.390",
41+
[dependency-groups]
42+
dev = [
43+
"pytest>=9.0",
44+
"pytest-cov>=7.0",
45+
"pyright>=1.1.407",
4846
"scanorama>=1.7.4",
4947
"harmonypy>=0.0.10",
5048
"scib>=1.1.5",
49+
"ruff>=0.14.7",
5150
]
5251

53-
5452
[tool.hatch.metadata]
5553
allow-direct-references = true
5654

0 commit comments

Comments
 (0)