Skip to content

Commit

Permalink
in a better working state
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanche committed Dec 22, 2023
1 parent bbc3f15 commit 35a2716
Show file tree
Hide file tree
Showing 3 changed files with 496 additions and 385 deletions.
12 changes: 7 additions & 5 deletions src/summarizedexperiment/BaseSE.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def __init__(
assays: Dict[str, Any],
row_data: Optional[BiocFrame] = None,
col_data: Optional[BiocFrame] = None,
metadata: Optional[Dict] = None,
metadata: Optional[dict] = None,
validate: bool = True,
) -> None:
"""Initialize an instance of ``BaseSE``.
Expand Down Expand Up @@ -243,7 +243,7 @@ def dims(self) -> Tuple[int, int]:

def __repr__(self) -> str:
pattern = (
f"Class BaseSE with {self.shape[0]} features and {self.shape[1]} samples \n"
f"Class {type(self).__name__} with {self.shape[0]} features and {self.shape[1]} samples \n"
f" assays: {', '.join(list(self.assays.keys()))} \n"
f" row_data: {self._rows.names if self._rows is not None else None} \n"
f" col_data: {self._cols.names if self._cols is not None else None}"
Expand Down Expand Up @@ -711,9 +711,10 @@ def get_slice(
columns: Optional[Union[str, int, bool, Sequence]],
) -> "BaseSE":
"""Alias for :py:attr:`~__getitem__`, for back-compatibility."""
current_class_const = type(self)

slicer = self._generic_slice(rows=rows, columns=columns)

current_class_const = type(self)
return current_class_const(
assays=slicer.assays,
row_data=slicer.rows,
Expand All @@ -729,8 +730,9 @@ def __getitem__(
Args:
args:
A sequence or a scalar integer or string, specifying the
columns to retain based on their names or indices.
Integer indices, a boolean filter, or (if the current object is
named) names specifying the ranges to be extracted, see
:py:meth:`~biocutils.normalize_subscript.normalize_subscript`.
Alternatively a tuple of length 1. The first entry specifies
the rows to retain based on their names or indices.
Expand Down
Loading

0 comments on commit 35a2716

Please sign in to comment.