Skip to content

Commit e11201e

Browse files
authored
Merge pull request #100 from scverse/ig/fix_1d_obsm
(fix): 1d axis arrays
2 parents 8b40aee + 18e26eb commit e11201e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mudata/_core/mudata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def _init_as_view(self, mudata_ref: "MuData", index):
335335
size = getattr(self, attr).shape[0]
336336
for mod, mapping in getattr(mudata_ref, attr + "map").items():
337337
cposmap = np.zeros((size,), dtype=mapping.dtype)
338-
cidx = mapping[idx] > 0
338+
cidx = (mapping[idx] > 0).ravel()
339339
cposmap[cidx > 0] = np.arange(cidx.sum()) + 1
340340
posmap[mod] = cposmap
341341
setattr(self, "_" + attr + "map", posmap)
@@ -1919,7 +1919,7 @@ def _pull_attr(
19191919
for m, mod in self.mod.items():
19201920
if mods is not None and m not in mods:
19211921
continue
1922-
mod_map = attrmap[m]
1922+
mod_map = attrmap[m].ravel()
19231923
mod_n_attr = mod.n_vars if attr == "var" else mod.n_obs
19241924
mask = mod_map != 0
19251925

0 commit comments

Comments
 (0)