Skip to content

Commit 3c61bed

Browse files
committed
Fixed missing deps error
1 parent b3471b1 commit 3c61bed

6 files changed

Lines changed: 8 additions & 8 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ requires = [ "hatchling" ]
44

55
[project]
66
name = "decoupler"
7-
version = "2.0.4"
7+
version = "2.0.5"
88
description = "Python package to perform enrichment analysis from omics data."
99
readme = "README.md"
1010
license = { file = "LICENSE" }

src/decoupler/_odeps.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ def _try_import(
1616

1717

1818
def _check_import(
19-
module: types.ModuleType
19+
module: types.ModuleType,
20+
name: str,
2021
) -> None:
2122
if module is None:
22-
name = module.__name__
2323
raise ImportError(
2424
f"{name} is not installed. Please install it using:\n"
25-
f" pip install {name}"
25+
f" pip install {name}\n"
2626
"or install decoupler with full dependencies:\n"
2727
" pip install 'decoupler[full]'"
2828
)

src/decoupler/mt/_mdt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def _func_mdt(
5050
All other keyword arguments are passed to ``xgboost.XGBRegressor``.
5151
%(returns)s
5252
"""
53-
_check_import(xgboost)
53+
_check_import(xgboost, 'xgboost')
5454
nobs = mat.shape[0]
5555
nvar, nsrc = adj.shape
5656
m = f'mdt - fitting {nsrc} multivariate decision tree models (XGBoost) of {nvar} targets across {nobs} observations'

src/decoupler/mt/_udt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def _func_udt(
5454
All other keyword arguments are passed to ``xgboost.XGBRegressor``.
5555
%(returns)s
5656
"""
57-
_check_import(xgboost)
57+
_check_import(xgboost, 'xgboost')
5858
nobs = mat.shape[0]
5959
nvar, nsrc = adj.shape
6060
m = f'udt - fitting {nsrc} univariate decision tree models (XGBoost) of {nvar} targets across {nobs} observations'

src/decoupler/pl/_network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def network(
232232
"""
233233
assert isinstance(net, pd.DataFrame), "net must be pd.DataFrame"
234234
assert (data is None) == (score is None), "data and score must either both be None"
235-
_check_import(ig)
235+
_check_import(ig, 'igraph')
236236
if data is None:
237237
srcs = net["source"].unique().astype("U")
238238
score = pd.DataFrame(np.ones((1, srcs.size)), index=["0"], columns=srcs)

src/decoupler/tl/_rankby_order.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def rankby_order(
6262
df['name'] = adata.var_names
6363
# Fit
6464
if stat == 'dcor':
65-
_check_import(dcor)
65+
_check_import(dcor, 'dcor')
6666
f = dcor.independence.distance_correlation_t_test
6767
elif stat == 'pearsonr':
6868
f = sts.pearsonr

0 commit comments

Comments
 (0)