Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
gtca authored Aug 29, 2024
2 parents 5ce7750 + f0d2a20 commit b35c776
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/mudata/_core/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from anndata import concat as ad_concat
from anndata._core.merge import (
StrategiesLiteral,
_resolve_dim,
_resolve_axis,
check_combinable_cols,
concat_pairwise_mapping,
dim_indices,
Expand Down Expand Up @@ -168,8 +168,8 @@ def concat(
)

# Then concatenate multimodal annotations
axis, dim = _resolve_dim(axis=axis)
alt_axis, alt_dim = _resolve_dim(axis=1 - axis)
axis, dim = _resolve_axis(axis=axis)
alt_axis, alt_dim = _resolve_axis(axis=1 - axis)

# Label column
label_col = pd.Categorical.from_codes(
Expand Down
17 changes: 13 additions & 4 deletions src/mudata/_core/mudata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1342,21 +1342,30 @@ def _shrink_attr(self, attr: str, inplace=True) -> pd.DataFrame:
@property
def n_mod(self) -> int:
"""
Number of modalities in the MuData object
Number of modalities in the MuData object.
Returns:
int: The number of modalities.
"""
return len(self.mod)

@property
def isbacked(self) -> bool:
"""
Whether the MuData object is backed
Whether the MuData object is backed.
Returns:
bool: True if the object is backed, False otherwise.
"""
return self.filename is not None
return self.file.filename is not None

@property
def filename(self) -> Path | None:
"""
Filename of the MuData object
Filename of the MuData object.
Returns:
Path | None: The path to the file if backed, None otherwise.
"""
return self.file.filename

Expand Down

0 comments on commit b35c776

Please sign in to comment.