Skip to content

Commit 703647e

Browse files
committed
fixes to the utils file
1 parent 9b447ea commit 703647e

File tree

3 files changed

+56
-66
lines changed

3 files changed

+56
-66
lines changed

.github/workflows/benchmark.yml

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
11
name: Benchmark
22

33
on:
4-
push:
5-
branches: [main]
6-
pull_request:
7-
branches: [main]
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
88

99
env:
10-
FORCE_COLOR: "1"
10+
FORCE_COLOR: "1"
1111

1212
defaults:
13-
run:
14-
shell: bash -e {0} # -e to fail on error
13+
run:
14+
shell: bash -e {0} # -e to fail on error
1515

1616
jobs:
17-
benchmark:
18-
runs-on: ${{ matrix.os }}
19-
20-
strategy:
21-
fail-fast: false
22-
matrix:
23-
python: ["3.13"]
24-
os: [ubuntu-latest]
25-
26-
env:
27-
OS: ${{ matrix.os }}
28-
PYTHON: ${{ matrix.python }}
29-
ASV_DIR: "./benchmarks"
30-
31-
steps:
32-
- uses: actions/checkout@v4
33-
with:
34-
fetch-depth: 0
35-
36-
- name: Fetch main branch for `asv run`’s hash
37-
run: git fetch origin main:main
38-
if: ${{ github.ref_name != 'main' }}
39-
40-
- name: Set up Python ${{ matrix.python }}
41-
uses: actions/setup-python@v5
42-
with:
43-
python-version: ${{ matrix.python }}
44-
cache: 'pip'
45-
46-
- name: Cache datasets
47-
uses: actions/cache@v4
48-
with:
49-
path: |
50-
~/.cache
51-
key: benchmark-state-${{ hashFiles('benchmarks/**') }}
52-
53-
- name: Install dependencies
54-
run: pip install 'asv>=0.6.4'
55-
56-
- name: Configure ASV
57-
working-directory: ${{ env.ASV_DIR }}
58-
run: asv machine --yes
59-
60-
- name: Quick benchmark run
61-
working-directory: ${{ env.ASV_DIR }}
62-
run: asv run --dry-run --quick --show-stderr --verbose HEAD^!
17+
benchmark:
18+
runs-on: ${{ matrix.os }}
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
python: ["3.13"]
24+
os: [ubuntu-latest]
25+
26+
env:
27+
OS: ${{ matrix.os }}
28+
PYTHON: ${{ matrix.python }}
29+
ASV_DIR: "./benchmarks"
30+
31+
steps:
32+
- uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
36+
- name: Fetch main branch for `asv run`’s hash
37+
run: git fetch origin main:main
38+
if: ${{ github.ref_name != 'main' }}
39+
40+
- name: Set up Python ${{ matrix.python }}
41+
uses: actions/setup-python@v5
42+
with:
43+
python-version: ${{ matrix.python }}
44+
cache: "pip"
45+
46+
- name: Cache datasets
47+
uses: actions/cache@v4
48+
with:
49+
path: |
50+
~/.cache
51+
key: benchmark-state-${{ hashFiles('benchmarks/**') }}
52+
53+
- name: Install dependencies
54+
run: pip install 'asv>=0.6.4'
55+
56+
- name: Configure ASV
57+
working-directory: ${{ env.ASV_DIR }}
58+
run: asv machine --yes
59+
60+
- name: Quick benchmark run
61+
working-directory: ${{ env.ASV_DIR }}
62+
run: asv run --dry-run --quick --show-stderr --verbose HEAD^!

benchmarks/asv.conf.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
// "uninstall_command": ["return-code=any python -mpip uninstall -y {project}"],
2626
"build_command": [
2727
"python -m pip install build",
28-
"python -m build --wheel -o {build_cache_dir} {build_dir}",
28+
"python -m build --wheel -o {build_cache_dir} {build_dir}"
2929
],
3030

3131
// List of branches to benchmark. If not provided, defaults to "master"
@@ -73,7 +73,7 @@
7373
"matrix": {
7474
"numpy": [""],
7575
"scipy": [""],
76-
"squidpy": [""],
76+
"squidpy": [""]
7777
},
7878

7979
// Combinations of libraries/python versions can be excluded/included
@@ -123,7 +123,7 @@
123123

124124
// The directory (relative to the current directory) that the html tree
125125
// should be written to. If not provided, defaults to "html".
126-
"html_dir": ".asv/html",
126+
"html_dir": ".asv/html"
127127

128128
// The number of characters to retain in the commit hashes.
129129
// "hash_length": 8,

benchmarks/benchmarks/_utils.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,6 @@ def get_dataset(dataset: Dataset, *, layer: KeyX = None) -> tuple[AnnData, str |
6969
return adata, batch_key
7070

7171

72-
def get_count_dataset(dataset: Dataset, *, layer: KeyCount = "counts") -> tuple[AnnData, str | None]:
73-
adata, batch_key = _get_dataset_raw(dataset)
74-
75-
adata.X = adata.layers.pop(layer)
76-
# remove indicators that X was transformed
77-
adata.uns.pop("log1p", None)
78-
79-
return adata, batch_key
80-
81-
8272
def param_skipper(param_names: Sequence[str], params: tuple[Sequence[object], ...]) -> ParamSkipper:
8373
"""Create a decorator that will skip all combinations that contain any of the given parameters.
8474

0 commit comments

Comments
 (0)