Skip to content

Commit eb61356

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 3fd0e72 commit eb61356

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/moscot/base/problems/_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ def wrapper(*args, **kwargs):
695695
ixs = [np.arange(i * step, min((i + 1) * step, collection.shape[0])) for i in range(n_split)] # type: ignore # noqa: E501
696696
ixs[-1] = np.append(ixs[-1], np.arange(ixs[-1][-1] + 1, collection.shape[0])) # type: ignore
697697

698-
collections = [collection[ix, :] for ix in filter(len, ixs)] # type:ignore[call-overload]
698+
collections = [collection[ix, :] for ix in filter(len, ixs)] # type: ignore[call-overload]
699699
else:
700700
collections = list(filter(len, np.array_split(collection, n_split)))
701701

src/moscot/base/problems/problem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def _split_mass(arr: ArrayLike) -> ArrayLike:
181181
else np.ones((adata.n_obs,), dtype=float)
182182
)
183183
else:
184-
sset = subset if isinstance(subset, list) else [subset] # type:ignore[list-item]
184+
sset = subset if isinstance(subset, list) else [subset] # type: ignore[list-item]
185185
data = np.asarray(adata.obs[data].isin(sset), dtype=float)
186186
else:
187187
data = np.asarray(data, dtype=float)

src/moscot/problems/_utils.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def _handle_mapping_joint_attr(
5353
}
5454
return xy, xy_callback, xy_callback_kwargs # type: ignore[return-value]
5555

56-
if joint_attr.get("tag", None) == "cost_matrix" and (len(joint_attr) == 2 or joint_attr.get("attr") == "obsp"):
56+
if joint_attr.get("tag") == "cost_matrix" and (len(joint_attr) == 2 or joint_attr.get("attr") == "obsp"):
5757
joint_attr.setdefault("cost", "custom")
5858
joint_attr.setdefault("attr", "obsp")
5959
xy_callback = "cost-matrix"
@@ -100,9 +100,9 @@ def handle_cost(
100100
"y": (y or y_callback) and "cost" not in y,
101101
}
102102
if isinstance(cost, Mapping):
103-
cost_candidates = {k: cost[k] for k, v in cost_candidates.items() if v} # type:ignore[index,misc]
103+
cost_candidates = {k: cost[k] for k, v in cost_candidates.items() if v} # type: ignore[index,misc]
104104
elif isinstance(cost, str):
105-
cost_candidates = {k: cost for k, v in cost_candidates.items() if v} # type:ignore[misc]
105+
cost_candidates = {k: cost for k, v in cost_candidates.items() if v} # type: ignore[misc]
106106
else:
107107
raise TypeError(f"Expected `cost` to be either `str` or `dict`, found `{type(cost)}`.")
108108

@@ -120,9 +120,9 @@ def handle_cost(
120120
for k, v in items:
121121
xy[f"x_{k}"] = xy[f"y_{k}"] = v
122122
if "x" in cost_candidates:
123-
x.update(cost_kwargs.get("x", cost_kwargs)) # type:ignore[call-overload]
123+
x.update(cost_kwargs.get("x", cost_kwargs)) # type: ignore[call-overload]
124124
if "y" in cost_candidates:
125-
y.update(cost_kwargs.get("y", cost_kwargs)) # type:ignore[call-overload]
125+
y.update(cost_kwargs.get("y", cost_kwargs)) # type: ignore[call-overload]
126126
return xy, x, y
127127

128128

@@ -199,5 +199,5 @@ def handle_cost_tmp(
199199
for k, v in items:
200200
xy[f"xy_{k}"] = xy[f"xy_{k}"] = v
201201
if xx and cost_kwargs: # extract cost_kwargs explicit to x-term if possible
202-
xx.update(cost_kwargs.get("xx", cost_kwargs)) # type:ignore[call-overload]
202+
xx.update(cost_kwargs.get("xx", cost_kwargs)) # type: ignore[call-overload]
203203
return xy, xx

src/moscot/problems/time/_lineage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def solve(
252252
"""
253253
if self.problem_kind == "linear":
254254
kwargs["lse_mode"] = lse_mode
255-
return super().solve( # type:ignore[return-value]
255+
return super().solve( # type: ignore[return-value]
256256
epsilon=epsilon,
257257
tau_a=tau_a,
258258
tau_b=tau_b,

0 commit comments

Comments
 (0)