Skip to content

Commit c578182

Browse files
committed
simplify
1 parent 86fed09 commit c578182

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/mudata/_core/mudata.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -519,11 +519,7 @@ def __getitem__(self, index) -> AnnData | MuData:
519519
except KeyError as e:
520520
if index.acc.dim in ("obs", "var"):
521521
for modname, mod in self._mod.items():
522-
try:
523-
index.acc.get(mod, index.idx)
524-
except KeyError:
525-
pass
526-
else:
522+
if index in mod:
527523
raise KeyError(
528524
f"There is no key {index.idx} in MuData .{index.acc.dim} but there is one in {modname} .{index.acc.dim}. Consider running `pull_{index.acc.dim}()` to update global .{index.acc.dim}."
529525
) from e

0 commit comments

Comments
 (0)