Skip to content
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b1de27d
qc_metrics methods improved with new metrics, tests and docstrings up…
Oct 24, 2025
dd3e67a
skewness and kurtosis left out
Oct 24, 2025
149b6fe
is_constant metric for categorical variables datatype set to boolean
Oct 24, 2025
e9d3fc6
small error fixed
Oct 24, 2025
c8a1319
Merge branch 'main' into enhancement/issue-950
Zethson Nov 22, 2025
de05373
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 22, 2025
e2fc04a
qc_metrics methods improved with new metrics, tests and docstrings up…
Oct 24, 2025
9e41a83
skewness and kurtosis left out
Oct 24, 2025
dd2bee9
is_constant metric for categorical variables datatype set to boolean
Oct 24, 2025
5e143c2
small error fixed
Oct 24, 2025
edaf8d9
Merge branch 'enhancement/issue-950' of github.com:theislab/ehrapy in…
Nov 24, 2025
f5f36f1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 24, 2025
a95cfe9
new argument advanced added to qc_metrics, distinction between catego…
Nov 25, 2025
3839c2e
array types moved from conftest.py to _compat.py
Nov 25, 2025
978a168
Merge branch 'enhancement/issue-950' of github.com:theislab/ehrapy in…
Nov 25, 2025
5ba8e6b
vanilla test advanced added and default fixed
Nov 25, 2025
ddb8931
fixed small things considering the reviews
Nov 28, 2025
736d8bc
_apply_over_time_axis decorator for the functions added
Nov 28, 2025
cb3bc2a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 28, 2025
5d86fc0
forgot to add after pre-commit made changes
Nov 28, 2025
2d6d1f3
Merge branch 'enhancement/issue-950' of github.com:theislab/ehrapy in…
Nov 28, 2025
5ad274c
undo the decorator for the metric functions, since it doesnt work in …
Nov 28, 2025
f5e220d
3d enabled qc metrics
Nov 28, 2025
a8aff81
tests for 3d qc_metrics
Nov 28, 2025
968d12b
updated according to the comments
Dec 3, 2025
943f8e0
advanced argument removed, calculation of advanced metrics dependant …
Dec 3, 2025
afdaca0
is_constant type changed to float
Dec 3, 2025
04457d9
solve imputation errors attempt
Dec 3, 2025
ba86ed6
minimal fix
Dec 3, 2025
fb0ceb3
minimal fix
Dec 3, 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
23 changes: 23 additions & 0 deletions ehrapy/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from typing import TYPE_CHECKING, ParamSpec, TypeVar, cast

import numpy as np
import scipy.sparse as sp

P = ParamSpec("P")
R = TypeVar("R")
Expand Down Expand Up @@ -248,3 +249,25 @@ def wrapper(*args: P.args, **kwargs: P.kwargs) -> R:
return wrapper

return decorator


def asarray(a):
import numpy as np

return np.asarray(a)


def as_dense_dask_array(a, chunk_size=1000):
import dask.array as da

return da.from_array(a, chunks=chunk_size)


ARRAY_TYPES_NUMERIC = (
asarray,
as_dense_dask_array,
sp.csr_array,
sp.csc_array,
) # add coo_array once supported in AnnData
ARRAY_TYPES_NUMERIC_3D_ABLE = (asarray, as_dense_dask_array) # add coo_array once supported in AnnData
ARRAY_TYPES_NONNUMERIC = (asarray, as_dense_dask_array)
Loading
Loading