Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c7dad8f
WIP catch all warnings
flying-sheep Jul 21, 2025
422cae9
fix some warnings
flying-sheep Jul 21, 2025
bca40a8
test_get works
flying-sheep Jul 21, 2025
02ecd49
hvg works
flying-sheep Jul 21, 2025
218075e
ingest
flying-sheep Jul 21, 2025
6fc449e
logging
flying-sheep Jul 21, 2025
e909c27
neighbors
flying-sheep Jul 21, 2025
73767d5
normalize and todense
flying-sheep Jul 21, 2025
9ca80b8
plotting
flying-sheep Jul 21, 2025
429d017
preprocessing
flying-sheep Jul 21, 2025
0d9341d
qc
flying-sheep Jul 21, 2025
05a259b
rank_genes_groups
flying-sheep Jul 21, 2025
ff44d3d
scaling
flying-sheep Jul 21, 2025
ab396ee
score_genes
flying-sheep Jul 21, 2025
127f42b
sim
flying-sheep Jul 21, 2025
42c4e68
visium_sge
flying-sheep Jul 21, 2025
504d484
refactor preprocessing
flying-sheep Jul 22, 2025
0393f71
confusion matrix
flying-sheep Jul 22, 2025
6cd59d8
doctests
flying-sheep Jul 22, 2025
ab686b5
rest
flying-sheep Jul 22, 2025
d3991f3
relnote
flying-sheep Jul 22, 2025
66c6810
maybe fix file closing
flying-sheep Jul 22, 2025
50db520
Fix doctest env
flying-sheep Jul 22, 2025
4d3580f
follow advice
flying-sheep Jul 22, 2025
ef938f8
fix rest
flying-sheep Jul 22, 2025
5ed7ecb
try fixing leidenalg
flying-sheep Jul 22, 2025
111a3d6
hopefully this works
flying-sheep Jul 22, 2025
be03a09
excel
flying-sheep Jul 22, 2025
b8806c3
nx
flying-sheep Jul 23, 2025
5d494a9
tSNE
flying-sheep Jul 23, 2025
14533e3
h5py
flying-sheep Jul 23, 2025
fd15637
add version
flying-sheep Jul 23, 2025
3944394
pandas
flying-sheep Jul 23, 2025
91bbdef
broader capture
flying-sheep Jul 23, 2025
2c7aef2
maybe actually the last ones!
flying-sheep Jul 23, 2025
e4334fe
speculative fix
flying-sheep Jul 23, 2025
d55eaf0
more speculative fixing yay
flying-sheep Jul 23, 2025
4b6ec91
i really hope that’s it
flying-sheep Jul 23, 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
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:

env:
PYTEST_ADDOPTS: "-v --color=yes -n auto --internet-tests --junitxml=test-data/test-results.xml"
PYTHONTRACEMALLOC: "20"
FORCE_COLOR: "1"
MPLBACKEND: agg
UV_CONSTRAINT: ci/constraints.txt
Expand Down
11 changes: 5 additions & 6 deletions tests/test_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,11 @@ def test_repeated_index_vals(dim, transform, func):
)
def shared_key_adata(request):
kind = request.param
with pytest.warns(ImplicitModificationWarning):
adata = sc.AnnData(
np.arange(50).reshape((5, 10)),
obs=pd.DataFrame(np.zeros((5, 1)), columns=["var_id"]),
var=pd.DataFrame(index=["var_id"] + [f"gene_{i}" for i in range(1, 10)]),
)
adata = sc.AnnData(
Comment thread
ilan-gold marked this conversation as resolved.
np.arange(50).reshape((5, 10)),
obs=dict(var_id=np.zeros(5)),
var=pd.DataFrame(index=["var_id"] + [f"gene_{i}" for i in range(1, 10)]),
)
if kind == "obs_df":
return (
adata,
Expand Down
19 changes: 11 additions & 8 deletions tests/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,17 @@ def test_logfile(tmp_path: Path, caplog: pytest.LogCaptureFixture):

p = tmp_path / "test.log"
s.logpath = p
assert s.logpath == p
assert s.logfile.name == str(p)
log.hint("test2")
log.debug("invisible")
assert s.logpath.read_text() == "--> test2\n"

# setting a logfile removes all handlers
assert not caplog.records
try:
assert s.logpath == p
assert s.logfile.name == str(p)
log.hint("test2")
log.debug("invisible")
assert s.logpath.read_text() == "--> test2\n"

# setting a logfile removes all handlers
assert not caplog.records
finally:
s.logfile.close() # TODO: make this unnecessary


def test_timing(monkeypatch, capsys: pytest.CaptureFixture):
Expand Down
21 changes: 8 additions & 13 deletions tests/test_qc_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,19 +199,14 @@ def adata_mito() -> AnnData:


@pytest.mark.parametrize("cls", ARRAY_TYPES_MEM)
def test_qc_metrics_format(cls, adata_mito: AnnData) -> None:
sc.pp.calculate_qc_metrics(adata_mito, qc_vars=["mito"], inplace=True)
adata = AnnData(X=cls(adata_mito.X), var=adata_mito.var.copy())
sc.pp.calculate_qc_metrics(adata, qc_vars=["mito"], inplace=True)
assert np.allclose(adata.obs, adata_mito.obs)
for col in adata.var: # np.allclose doesn't like mix of types
assert np.allclose(adata.var[col], adata_mito.var[col])


def test_qc_metrics_format_str_qc_vars(adata_mito: AnnData) -> None:
sc.pp.calculate_qc_metrics(adata_mito, qc_vars="mito", inplace=True)
adata = AnnData(X=adata_mito.X, var=adata_mito.var.copy())
sc.pp.calculate_qc_metrics(adata, qc_vars="mito", inplace=True)
@pytest.mark.parametrize("qc_var_param", ["mito", ["mito"]], ids=["str", "list"])
def test_qc_metrics_format(
cls, adata_mito: AnnData, qc_var_param: list[str] | str
) -> None:
var = adata_mito.var.copy()
sc.pp.calculate_qc_metrics(adata_mito, qc_vars=qc_var_param, inplace=True)
adata = AnnData(X=cls(adata_mito.X), var=var)
sc.pp.calculate_qc_metrics(adata, qc_vars=qc_var_param, inplace=True)
assert np.allclose(adata.obs, adata_mito.obs)
for col in adata.var: # np.allclose doesn't like mix of types
assert np.allclose(adata.var[col], adata_mito.var[col])
Expand Down
Loading